Topic

Open-source API gateway for internal LLM rate limiting and caching

Updated Nov 26, 2026ChatGPT and Google AI Mode
Mention rate, on ChatGPT and Google AI Mode
  • LiteLLMChatGPTGoogle AI Mode
  • Apache APISIXChatGPTGoogle AI Mode
  • Bifrost by Maxim AIChatGPTGoogle AI Mode
  • Kong AI GatewayChatGPTGoogle AI Mode
  • KongChatGPTGoogle AI Mode

Pages AI cites most for this topic

Third-party sites shaping AI recommendations here

  1. 23%

What decides this topic

What AI weighs in head-to-head comparisons

Questions and answers

  • Google AI ModeNov 16, 2026

    1. 1LiteLLM
    2. 2Maxim AI
    3. 3Apache APISIX
    4. 4Kong

    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 gateway or a general-use API gateway with LLM plugins.

    Top Open-Source LLM & API Gateways

    1. 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.
    2. 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.
    3. 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.
    4. Kong (AI Gateway / AI Proxy Plugin)
      • Best for: Organizations already running Kong API Gateway in production.
      • Rate Limiting: Native ai-rate-limiting or standard rate-limiting plugins adapted for LLM tokens.
      • Caching: ai-proxy-advanced or 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

    GatewayPrimary Language / CoreToken-Level Rate LimitingLLM CachingBest Suited For
    LiteLLMPythonStrong (RPM/TPM)Redis / SemanticFast deployment, OpenAI-compatible proxy
    BifrostGo / Rust-tierMulti-tier budgetsDual-layer semanticHigh RPS, heavy enterprise governance
    Apache APISIXLua / NGINXToken-based pluginsResponse cachingAPISIX-centric infrastructure shops
    KongLua / CPlugin-basedProxy/AI cachingTeams 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

    1. 1LiteLLM
    2. 2Apache APISIX
    3. 3Kong Gateway
    4. 4New API
    5. 5Bifrost by Maxim AI

    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

    GatewayBest use caseRate limitingCaching
    LiteLLMLLM API managementRPM, TPM, per-key/teamExact + semantic
    BifrostHigh-performance LLM gatewayPer-key, team, customerExact + semantic
    Apache APISIXGeneral API + LLM gatewayToken-basedRedis exact + semantic
    Kong GatewayExisting Kong infrastructureHTTP and AI-aware policiesProxy response caching
    New APIInternal API-key distributionPer-key and group quotasLimited

    1. LiteLLM — best for straightforward LLM infrastructure

    (My default recommendation)

    License: MIT for the core open-source project

    • UI - Router Settings for Keys and Teams | liteLLM

    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

    • A Practical Guide to Running Claude for a Team Without Hitting Quotas - DEV Community

    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

    • Apache APISIX - 开源云原生 API 网关与 AI 网关

    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 situationMy pick
    Building an internal LLM platform from scratchLiteLLM
    High-throughput production gatewayBifrost
    Already running Kubernetes/API gateway infrastructureAPISIX
    Already using KongKong

    One important security caveat about LiteLLM: On October 21, 2026, its release pipeline was compromised. Version 1.107.0 and 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

    1. RPM limits per API key and application.
    2. TPM limits per team and application.
    3. Maximum concurrent requests.
    4. Daily/monthly token budgets.
    5. Exact-response caching for identical requests.
    6. Semantic caching for suitable repetitive queries.
    7. Cache isolation by tenant, model, and relevant generation parameters.
    8. 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.

  • ChatGPTNov 26, 2026

    1. 1Apache APISIX
    2. 2LiteLLM
    3. 3Kong Gateway
    4. 4Bifrost by Maxim AI

    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

    GatewayRate limitingLLM response cachingBest use case
    Apache APISIXToken-basedExact + semanticFull-featured open-source gateway
    LiteLLMKey/user/team budgets and limitsResponse cachingLLM provider abstraction
    Kong GatewayRequest-based; advanced AI limitsProxy cachingExisting API gateway infrastructure
    BifrostLLM-aware limitsCaching capabilities to evaluateHigh-performance LLM gateway

    1. Apache APISIX — Best overall

    (My top recommendation)

    • APISIX: An Open Source API Gateway for Microservices - The New Stack
    • License: Apache 2.0.
    • Rate limiting: Dedicated ai-rate-limiting plugin with token-based quotas.
    • Caching: ai-cache plugin 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.

    Links: Website · GitHub ·

    2. LiteLLM — Best LLM-specific gateway

    • Access Groups | liteLLM
    • 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.

    Links: Website · GitHub ·

    3. Kong Gateway — Best established API gateway

    • Kong Manager | Kong Docs
    • 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.

    Links: Website · GitHub ·

    4. Bifrost — Best lightweight, high-performance alternative

    • Overview - Bifrost
    • 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:

    1. Use Redis-backed distributed rate limits rather than per-instance counters.
    2. Support both requests-per-minute and tokens-per-minute limits.
    3. Include model, temperature, system prompt, tenant, and relevant authorization context in cache-key design.
    4. Be conservative with semantic caching. Similar prompts don't necessarily mean equivalent answers.
    5. Avoid sharing cached responses across tenants or users with different permissions.
    6. Make sure streaming responses and cache behavior are tested with your actual API protocol.

    Three questions that would help me make the final recommendation

    1. What is your LLM backend? vLLM, Ollama, TGI, a custom OpenAI-compatible API, or something else?
    2. What kind of rate limiting do you need? Requests per minute, tokens per minute, per-user quotas, or all three?
    3. 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

    Google AI ModeNov 26, 2026

    1. 1Maxim AI
    2. 2LiteLLM
    3. 3Apache APISIX
    4. 4Bifrost by Maxim AI
    5. 5Kong Gateway

    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

    GatewayPrimary LanguageOverhead (P99/Avg)Model / Provider BreadthBest Advantage
    BifrostGo~11 µs25+ providers / 10k+ modelsLowest latency & high-throughput Go architecture
    LiteLLMPython~8 ms140+ providers / 1,892+ modelsWidest model ecosystem & rapid setup
    Kong AIGo/Lua~2–5 ms10+ providersDrops into existing Kong API management
    Apache APISIXLua/Nginx~1–2 msExtensible via pluginsNginx-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

