Skip to content

Makefile and config

Make targets, Python packaging, requirements and the environment template.

.env.example Env · 18 lines
# Copy to .env and fill in. .env is git-ignored — never commit keys.
# Which server scripts use when you don't pass --target (mock|ollama|llamacpp|mlx|fireworks|spark)
TARGET=mock
# --- Fireworks (lessons 01, 06b, 07, 08, 10, 13) ---
FIREWORKS_API_KEY=fw_xxxxxxxxxxxxxxxx
FIREWORKS_ACCOUNT_ID=your-account-id
# Look up current ids at https://app.fireworks.ai/models
FIREWORKS_MODEL=accounts/fireworks/models/gpt-oss-120b
# --- local servers ---
OLLAMA_MODEL=llama3.1:8b
MLX_MODEL=mlx-community/Meta-Llama-3.1-8B-Instruct-4bit
# --- DGX Spark (lesson 14) ---
SPARK_IP=your-spark-host
SPARK_MODEL=nvidia/Llama-3.1-8B-Instruct-FP8
.gitignore Text · 24 lines
.env
.venv/
__pycache__/
*.egg-info/
results/*
!results/.gitkeep
adapters/
lessons/11-lora-local-mlx/fused/
*.safetensors
*.gguf
.DS_Store
lessons/04-quantization/models/
lessons/04-quantization/bench/
lessons/05-kv-cache/logs/
lessons/06-prefix-caching/preamble.txt
lessons/08-batch-api/*.jsonl
lessons/10-lora-fireworks/.state
lessons/11-lora-local-mlx/adapters/
lessons/17-full-vs-peft-mlx/logs/
lessons/17-full-vs-peft-mlx/adapters/
lessons/18-preference-dpo/data/
lessons/18-preference-dpo/adapters/
lessons/18-preference-dpo/.state
LICENSE Text · 21 lines
MIT License
Copyright (c) 2026 Maruthi Prithivirajan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Makefile Makefile · 19 lines
# Shortcuts. `make help` lists them.
.PHONY: help setup mock check data smoke clean-results fw-check
help: ## list targets
@grep -E '^[a-z-]+:.*##' Makefile | awk -F':.*## ' '{printf " make %-14s %s\n", $$1, $$2}'
setup: ## Mac: install ollama, llama.cpp, venv, felab (lesson 00)
bash lessons/00-setup/setup_mac.sh
mock: ## run the offline mock LLM server on :9000
python -m felab.mock_server
check: ## chip, RAM, bandwidth, which servers are up
python lessons/00-setup/check_env.py
data: ## build data/tickets/*.jsonl
python data/make_tickets.py
smoke: ## run every offline lesson against the mock (~2 min)
bash scripts/smoke_test.sh
fw-check: ## is anything on Fireworks still billing?
bash lessons/00-setup/fireworks_guardrails.sh
clean-results: ## wipe results/ (your measurements!)
rm -f results/*.csv results/*.png results/*.md
pyproject.toml TOML · 13 lines
[project]
name = "felab"
version = "1.0.0"
description = "Follow-along labs for the AI Field Engineer / AI engineering"
requires-python = ">=3.10"
dependencies = ["openai>=1.40", "jsonschema>=4"]
[project.optional-dependencies]
plot = ["matplotlib>=3.8"]
mac = ["mlx-lm>=0.20"] # Apple silicon only
[tool.setuptools]
packages = ["felab"]
requirements.txt Text · 7 lines
# core — every lesson
openai>=1.40
jsonschema>=4
# charts (lessons 03, 04) — optional, scripts fall back to text tables
matplotlib>=3.8
# Apple silicon only (lessons 02, 06, 11) — comment out on Linux
mlx-lm>=0.20