I don't know what am I doing but its good, yk, take a look
A part of comprehensive lab work for getting into depths of modern Large Language Models and how are they trained, evaluated, served, and deployed.
Core internals behind production LLM systems instead of treating them as black boxes.
llm-lab
┌─────────────────────────┐
│ Datasets │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ Training Pipeline │
│ • LoRA │
│ • QLoRA │
│ • SFT │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ Evaluation Pipeline │
│ • Benchmarks │
│ • LLM-as-a-Judge │
│ • Pairwise Evaluation │
│ • Failure Analysis │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ Inference Engine │
│ • Scheduler │
│ • KV Cache │
│ • Static Batching │
│ • Sampling │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ Serving Layer │
│ • FastAPI │
│ • SSE Streaming │
│ • OpenAI API │
│ • Metrics │
└────────────┬────────────┘
│
▼
┌─────────────────────────┐
│ Deployment │
│ • Docker │
│ • Docker Compose │
└─────────────────────────┘
- Transformer inspection
- LoRA
- QLoRA
- Adapter merging
- Supervised Fine-tuning (SFT)
- Reference-based evaluation
- LLM-as-a-Judge
- Pairwise evaluation
- Lexical metrics
- Benchmark datasets
- Failure analysis

- Autoregressive generation
- KV Cache
- Quantization
- Static batching
- Scheduler
- Generation state management
- FastAPI inference server
- Server-Sent Events (SSE) streaming
- OpenAI-compatible Chat Completions API
- Health endpoint
- Model metadata endpoint
- Performance metrics
- Docker
- Docker Compose
src/
├── training/
├── evaluation/
├── inference/
│ ├── engine/
│ └── serving/
└── datasets/
curl -X POST http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model":"TinyLlama",
"messages":[
{
"role":"user",
"content":"Explain KV Cache."
}
]
}'curl -N \
-X POST \
http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model":"TinyLlama",
"messages":[
{
"role":"user",
"content":"Explain KV Cache."
}
],
"stream":true
}'- LoRA
- QLoRA
- Evaluation Pipeline
- Inference Engine
- Serving
- OpenAI-Compatible API
- Deployment
MIT