How we measure
For agents: this page as Markdown, 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

Reuse: Figures and tables on this page are free to republish with attribution: a link to https://parse.gl/topics/open-source-api-gateway-for-internal-llm-rate-limiting-and-caching beside them. A standard followed link (dofollow) is preferred.

Read and search

Every brand's share on this topic, with 95% ranges: GET agent.parse.gl/v1/tools/query_metrics?args=%7B%22measures%22%3A%5B%22share_named%22%5D%2C%22by%22%3A%5B%22brand%22%5D%2C%22filter%22%3A%7B%22topic%22%3A%5B%22top_dc90bb9f-a2a7-452c-afcb-e5ebca335947%22%5D%7D%7D
Search the index: GET parse.gl/api/public/search?q=<words>

Connect

Connect an assistant: agent.parse.gl/mcp
CLI check: npx -y parse-gl check <domain>

An agent can save work before signup: POST https://agent.parse.gl/v1/workspaces

What it costs

No account: Public figures and up to 5 examples per list, about 120 brands a day per address.
Free account: $2 verified-email starter credits, 90-day Parse Index reads, your brand's first check (20 buyer questions), and a free weekly check.
Prepaid credits (from $20): Exports, deeper search results, live checks, verified contacts, and daily tracking ($12 a month).
Live checks: $0.01 per standard check/live page/judgment; $0.05 per frontier check (Gemini, Claude) or verified contact.
Full public answers and pages: 25 free per day, then $0.01 each.
Public answers older than 90 days: $0.01 each the first time your workspace counts or lists one, then yours.