Skip to main content

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​

#TopicWhat it covers
1Model ServingLifespan model loading, single vs batch inference, state across workers
2vLLMPagedAttention, continuous batching, chunked prefill, prefix caching, quantization
3Streaming ResponsesSSE for LLM token streaming, WebSocket endpoints, StreamingResponse
4Background TasksBackgroundTasks, Celery/ARQ for distributed queues, job status polling
5LLM / Agent EndpointsWrapping Claude SDK / LangChain, tool-calling, streaming agent responses

RAG​

#TopicWhat it covers
6RAGPipeline map, when RAG beats long context, the four failure points
7Ingestion & IndexingParsing/OCR, chunking, embeddings, multi-tenant metadata, HNSW vs IVFFlat
8RetrievalHybrid search, BM25, RRF, metadata filtering, reranking, agentic retrieval
9Evaluation & GuardrailsRecall@k and MRR, RAGAS, how much eval is enough, escalation thresholds
10ProductionLatency budget, corpus scaling, tenant isolation, airgapped deployment

Fine-Tuning​

#TopicWhat it covers
11Fine-TuningWhen to fine-tune, benefits and costs, full fine-tuning vs PEFT, pitfalls
12LoRALow-rank updates, rank/alpha/target layers, QLoRA, merge vs multi-LoRA serving
13DistillationSequence-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.

TopicWhat it covers
API FundamentalsHTTP methods, status codes, request/response anatomy, REST conventions
Routing & ValidationPath/query params, request bodies, Pydantic v2 models, response models
Dependency InjectionDepends(), sub-dependencies, DI for DB sessions, auth, config
Async Foundationsasync def vs def, event loop, threadpool executors for sync code
Project StructureRouter-based layout, schemas/services/repositories separation, pydantic-settings
OpenAPI & DocsAuto-generated Swagger/ReDoc, schema metadata, versioned doc endpoints
Auth PatternsJWT 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.