For an app whose core feature is a language model
The AI app stack
One framework, one Postgres, one model provider — and eyes on every token you burn.
Next.js plus the Vercel AI SDK is the shortest path from a streaming chat UI to a production endpoint, and Claude is the model that endpoint calls — with prompt caching that makes long-context and RAG cheap enough to actually ship. Supabase keeps your app rows and your embeddings in one Postgres so retrieval isn't a second database to babysit, Langfuse watches every call so cost and bad prompts don't surprise you, and Stripe passes the token bill through to users. The whole set is chosen around the one thing that makes an AI app different from a normal SaaS: you pay per request, so you must see, gate, and bill for every one.
The stack
- FrameworkNext.js ↗Server routes stream tokens straight to a React UI out of the box — it's where AI chat apps already live.
- AI orchestrationVercel AI SDKHandles streaming, tool calls, and structured outputs so you're not hand-rolling SSE plumbing on day one.
- ModelAnthropic Claude APIStrong reasoning and tool use, plus prompt caching that makes long-context and RAG cheap enough to run in production.
- Data + RAGSupabaseYour rows and your embeddings in one database, so retrieval isn't a whole second system to operate.
- LLM observabilityLangfuseTraces, evals, and per-call cost/latency so you can debug prompts and catch runaway spend before the invoice does.
- AuthClerk ↗Drop-in users and orgs to gate the exact endpoints that spend your money.
- BillingStripeUsage-based billing to charge per request, because you're reselling an API that already charges you per token.
- HostingVercelOne-command deploys of the Next.js app with the streaming serverless functions the AI SDK expects.
Tradeoffs
- Clerk and Supabase overlap on auth — running both means two vendors and two bills; collapse to Supabase Auth if you want fewer moving parts and can live without Clerk's slicker orgs/DX.
- The Vercel AI SDK keeps you provider-agnostic on paper, but prompt caching and richer tool use are still Claude-specific code — 'swap models in one line' is marketing, not your reality.
- pgvector is great to roughly a million vectors; past that, heavy filtered similarity search will push you to a dedicated store (Pinecone, Turbopuffer) and that migration isn't free.
- Your cost and latency are hostage to one model provider — an outage or price change hits margins directly. Langfuse will tell you fast, but it can't fix it for you.
Cost
$0 to prototype on free tiers. Budget ~$70-100/mo of infra once you outgrow them (Vercel Pro $20, Supabase Pro $25, Clerk ~$25, Langfuse Cloud ~$29). Your real bill is Claude tokens — it dwarfs infra and scales with usage, which is exactly why metered Stripe billing is in the stack and not optional.