Blog.

Thoughts on AI, ML, and building intelligent systems

FastAPILangChainDocker

FastAPI + LangChain + Docker: My Blueprint for Shipping LLM Microservices to Production

A working architecture for turning an LLM prototype into a production-ready microservice — covering streaming, semantic caching, automatic provider fallback, and a real Kubernetes deployment path.

What's Inside

01The gap between 'the model works' and 'the service survives real traffic'
02End-to-End Architecture: FastAPI → LangChain → Docker → Kubernetes
03Streaming FastAPI Endpoints with astream (not blocking invoke)
04Health Probes and Pydantic Input Validation
05Per-Session Rate Limiting to Protect LLM Budget
06Semantic Caching with RedisSemanticCache (catch near-duplicate queries)
07Automatic Provider Fallback with .with_fallbacks()
08Environment-Driven Model Configuration (no hardcoded versions)
09RAG Retriever Integration Point in the Chain
10Multi-Stage Docker Build for Lean, Secure Images
11Non-Root Container Users and HEALTHCHECK
12docker-compose for One-Command Local Development
13Kubernetes Deployment: Resource Limits and Liveness/Readiness Probes
14HorizontalPodAutoscaler for Traffic Spikes
15CI/CD Pipeline: Lint → Test → Build → Push → Deploy
16Observability with Langfuse / LangSmith
173 Real Mistakes: Caching, Single Provider, Bloated Images
18FAQ: Kubernetes vs. docker-compose, Self-host vs. API, Cost Control
Jul 18, 20267 min read
Read on Hashnode
AI EngineeringProduction LLMsLLM Latency

Prompt Engineering Got You a Demo. Here's Why Your AI Will Fail in Production

Prompt engineering gets you a demo. This guide covers everything you need to actually ship AI in production.

What's Inside

01Harness Engineering vs. Prompt Engineering
02Context Engineering vs. Long Prompts
03Caching: Prompt Caching, Semantic Caching, and the KV Cache
04Prefill vs. Decode: Why They Optimize Differently
05Continuous Batching, Paged Attention, and Throughput
06Speculative Decoding, Quantization, and Distillation
07Quantization Formats: INT8, INT4, FP8, AWQ, GPTQ
08Structured Output Failures and Repair Loops
09Function Calling Reliability and Tool Contracts
10Agent Guardrails: Loop Budgets and Termination
11Model Routing and Graceful Degradation
12RAG Architecture: Chunking to Reranking
13Retrieval Evals: Recall, Precision, Grounding
14Evals as a Discipline
15LLM Observability
16Cost Attribution Beyond Per-Model Pricing
17Safety Engineering: Injection, Leakage, Permissions
18Multi-Tenant Isolation
19Fine-Tuning vs. ICL vs. RAG vs. Distillation
20Tradeoffs Across the Inference Stack
21Production Failure Modes
22FAQ
Jun 30, 202615 min read
Read on Hashnode
Agentic AIAI AgentsCode Execution

Multi-Agent Dead Reckoning: The Hidden Failure Mode in Vibe Coding Systems in 2026

Most multi-agent AI systems do not fail immediately—they drift slowly. This post explains why coordination drift happens and how to prevent it.

What's Inside

01What Is Multi-Agent Dead Reckoning?
02The Handoff Trap: Trusting Previous Agent Outputs
03Three Main Failure Modes: Cascade, Topology, Consensus
04Cascade Amplification: How Small Errors Propagate
05Topological Sensitivity: How Structure Affects Reasoning
06Consensus Inertia: The Danger of Shared Bad Context
07Why Long-Running Workflows Amplify Drift in 2026
08The Solution: Explicit Re-Anchoring Loops
09Role Isolation: Separate Planner, Executor, and Reviewer Roles
10Periodic Objective Reset: Re-Stating Goals Mid-Workflow
11Adversarial Debugging: Implementing Contradiction Agents
12Semantic Validation: Checking Intent Over Simple Outputs
13Implementation: Building a Simple Drift Check Function
14Debunking Myths: Scaling Agents vs. Scaling Coordination
15Debugging Social Failures: Tracking Information Propagation
May 7, 20268 min read
Read on Hashnode
Let's Talk Let's Talk Let's Talk Let's Talk Let's Talk Let's Talk Let's Talk Let's Talk
All rights reservedVinay Chaudhari© 2026