Pure Rust performance (~20–40 MB RAM)
Agentgateway handles streaming LLM tokens, gRPC and MCP tool calls with sub-millisecond overhead. Completely isolated gateway instances per startup fit on a single modest VPS or Kubernetes node.
Engineering deep-dive
As AI adoption accelerates across India's startup ecosystem, engineering teams face a common set of infrastructure bottlenecks: routing traffic across multiple LLM providers, enforcing strict INR budgets per team, governing Model Context Protocol (MCP) tools for AI agents, and redacting sensitive Indian PII (Aadhaar, PAN, UPI IDs) before data leaves the network — all without steep enterprise licensing fees or Python proxies that burn gigabytes of RAM.
By combining Agentgateway (an Apache 2.0-licensed, pure-Rust AI gateway) with Docker Compose and a custom INR pricing catalog, you can deploy a lightweight, single-tenant AI control plane that startups self-host effortlessly.
Why this architecture
Traditional Python-based LLM proxies often consume gigabytes of memory under streaming loads and lock multi-tenant budgeting, SSO and RBAC behind commercial licenses. For teams advising or hosting infrastructure for multiple early-stage startups, a different foundation works better:
Agentgateway handles streaming LLM tokens, gRPC and MCP tool calls with sub-millisecond overhead. Completely isolated gateway instances per startup fit on a single modest VPS or Kubernetes node.
Hosted under the Linux Foundation's Agentic AI Foundation, every governance feature — virtual keys, spend limits, MCP federation, PII guardrails — is open source, with zero seat-based royalties or proprietary license walls.
Paired with Indian inference suppliers — Sarvam AI, Krutrim, Neysa, or INR-billed AWS/Azure India endpoints — a custom INR model catalog meters every token directly in Rupees, without foreign-exchange drift.
Solution architecture
One container stack per startup: clients and agents hit a TLS-terminated gateway that meters, masks and routes before anything reaches an upstream provider.
Parallel surface: covers AI web apps that never route through the gateway — consumer ChatGPT, Claude, Gemini & similar.
catalog-inr.json
/data/*.dbDriven by config.yaml · Admin UI bound to 127.0.0.1:15000
Core pillars
Rather than cramming multiple startups into a shared multi-tenant proxy — with noisy-neighbour risks and cross-tenant data exposure — each startup gets its own lightweight container stack. A single Agentgateway instance idles at roughly 20 MB of RAM, so isolating each startup into its own directory with its own config.yaml and SQLite database keeps operations simple, secure and auditable.
Agentgateway calculates spend by multiplying prompt and completion tokens against a JSON model catalog. Because upstream suppliers bill in INR, we supply a custom catalog-inr.json with exact per-token rupee rates — optionally multiplied by 1.18 so hard budget cutoffs automatically account for 18% GST:
{
"models": {
"sarvam-m": {
"input_cost_per_token": 0.0000177,
"output_cost_per_token": 0.0000708
},
"krutrim-2": {
"input_cost_per_token": 0.0000236,
"output_cost_per_token": 0.0000944
}
}
}
catalog-inr.json makes an amount: 25000 limit act as a strict ₹25,000 cutoff.Before any prompt reaches an external inference API, Agentgateway passes the payload through a deterministic regex guardrail pipeline. Alongside standard patterns (emails, credit cards), we enforce custom patterns tailored to Indian compliance workflows such as the DPDP Act:
| Pattern | Regex |
|---|---|
| Aadhaar numbers | \b[2-9]{1}[0-9]{3}\s?[0-9]{4}\s?[0-9]{4}\b |
| PAN cards | \b[A-Z]{5}[0-9]{4}[A-Z]{1}\b |
| UPI IDs | \b[a-zA-Z0-9.\-_]{2,256}@[a-zA-Z]{2,64}\b |
| Indian mobile numbers | \b(?:\+91[\-\s]?)?[6-9]\d{9}\b |
Sensitive tokens are masked inline (e.g. [REDACTED_PAN]) prior to upstream dispatch, so raw customer identifiers never leave the startup's boundary. For contextual NLP redaction — person names, street addresses — a self-hosted Microsoft Presidio container can be attached via Agentgateway's external guardrail webhook.
Modern AI agents don't just call chat endpoints — they invoke tools over the Model Context Protocol (MCP). Instead of giving every agent direct credentials to internal databases, Slack or GitHub, Agentgateway federates multiple upstream MCP servers behind a single authenticated endpoint. Admins restrict which virtual keys may discover or execute specific MCP tools, giving engineering teams centralized visibility and kill-switch control over autonomous agents.
Deployment
Each startup deployment is packaged into four clean files. The Admin UI (port 15000) is bound strictly to 127.0.0.1, and only the inference/MCP gateway (port 4000) is exposed behind a TLS reverse proxy — a production-hardened AI gateway in under five minutes.
gateway/
├── docker-compose.yml # gateway + admin UI containers
├── config.yaml # listeners, virtual keys, guardrails, MCP routes
├── catalog-inr.json # per-token rupee pricing for budget cutoffs
└── Caddyfile # TLS termination in front of :4000
The only port exposed. Terminated by Caddy or Nginx with TLS, reachable by the startup's apps and agents.
Gateway configuration, virtual keys, INR budgets and spend dashboards. Bound strictly to 127.0.0.1 — administration never touches the public interface.
Key takeaways
Startups own their configs, SQLite spend history and routing logic — all under Apache 2.0. No export clauses, no data hostages.
Hard rolling 30-day INR limits prevent runaway agent loops from exhausting a startup's monthly cloud credits.
Switching between Indian inference providers or local vLLM deployments means changing a single backend target in config.yaml — with zero code changes in client applications.
We deploy, tune and operate this architecture for pilot customers — live in one week, with your keys, your budgets and your data.