06. Infra & Local Ops¶
Requirements¶
- Apple Silicon Mac with MLX GPU (
mx.default_device()) - Python ≥3.11,
uv - OpenAI-compatible API for compression
- Optional: Node 22 + pnpm for visualizer
- Disk: on the order of ~10 GB noted in
STEPS.mdfor full artifacts
Setup¶
uv sync
cp .env.example .env # OPENAI_API_KEY, OPENAI_API_BASE, OPENAI_MODEL
uv run python -c "import mlx.core as mx; print(mx.default_device())"
Pull heavy artifacts from HF if data/ / adapters/ are empty.
Makefile targets¶
| Target | Purpose |
|---|---|
train |
LoRA SFT (ITERS, SAVE_EVERY overridable) |
eval-base / eval-ft / eval-all |
GSM8K evals (LIMIT, BATCH_SIZE) |
plot |
Build report charts |
clean |
Remove generated local outputs (see Makefile) |
Topology¶
graph TD
classDef default fill:#1e293b,stroke:#38bdf8,stroke-width:2px,color:#f8fafc
classDef highlight fill:#065f46,stroke:#34d399,stroke-width:2px,color:#f0fdf4
Mac["Mac MLX scripts"]:::highlight
API["Compression API"]
HF["Hugging Face Hub"]
Pages["GitHub Pages visualizer"]
Mac --> API
Mac --> HF
Pages --> HF
linkStyle default stroke:#64748b,stroke-width:2px
No Docker Compose for training. Only CI is visualizer deploy.
Interview Q&A¶
Q: Can this train on CUDA?
A: Not as written — the stack is MLX-specific. Porting would mean swapping generate/train/eval backends.