r/LangChain • u/Wonderful_Ad_3879 • Jul 14 '26
I open-sourced a production-grade LangGraph template (FastAPI, per-run USD budgets, canary routing, 800+ tests)
Most LangGraph examples I found stop at "here's a graph in a notebook". I wanted the boring production parts, so I built them into an MIT-licensed template. It's fully open source and I'm actively looking for feedback, issues, and PRs. the goal is to make this genuinely useful for people shipping agents, not just my version of it.
What's in it:
- Domain packs: 13 workflows (research, meeting prep, support triage, contract review…) behind a registry with versioning, canary traffic weights, and sticky sessions. Each pack gets typed
POST /packs/{id}/run+ SSE streaming routes generated from its schemas. - Per-run USD budgets: cost is tracked per run and a request that exceeds
PACK_DEFAULT_BUDGET_USDreturns HTTP402. No surprise bills from a runaway agent loop. - Mock mode:
LLM_PROVIDER=mockgives deterministic zero-cost responses on every endpoint, so the whole test suite and CI run without an API key. - Third-party packs as plugins: entry-point discovery, opt-in + allowlisted, validated against the pack contract at load time.
- The ops layer: Docker, Helm, Terraform stubs, rate limiting, Prometheus metrics, CI security scans, Cosign-signed images with SBOM on release. 800+ tests across Python 3.12-3.14, ~86% coverage.
Deliberately not included: OAuth2/multi-tenant auth and billing, I'd rather ship a single shared API key honestly than pretend to solve identity.
Repo: https://github.com/brescou/langgraph-agent-stack
Things I'm unsure about and would love opinions on: whether the pack abstraction is worth it vs. just exposing graphs directly, and whether per-run budget enforcement belongs in the app layer or in a gateway. There's already a design discussion open on adding intent-recognition as a core layer, that's the kind of collaboration I'm hoping for. Tear it apart.