Overview
A practical deep dive into building production-ready LLM inference, RAG, and fine-tuning systems with FastAPI β framed around real customer problems and FDE-style architectural thinking.
Every topic answers: "A customer needed X β here's the architecture and tradeoffs."
Roadmapβ
LLM Inferenceβ
| # | Topic | What it covers |
|---|---|---|
| 1 | Model Serving | Lifespan model loading, single vs batch inference, state across workers |
| 2 | vLLM | PagedAttention, continuous batching, chunked prefill, prefix caching, quantization |
| 3 | Streaming Responses | SSE for LLM token streaming, WebSocket endpoints, StreamingResponse |
| 4 | Background Tasks | BackgroundTasks, Celery/ARQ for distributed queues, job status polling |
| 5 | LLM / Agent Endpoints | Wrapping Claude SDK / LangChain, tool-calling, streaming agent responses |
RAGβ
| # | Topic | What it covers |
|---|---|---|
| 6 | RAG | Pipeline map, when RAG beats long context, the four failure points |
| 7 | Ingestion & Indexing | Parsing/OCR, chunking, embeddings, multi-tenant metadata, HNSW vs IVFFlat |
| 8 | Retrieval | Hybrid search, BM25, RRF, metadata filtering, reranking, agentic retrieval |
| 9 | Evaluation & Guardrails | Recall@k and MRR, RAGAS, how much eval is enough, escalation thresholds |
| 10 | Production | Latency budget, corpus scaling, tenant isolation, airgapped deployment |
Fine-Tuningβ
| # | Topic | What it covers |
|---|---|---|
| 11 | Fine-Tuning | When to fine-tune, benefits and costs, full fine-tuning vs PEFT, pitfalls |
| 12 | LoRA | Low-rank updates, rank/alpha/target layers, QLoRA, merge vs multi-LoRA serving |
| 13 | Distillation | Sequence-level distillation with LoRA, on-policy logit distillation (reverse vs top-K forward KL) |
Archive β FastAPI Foundationsβ
Kept as local drafts. They are not published to the site; open them in the repo or run the dev server to read them.
| Topic | What it covers |
|---|---|
| API Fundamentals | HTTP methods, status codes, request/response anatomy, REST conventions |
| Routing & Validation | Path/query params, request bodies, Pydantic v2 models, response models |
| Dependency Injection | Depends(), sub-dependencies, DI for DB sessions, auth, config |
| Async Foundations | async def vs def, event loop, threadpool executors for sync code |
| Project Structure | Router-based layout, schemas/services/repositories separation, pydantic-settings |
| OpenAPI & Docs | Auto-generated Swagger/ReDoc, schema metadata, versioned doc endpoints |
| Auth Patterns | JWT with OAuth2, API key auth, role-based access control via DI |
For GCP-native ML infrastructure (Vertex AI, pipelines, feature stores), see the PCA Vertex AI reference.