An LLM router for autonomous agents that picks the cheapest capable model per request locally, paid via a crypto wallet in USDC or a credit-card API key.
mnfst/llm-gateway
Open-source LLM gateway that routes requests from AI agents and apps to many model providers through one OpenAI-compatible endpoint.
Open-source alternative to:OpenRouter
- Stars
- 7,595
- Forks
- 522
- Open issues
- 54
- Last commit
- yesterday
What is it?
Manifest LLM Gateway sits between your AI agents or apps and the model providers they call. You connect API keys, subscriptions, local models, or custom OpenAI/Anthropic-compatible endpoints, and every request goes through one OpenAI-compatible endpoint. Sending "model": "auto" lets Manifest choose the model for each query, which avoids locking an application to a single provider.
The gateway logs full request and error bodies, tracks spending per request, and supports cost notifications and limits. When a query fails, it can fall back to another model. Providers are listed as 35 built-in connections covering hosted APIs such as OpenAI, Anthropic, Google, and DeepSeek, along with local runtimes like Ollama, LM Studio, and llama.cpp.
It ships as a Docker image and can be deployed to Railway, Render, AWS, GCP, DigitalOcean, Fly.io and other platforms. Request recordings are stored in PostgreSQL and S3-compatible or persistent disk storage depending on the platform.
Key features
- 01Single OpenAI-compatible endpoint for API keys, subscriptions, local models, and custom providers
- 02Automatic model selection with "model": "auto"
- 03Full request and error body logging
- 04Per-request cost tracking with spending notifications and limits
- 05Fallback to other models when a request fails
Use cases
- Routing an AI agent across several providers without changing application code
- Tracking and capping LLM spending across a team or project
- Running a self-hosted gateway that mixes cloud APIs with local Ollama or llama.cpp models
- Debugging agent requests by inspecting logged request and error bodies
Topics
FAQ
- What is llm-gateway?
- Open-source LLM gateway that routes requests from AI agents and apps to many model providers through one OpenAI-compatible endpoint. Manifest LLM Gateway sits between your AI agents or apps and the model providers they call. You connect API keys, subscriptions, local models, or custom OpenAI/Anthropic-compatible endpoints, and every request goes through one OpenAI-compatible endpoint. Sending "model": "auto" lets Manifest choose the model for each query, which avoids locking an application to a single provider.
- Is llm-gateway free to use? What license does it have?
- llm-gateway is open source under the MIT license. Check the license terms before using it in commercial products.
- Is llm-gateway still maintained?
- Actively maintained. The last commit to llm-gateway was on Oct 21, 2026.
- What can I use llm-gateway for?
- Routing an AI agent across several providers without changing application code Tracking and capping LLM spending across a team or project Running a self-hosted gateway that mixes cloud APIs with local Ollama or llama.cpp models Debugging agent requests by inspecting logged request and error bodies
- Where can I get llm-gateway?
- The source code and installation instructions are on GitHub: https://github.com/mnfst/llm-gateway
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Self-hosted, source-available LLM router that sends simple prompts to cheap or local models and complex ones to premium models, behind an OpenAI-compatible proxy.
Self-hosted, OpenAI-compatible LLM gateway that routes one endpoint to 40+ providers with virtual keys, budgets, and usage tracking.
A self-hosted personal AI agent where each agent runs in its own Linux desktop container on your computer, with any model, an encrypted vault and Telegram control.
Open source AI Gateway and Python SDK that calls 100+ LLM providers through a single OpenAI-format interface.
A self-hosted AI gateway that exposes OpenAI, Claude and Gemini compatible APIs in front of many upstream model providers, with routing, keys, quotas and cost tracking.