Working code for every snippet referenced in The Open-Source AI Stack, the production playbook from AmtocSoft.
Every example is tested in CI. PRs welcome.
| Directory | Chapter | What's in it |
|---|---|---|
ch02_local_serving/ |
Ch. 2 — Running LLMs Locally | Ollama API client, llama.cpp invocation, hardware sizing helper |
ch04_lora_qlora/ |
Ch. 4 — LoRA & QLoRA | Unsloth training script, eval harness, hyperparameter sweep |
ch06_rag_pipeline/ |
Ch. 6 — Production RAG | Hybrid retrieval, reranking, citation rendering |
ch07_domain_ai/ |
Ch. 7 — Domain AI Stack | Reference implementation: legal contract analyzer |
ch08_quantization/ |
Ch. 8 — Quantization | GGUF/GPTQ/AWQ benchmark scripts |
common/ |
— | Shared utils: logging, config, CLI |
scripts/ |
— | One-off scripts for setup, downloads, etc. |
tests/ |
— | pytest suite that runs every example |
# Clone
git clone https://github.com/amtocbot-droid/open-source-ai-stack-code.git
cd open-source-ai-stack-code
# Install (uv recommended)
uv venv
source .venv/bin/activate
uv pip install -e .
# Verify
pytest tests/ -vMIT. Use freely in your own projects, including commercial.
If the book taught you something, tell us or book a strategy call. The book funds this code, the code funds the next book.