Open-source API gateway for internal LLM rate limiting and caching
Brands AI mentions
Also mentioned rarely: Envoy Proxy, Kong Gateway, Tyk, Redis, Envoy Gateway, Kong · kongusa.com, Traefik, Envoy AI Gateway, Prometheus, Portkey AI, Zuplo, Nginx · nginx.com, vLLM, Ollama, OpenTelemetry, Grafana, Maxim AI, Redis Enterprise Cloud, Helicone, Nginx · nginx.org, Gravitee.io, Anthropic, OpenResty, Ambassador Labs, New API, Valkey, Ocelot, SlowAPI, Ory Oathkeeper, Grafana OSS, LLM Gateway, OpenAI, HashiCorp Vault, F5, PostgreSQL, SGLang, Hugging Face Text Generation Inference
- LiteLLMChatGPTChatGPT 62%Google AI ModeGoogle AI Mode 89%
- Apache APISIXChatGPTChatGPT 86%Google AI ModeGoogle AI Mode 57%
- Bifrost by Maxim AIChatGPTChatGPT 10%Google AI ModeGoogle AI Mode 57%
- Kong AI GatewayChatGPTChatGPT 0%Google AI ModeGoogle AI Mode 68%
- KongChatGPTChatGPT 52%Google AI ModeGoogle AI Mode 11%
Pages AI cites most for this topic
Third-party sites shaping AI recommendations here
- Best Open Source AI Gateway in 2026 - DEV Community (opens in a new tab)23%
dev.to · Names Weaviate, Helicone, Anthropic
Questions and answers
Google AI ModeNov 16, 2026
For an internal LLM API, you want a solution that understands tokens and semantic/exact caching rather than just HTTP request counts. The best open-source options depend on your stack and whether you want a
dedicated AI gatewayor a general-use API gateway with LLM plugins.Top Open-Source LLM & API Gateways
- LiteLLM (Proxy Server)
- Best for: Python-heavy stacks, rapid integration, and broad model/provider translation.
- Rate Limiting: Supports token-based rate limiting (e.g., TPM/RPM limits per user, team, or API key).
- Caching: Built-in support for Redis-backed caching (exact match and semantic caching).
- Pros: Exposes an OpenAI-format REST API for 100+ LLMs out of the box, easy to self-host, and great token-budget tracking.
- Learn more: Check out the project on LiteLLM.
- Bifrost (by Maxim AI)
- Best for: High-throughput, low-latency enterprise workloads needing extreme performance.
- Rate Limiting: Four-tier budget hierarchy and robust request/token governance.
- Caching: Dual-layer semantic caching designed to slash redundant LLM calls.
- Pros: Apache 2.0 license, sub-millisecond/microsecond-scale overhead at high RPS, and multi-provider support.
- Learn more: Read the breakdown on Maxim AI's AI Gateways Guide.
- Apache APISIX
- Best for: Infrastructure teams that already use APISIX and want native AI plugins.
- Rate Limiting: Fine-grained token-based and request-based rate limiting plugins.
- Caching: Response caching plugins capable of handling proxy payloads.
- Pros: Apache 2.0 open-source, cloud-native (built on NGINX/Lua), handles massive concurrency gracefully.
- Learn more: Explore via Apache APISIX.
- Kong (AI Gateway / AI Proxy Plugin)
- Best for: Organizations already running Kong API Gateway in production.
- Rate Limiting: Native
ai-rate-limitingor standard rate-limiting plugins adapted for LLM tokens. - Caching:
ai-proxy-advancedor proxy caching for LLM responses. - Pros: Unifies your internal LLM traffic with your existing enterprise API management plane (though note that some advanced AI features sit in the enterprise tier, the core gateway foundations are open-source).
- Learn more: Look at Kong AI Gateway.
Quick Comparison
Gateway Primary Language / Core Token-Level Rate Limiting LLM Caching Best Suited For LiteLLM Python Strong (RPM/TPM) Redis / Semantic Fast deployment, OpenAI-compatible proxy Bifrost Go / Rust-tier Multi-tier budgets Dual-layer semantic High RPS, heavy enterprise governance Apache APISIX Lua / NGINX Token-based plugins Response caching APISIX-centric infrastructure shops Kong Lua / C Plugin-based Proxy/AI caching Teams standardizing on Kong To help narrow down the ideal choice, tell me:
- Are you running self-hosted models (e.g., vLLM, Ollama) or hitting external APIs (OpenAI, Anthropic)?
- What is your primary language/stack on the client side?
ChatGPTNov 16, 2026
For an internal LLM API, my top recommendation is LiteLLM if your primary requirements are rate limiting, response caching, model routing, and usage tracking.
The important distinction is whether you need an LLM-native gateway or a general-purpose API gateway:
- LLM-native gateways understand models, tokens, providers, and LLM request formats.
- General-purpose gateways excel at HTTP routing, authentication, traffic management, and infrastructure-level rate limiting.
For most teams building an internal LLM platform, I'd start with an LLM-native gateway.
Shortlist: best open-source options
Gateway Best use case Rate limiting Caching LiteLLM LLM API management RPM, TPM, per-key/team Exact + semantic Bifrost High-performance LLM gateway Per-key, team, customer Exact + semantic Apache APISIX General API + LLM gateway Token-based Redis exact + semantic Kong Gateway Existing Kong infrastructure HTTP and AI-aware policies Proxy response caching New API Internal API-key distribution Per-key and group quotas Limited 1. LiteLLM — best for straightforward LLM infrastructure
(My default recommendation)
License: MIT for the core open-source project
Why it stands out:
- OpenAI-compatible API interface.
- Virtual API keys for applications, users, and teams.
- Requests-per-minute (RPM) and tokens-per-minute (TPM) limits.
- Spend budgets and usage tracking.
- Redis-backed rate-limit coordination across multiple instances.
- Exact and semantic caching.
- Model routing, retries, and fallbacks.
One important operational detail: PostgreSQL is required for persistent budgets, and Redis is useful for coordinated multi-instance rate limiting.
Documentation: LiteLLM documentation.
2. Bifrost — best alternative to benchmark
Bifrost is worth evaluating if performance and throughput are major concerns.
- Lightweight Go-based gateway.
- Multi-provider LLM routing.
- Rate limiting and per-consumer controls.
- Exact and semantic caching.
- Designed for high-throughput LLM workloads.
A November 2026 comparison ranks it first overall, although benchmark results should be independently reproduced against your workload.
Documentation: Bifrost on GitHub.
3. Apache APISIX — best for infrastructure-level control
APISIX is particularly compelling if you already operate API gateways.
Its AI plugins include:
ai-rate-limiting: token-based quotas.ai-cache: Redis-backed exact and semantic caching.ai-proxy: LLM provider proxying.ai-proxy-multi: multi-instance routing.
It is Apache 2.0 licensed.
Documentation: APISIX AI Gateway.
My recommendation
I'd make the decision based on your existing infrastructure:
Your situation My pick Building an internal LLM platform from scratch LiteLLM High-throughput production gateway Bifrost Already running Kubernetes/API gateway infrastructure APISIX Already using Kong Kong One important security caveat about LiteLLM: On October 21, 2026, its release pipeline was compromised. Version
1.107.0and certain Docker tags contained credential-stealing malware. The project has published remediation details and moved to keyless Cosign signing. If you choose LiteLLM, pin verified releases, verify image signatures, and review its security advisories before deployment.Suggested architecture
For your internal LLM API, I'd use this architecture:
Internal applications
Services · Agents · Developer tools
LLM API Gateway
Authentication · Rate limiting · Model routing · Caching
Redis
Rate-limit counters and response cache
PostgreSQL
API keys, teams and usage records
LLM backends
Self-hosted models · vLLM · Ollama · Cloud providers
Policies I'd implement
- RPM limits per API key and application.
- TPM limits per team and application.
- Maximum concurrent requests.
- Daily/monthly token budgets.
- Exact-response caching for identical requests.
- Semantic caching for suitable repetitive queries.
- Cache isolation by tenant, model, and relevant generation parameters.
- Cache bypass for sensitive requests, tool calls, and non-deterministic workflows.
One important distinction: rate limiting and caching solve different problems. Rate limiting protects your infrastructure; caching reduces inference cost and latency. Don't let cache hits bypass authorization or usage accounting.
A few questions that would help narrow this down
The best choice changes depending on your deployment.
1. Where are your models running?
- Self-hosted (vLLM, Ollama, TGI)
- Cloud APIs (OpenAI, Anthropic, Gemini)
- Both
2. What kind of rate limiting do you need?
- Requests per minute
- Tokens per minute
- Per-user / per-team quotas
- All of the above
3. What's your deployment environment?
- Kubernetes
- Docker Compose / VMs
- Bare metal
With those three details, I can recommend a concrete gateway and provide a production-oriented deployment architecture with Redis, caching policies, and rate-limit configuration.
Pages cited in this answer 10
- docs.litellm.aiBudgets, Rate Limits | liteLLM
- docs.litellm.aiLife of a Request | liteLLM
- docs.litellm.aiLiteLLM documentation | liteLLM
- geekflare.com8 Best Open Source LLM Gateways (AI Gateways) in 2026, Tested
- getmaxim.aiTop 5 Open-Source LLM Gateways Compared (2026)
- github.comGitHub - maximhq/bifrost: Open-source, high-performance AI gateway that works as your LLM gateway, MCP gateway and agent gateway. One OpenAI-compatible API for 10,000+ models, with failover, load balancing, semantic caching, virtual keys, budgets and MCP Code Mode. Works with any SDK or agent and adds under 200µs of overhead at 5k RPS. · GitHub
- apisix.apache.orgOpen-Source AI Gateway for LLMs and AI Agents | Apache APISIX
- apisix.apache.orgai-rate-limiting | Apache APISIX
- docs.litellm.aiContained: Oct 21, 2026 LiteLLM release v1.107.0 Compromised | liteLLM
- litellm.aiSecurity | LiteLLM
- LiteLLM (Proxy Server)
ChatGPTNov 26, 2026
For an internal LLM API, I'd shortlist Apache APISIX, LiteLLM, Kong Gateway, and Bifrost.
The important distinction is whether you need a traditional API gateway with LLM-aware features or an LLM-specific gateway that understands models, tokens, and prompts.
My initial recommendation is Apache APISIX if you want a genuinely open-source, self-hosted gateway with both rate limiting and response caching. If you want a dedicated LLM proxy with OpenAI-compatible APIs, look closely at LiteLLM and Bifrost.
Best options compared
Gateway Rate limiting LLM response caching Best use case Apache APISIX Token-based Exact + semantic Full-featured open-source gateway LiteLLM Key/user/team budgets and limits Response caching LLM provider abstraction Kong Gateway Request-based; advanced AI limits Proxy caching Existing API gateway infrastructure Bifrost LLM-aware limits Caching capabilities to evaluate High-performance LLM gateway 1. Apache APISIX — Best overall
(My top recommendation)
- License: Apache 2.0.
- Rate limiting: Dedicated
ai-rate-limitingplugin with token-based quotas. - Caching:
ai-cacheplugin with exact-match and optional semantic caching. - Storage: Redis for shared cache and counters; etcd for gateway configuration.
- LLM support: OpenAI-compatible endpoints and multiple model providers.
- Deployment: Docker, Kubernetes, or standalone.
Particularly interesting is that APISIX supports semantic caching: requests with similar meanings can reuse previously generated responses rather than invoke the model again. It also supports streaming response caching.
Downside: More infrastructure and configuration overhead than an LLM-specific proxy. You'll need to manage routes and plugins.
2. LiteLLM — Best LLM-specific gateway
- License: MIT core.
- Rate limiting: Requests per minute (RPM), tokens per minute (TPM), and limits for keys, users, teams, and the server.
- Caching: Local, Redis, Valkey, and semantic caching options.
- Storage: PostgreSQL and Redis commonly used.
- LLM support: OpenAI-compatible API across 100+ model providers.
- Deployment: Docker and Kubernetes.
LiteLLM is particularly attractive if you want to give internal applications virtual API keys and enforce individual quotas.
It also provides shared Redis-backed rate-limit counters and caching across multiple instances.
Downside: It's a Python-based application rather than a traditional high-performance edge gateway. I'd evaluate its operational complexity and upgrade/security practices before making it a critical infrastructure dependency.
3. Kong Gateway — Best established API gateway
- License: Open-source core, with important AI features requiring commercial licensing.
- Rate limiting: Standard HTTP rate-limiting plugins in the open-source gateway.
- Caching: Basic proxy caching in the open-source gateway.
- Storage: Database or declarative configuration; Redis support for certain advanced features.
- LLM support: AI proxy capabilities and model integrations.
Kong is attractive if you already operate Kong for your internal APIs.
Important licensing distinction: AI token-based rate limiting, advanced Redis caching, and semantic caching are not all available in the open-source edition. In particular, AI Rate Limiting Advanced requires an AI Gateway license.
4. Bifrost — Best lightweight, high-performance alternative
- License: Apache 2.0.
- Rate limiting: Virtual-key and governance-based limits.
- Caching: Exact-match and semantic caching.
- Storage: Supports multiple persistence and vector-storage backends.
- Performance: Go-based implementation.
- LLM support: Multiple providers behind an OpenAI-compatible API.
Bifrost is particularly interesting if performance and low operational overhead matter. Its open-source edition includes virtual keys, budgets, rate limits, caching, and observability.
Downside: Some enterprise capabilities, including clustering, SSO, and advanced governance, require commercial licensing.
Links: GitHub · Documentation ·
My recommendation
I'd narrow the decision to these three:
Apache APISIX (Best traditional gateway)
Choose this if your internal LLM API already exists and you primarily need a gateway in front of it.
LiteLLM (Best LLM abstraction)
Choose this if you need virtual keys, per-team quotas, token accounting, and multiple model providers.
Bifrost (Best performance candidate)
Choose this if you want a lightweight Go-based gateway with caching and LLM-aware governance.
Suggested architecture
For an internal LLM service, I'd consider this architecture:
Internal applications
Backend services · Agents · Internal tools
API Gateway (APISIX)
Authentication · Rate limiting · Routing · Logging
Redis
Response cache · Rate-limit counters
LLM backend
vLLM · Ollama · Internal model API
A few implementation considerations:
- Use Redis-backed distributed rate limits rather than per-instance counters.
- Support both requests-per-minute and tokens-per-minute limits.
- Include model, temperature, system prompt, tenant, and relevant authorization context in cache-key design.
- Be conservative with semantic caching. Similar prompts don't necessarily mean equivalent answers.
- Avoid sharing cached responses across tenants or users with different permissions.
- Make sure streaming responses and cache behavior are tested with your actual API protocol.
Three questions that would help me make the final recommendation
- What is your LLM backend? vLLM, Ollama, TGI, a custom OpenAI-compatible API, or something else?
- What kind of rate limiting do you need? Requests per minute, tokens per minute, per-user quotas, or all three?
- What is your deployment environment? Kubernetes, Docker Compose, or VMs?
With those answers, I can narrow this down to the best two choices and suggest an actual production-ready deployment architecture.
Pages cited in this answer 25
- apisix.apache.orgOpen-Source AI Gateway for LLMs and AI Agents | Apache APISIX
- apisix.apache.orgai-rate-limiting | Apache APISIX
- apisix.incubator.apache.orgai-cache | Apache APISIX
- apisix.apache.orgApache APISIX - Open Source API Gateway & AI Gateway
- github.comGitHub - apache/apisix: The Cloud-Native API Gateway and AI Gateway · GitHub
- apisix.apache.orgPlugin Hub: 100+ API Gateway & AI Plugins | Apache APISIX
- docs.litellm.aiLife of a Request | liteLLM
- docs.litellm.aiCaching | liteLLM
- docs.litellm.aiBudgets, Rate Limits | liteLLM
- redis.ioRedis with LiteLLM | Docs
- litellm.aiLiteLLM — Open-Source AI Gateway & LLM Proxy
- github.comGitHub - BerriAI/litellm: The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM] · GitHub
- docs.litellm.aiLiteLLM documentation | liteLLM
- konghq.comKong Gateway: API Connectivity Foundation for AI | Kong Inc.
- redis.ioRedis with Kong Gateway | Docs
- developer.konghq.comAI Rate Limiting Advanced - Plugin | Kong Docs
- developer.konghq.comKong AI Gateway Policies | Kong Docs
- konghq.comKong, The AI Connectivity Company | Kong Inc.
- github.comGitHub - Kong/kong: 🦍 The API and AI Gateway · GitHub
- developer.konghq.comKong Docs
- github.comGitHub - maximhq/bifrost: Open-source, high-performance AI gateway that works as your LLM gateway, MCP gateway and agent gateway. One OpenAI-compatible API for 10,000+ models, with failover, load balancing, semantic caching, virtual keys, budgets and MCP Code Mode. Works with any SDK or agent and adds under 200µs of overhead at 5k RPS. · GitHub
- getmaxim.aiEnterprise LLM Gateway for Every AI Request | Bifrost
- geekflare.comBifrost Review: Self-Hosting, Licence and Alternatives
- docs.getbifrost.aiBifrost AI Gateway - Bifrost
- getmaxim.aiBifrost (by Maxim AI) | Enterprise AI Gateway Built for Scale
Google AI ModeNov 26, 2026
For an internal LLM API, modern open-source AI gateways handle unified model routing, virtual keys, spend budgeting, rate limiting, and caching (both exact-match and semantic).
The top open-source choices depend on your preferred language, infrastructure stack, and latency requirements:
1. Bifrost (by Maxim AI)
- Language & License: Go (Apache 2.0)
- Best For: Ultra-low latency, high-throughput enterprise deployments.
- Core Strengths:
- Extreme Performance: Written in Go with ~11 microseconds of overhead at 5,000 RPS (significantly faster than Python-based proxies).
- Provider Reach: Routes across 10,000+ models from 25+ providers.
- Controls & Caching: Supports 4-tier budget hierarchies, virtual keys, and semantic caching (e.g., via Weaviate/vector stores).
- Deployment: Air-gapped and zero-touch in-VPC friendly.
- Learn more: Check out the project or docs on Maxim AI.
2. LiteLLM
- Language & License: Python (MIT)
- Best For: Rapid prototyping, maximum provider/model compatibility (140+ providers, ~1,892 models).
- Core Strengths:
- Drop-in OpenAI Format: Exposes a single OpenAI-compatible API endpoint for practically every LLM on the market.
- Rich Feature Set: Built-in rate limiting, spend tracking/hard budgets, caching, prompt compression, and virtual keys.
- Ecosystem: Huge community adoption (60k+ GitHub stars, massive usage), with Helm charts and Terraform modules.
- Trade-offs: Python/GIL-based architecture introduces higher per-request overhead (~8ms+) compared to compiled Go or Rust proxies at extreme scale.
- Learn more: Explore the official repository and docs at LiteLLM.
3. Kong AI Gateway
- Language & License: Go / Lua (Open-core / Enterprise mix)
- Best For: Organizations already standardized on Kong for traditional API management.
- Core Strengths:
- Infrastructure Synergy: Drops right into existing Kong ingress/gateway topologies with familiar plugin architectures.
- Reliability: Battle-tested at global enterprise scale for standard HTTP/REST rate limiting and auth.
- Trade-offs: Advanced AI features (like complex semantic caching and deep analytics) push you toward Kong Enterprise rather than the free open-source core.
- Learn more: Review the community breakdown on DEV Community.
4. Apache APISIX (with AI Plugins)
- Language & License: Lua / Nginx (Apache 2.0)
- Best For: Kubernetes and edge-heavy teams wanting low-level Nginx-grade stability.
- Core Strengths:
- Low Overhead: Nginx/Lua runtime provides ~1–2ms of baseline proxy overhead.
- Flexible Plugins: Custom AI prompt-handling and rate-limiting plugins that integrate with APISIX’s dynamic configuration.
- Trade-offs: Less out-of-the-box "LLM-native" ergonomics (like automatic token budgeting or native semantic caching) compared to LiteLLM or Bifrost.
Quick Comparison Matrix
Gateway Primary Language Overhead (P99/Avg) Model / Provider Breadth Best Advantage Bifrost Go ~11 µs 25+ providers / 10k+ models Lowest latency & high-throughput Go architecture LiteLLM Python ~8 ms 140+ providers / 1,892+ models Widest model ecosystem & rapid setup Kong AI Go/Lua ~2–5 ms 10+ providers Drops into existing Kong API management Apache APISIX Lua/Nginx ~1–2 ms Extensible via plugins Nginx-level speed & custom plugin control If you share:
- Your expected request volume (RPS)
- Whether you prefer Go/Python in your stack
- Whether you need exact-match vs. semantic caching
I can help narrow down the ideal choice or sketch out a quick deployment configuration.
Last 180 daysData through Nov 26, 2026Based on 57 AI answers
For agents: this page as Markdown, https://parse.gl/topics/open-source-api-gateway-for-internal-llm-rate-limiting-and-caching.md. JSON, MCP · free for the last 90 days, checks from $0.01
This page
Read and search
Connect
npx -y parse-gl check <domain>Copy the CLI commandAn agent can save work before signup: POST https://agent.parse.gl/v1/workspaces
What it costs
Prices: https://parse.gl/pricing.md
Map of the site: https://parse.gl/llms.txt