[ ABORT TO HUD ]
SEQ. 1
Production Architecture
🏭 Production MLOps⏱ 15 min⭐ 150 BASE XP
From Prototype to Production
Model Selection Framework
| Requirement | Recommended Model | Engine |
|---|---|---|
| Quick prototyping | Mistral Small 4 / Qwen3-8B | Ollama |
| Production chat (single GPU) | Qwen3-32B-AWQ / Mistral-24B | vLLM |
| Enterprise multi-user | Mistral Large 3 / Llama 3.3 70B | vLLM + Kubernetes |
| Edge / IoT | Gemma 4 E2B / Ministral 3B | llama.cpp / Ollama |
| RAG / agents | DeepSeek-V3 / Qwen3-72B | SGLang |
Container-Based Production Stack
# docker-compose.yml - Full production stack
services:
inference:
image: vllm/vllm-openai:latest
runtime: nvidia
ports: ["8000:8000"]
volumes: ["./models:/models"]
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
command: >
--model /models/Mistral-Large-3-AWQ
--quantization awq
--tensor-parallel-size 2
--gpu-memory-utilization 0.9
--max-model-len 32768
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
proxy:
image: nginx:alpine
ports: ["443:443", "80:80"]
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
- ./certs:/etc/nginx/certs
depends_on: [inference]
monitoring:
image: grafana/grafana:latest
ports: ["3000:3000"]
volumes: ["./grafana:/var/lib/grafana"]
Key Metrics to Monitor
- Throughput: Tokens/second (aggregate and per-request)
- Latency: P50, P95, P99 response times
- VRAM Usage: Model weights + KV cache + overhead
- Queue Depth: Pending requests (indicates capacity limits)
- Cost/Token: Hardware amortization per token generated
Security Checklist
- ✅ Reverse proxy with TLS termination
- ✅ API key authentication at proxy layer
- ✅ Rate limiting per client
- ✅ Input sanitization (prompt injection defense)
- ✅ Output filtering (PII, harmful content)
- ✅ Network isolation (no direct internet access for inference)
- ✅ Regular model updates and security patches
Open-Source SOE (Standard Operating Environment)
| Layer | Standard / Baseline | Hardening & Pinning Rule |
|---|---|---|
| Kernel & Driver | Linux Kernel 6.8+ LTS / NVIDIA Driver 550+ | Pinned host drivers; enforce persistent GPU mode (nvidia-smi -pm 1) |
| Compute Runtime | CUDA 12.8 / cuDNN 9.x / PyTorch 2.6+ | Fixed Docker container layers; prevent dynamic library drift |
| Inference Engine | vLLM V1 Engine / SGLang / llama.cpp b3600+ | Pinned engine container tag; disable unauthenticated debug endpoints |
| Artifact Integrity | Hugging Face Hub / Safetensors only | Enforce SHA256 checksum verification; block pickle/PyTorch bin formats |
Open-Source AOE (AI Operations Engineering) Blueprint
- Prometheus Inference Telemetry: Scrape
vllm:num_requests_running,vllm:gpu_cache_usage_factor, andvllm:time_to_first_token_secondsevery 5 seconds. - Latency & TTFT SLAs: Enforce strict TTFT (Time To First Token) < 250ms and ITL (Inter-Token Latency) < 25ms P95 bounds.
- Memory Pressure Circuit Breakers: When GPU KV cache usage exceeds 92%, trigger preemptive request shedding or redirect traffic to quantized standby workers (AWQ/FP8).
- Continuous Batching & Chunked Prefill: Configure chunked prefill (
--enable-chunked-prefill) to prevent long prompts from starving conversational streams. - Canary Rollouts & Shadow Traffic: Replay 5% of production query streams to canary model instances to validate perplexity and latency drift before full traffic cutover.
💡 For teams without heavy iron: Start with a single NVIDIA GPU (RTX 4090 = 24GB VRAM). Run Mistral Small 4 or Qwen3-8B in a Docker container. This handles most small-team production workloads at near-zero marginal cost. Scale to multi-GPU with Kubernetes + vLLM only when throughput demands it.
KNOWLEDGE CHECK
QUERY 1 // 3
What is the recommended starting point for teams without hyperscaler-level hardware?
Don't use open source
Single GPU (e.g., RTX 4090) with Docker container
Cloud APIs only
Buy an A100 cluster