All posts

28 Oct 2026 · Hardening & Ops

Serverless vs a VPS for AI SaaS, Real Cost at 25,000 MAU

Why Vercel duration caps and streaming egress hurt an AI product at 25k MAU, and what a Hetzner Docker box costs for the same workload.

The architecture and cost post is the overview: serverless vs a 5 euro VPS, and when a starter kit beats wiring it yourself. This post is the same question at a specific size. 25,000 monthly active users, streaming chat, some of them hitting a multi-step agent.

AgenticPacks OSS is the app you can run on either host: Agentic-Packs/agenticpacks-oss. The VPS path with Caddy and Terraform is Pro.

The problem

Vercel is a good place to start a Next.js UI. An AI SaaS stops fitting when:

  • A LangGraph run needs more than the function max duration (60s on many plans, 300s if you pay).
  • Token streams count as outbound data, every chunk, every user.
  • Cold starts make the first message after idle feel broken.
  • Prisma wants a connection pool. Short-lived isolates fight that.

You still pay OpenAI or Anthropic either way. The question is the glue: function time, egress, hosted Postgres, and concurrency.

A back-of-envelope at 25k MAU

Assumptions, not a quote. 25,000 MAU. 20% use chat in a given month. Those users average 30 streamed completions. Average 2,000 completion tokens visible in the UI. Some share of requests also run a 60 to 180 second graph.

LineServerless (Vercel Pro + hosted Postgres)Self-hosted (Hetzner CX23 or CX33 + Compose)
App computeFunction GB-seconds on every token and every graphFlat VPS, about 5 to 15 USD
Stream egressBilled outbound, easy to reach hundreds of USDIncluded in the VPS uplink until you are huge
DatabaseNeon or Supabase Pro, tens to low hundredsPostgres on the same node or a second CX
TimeoutsGraphs die or you pay for 300s durationProcess can sit on SSE for minutes
Total glue (order of magnitude)often 300 to 900+ USD / monthoften 20 to 80 USD / month

Model tokens are extra on both sides. Do not compare a VPS to a model invoice. Compare glue to glue.

If your graph regularly needs 3 minutes, serverless is not a pricing debate. It is a hard cap. See SSE drops behind proxies and LangGraph streaming.

What "leave Vercel" actually means

You do not have to move DNS on day one.

  1. Run the same Next.js app with output: "standalone" in Docker. Guide: Docker Compose and Caddy.
  2. Put Postgres on the Compose network. Stop using a serverless driver that assumes a short isolate.
  3. Point a hostname at the VPS. Caddy takes TLS. AgenticPacks OSS has no Caddy. Pro does.
  4. Keep the Vercel project as a preview if you want. Production traffic goes to the VPS.

Auth.js AUTH_URL must change to the new origin. Stripe webhook URL too. Both are runtime secrets. See Docker env vars and Stripe webhooks.

When to stay on serverless

  • The product is a UI with short completions, not a graph.
  • You have no one who can SSH.
  • 25k MAU is a slide, not traffic.

If you are already hitting duration errors, staying is more expensive than a CX23 and a weekend.

Tired of a 60 second wall in the middle of an agent run?

The MIT app runs on Vercel or Docker: Agentic-Packs/agenticpacks-oss.

The Hetzner Terraform and Caddy path is the VPS deploy path in Pro.

25k is not 250k

At 25k MAU one well-sized node plus backups is the usual answer. At much larger scale you split Postgres, add a second app replica, and put a load balancer in front. That is still cheaper than unbounded function time on streaming. It is not a reason to start on Kubernetes this week.


Where to Go From Here

You do not have to wait for the Vercel invoice to prove the architecture.

Option A: Free open-source baseline (MIT)

  • GitHub: github.com/Agentic-Packs/agenticpacks-oss
  • What is included: standalone Docker, Compose, Postgres, Auth.js, streaming chat, single-plan Stripe. No Caddy. Deploy on Vercel or a VPS you set up.
  • Cost: free, MIT.

Option B: Ship with AgenticPacks Pro ($149 one-time)

If production should be the VPS path:

  • Automated Hetzner provisioning: Terraform, firewall, Caddy SSL, Compose.
  • Production multi-agent core: LangGraph, pgvector, Redis, long-lived Node.
  • Usage & Unit Economics: Stripe, team pools, token ledger.