Building a Production AI Stack — Vector DB, LLM, Auth, Observability

Manish Garg
Manish Garg Associate of (ISC)² · RingSafe
Apr 29, 2026
9 min read
Read as
A real production AI application has 6-8 components: LLM (own or API), embedding model, vector DB, prompt cache, auth, rate limit, content moderation, observability. This module is the reference architecture — what tools, how they connect, what to monitor, how to deploy on a budget.

Most “AI app” tutorials show a one-file script that calls OpenAI. Production needs more. This module is the actual architecture you will run, the choices that scale, and the observability that lets you debug at 2am.

Reference architecture

Layer by layer. Edge / CDN: Cloudflare in front for rate limit, WAF, geo-restriction. Application backend: Next.js or FastAPI on Vercel/Railway/Fly.io. Handles auth, request validation, prompt construction. LLM gateway: LiteLLM or Helicone proxy. Routes between providers (OpenAI/Anthropic/self-hosted). Adds caching, retries, fallback. Vector DB: Qdrant (self-hosted) or Pinecone (managed) for RAG. Embedding model: BGE-M3 (self-hosted) or OpenAI text-embedding-3-small. Cache: Redis for prompt-response cache and rate limit counters. Database: Postgres for user data, conversation history, audit logs. Observability: Langfuse (open source) or LangSmith for AI traces; Sentry for errors; Grafana for metrics.

Need help with this?

Book a free 30-minute scoping call

Our senior consultants will review your stack and tell you honestly what to fix first. No slide deck. No obligation. Indian businesses only.

Book scoping call Replies in 4 working hrs · India-only · Senior consultants