LMRouter/lmrouter
关于
An open-source, all-in-one AI API router
人工智能与机器学习实测星标增长
- 24小时
- 0
- 7天
- +1
- 15天
- +1
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文LMRouter
LMRouter is an open-source, all-in-one API router that gives AI developers a single, unified way to connect to the best model providers.
With LMRouter, you don’t need to create accounts on multiple platforms or juggle different API keys. A single API key unlocks access to any provider, any model, any service, all through one interface.
It’s an open-source alternative to OpenRouter, but goes far beyond language models. LMRouter supports multiple modalities and services out of the box:
- Language: Chat Completions, Responses API, Anthropic Messages
- Image: Image generation and editing
- Audio: Speech-to-text and audio models
- Video: Video generation (coming soon)
- Embeddings: Semantic search and RAG
- Search: Jina, Exa, and other web search APIs (coming soon)
- Code: Execution with interpreters such as e2b (coming soon)
Quick Start
LMRouter service is available at lmrouter.com. Please refer to the documentation for more information.
Local Development/Deployment
To setup LMRouter locally, make sure you have Node.js and pnpm installed, then follow these steps:
git clone https://github.com/LMRouter/lmrouter
cd lmrouter
pnpm i
cp config/config.example.yaml config/config.yaml
Edit config/config.yaml to set up your own provider and model configurations.
# Run the server in development mode
pnpm dev
# Run the server in production mode
pnpm build
pnpm start
Alternatively, you can use pnpx to run the server:
pnpx @lmrouter/cli /path/to/config.yaml
Features
API Compatibility
LMRouter provides drop-in compatibility with existing APIs, so applications that already work with OpenAI or Anthropic can integrate without changes:
OpenAI API
/openai/v1/chat/completions — Chat Completions
/openai/v1/images/generations — Image generation
/openai/v1/images/edits — Image editing
/openai/v1/embeddings — Embeddings
/openai/v1/responses — Responses
/openai/v1/audio/speech — Audio speech
/openai/v1/audio/transcriptions — Audio transcriptions
/openai/v1/audio/translations — Audio translations
/openai/v1/models — List available models
Anthropic API
/anthropic/v1/messages — Messages
/anthropic/v1/models — List available models
Multi-Provider Support
LMRouter connects to the broader AI ecosystem, with built-in support for:
- OpenAI-compatible — OpenAI, Google, Perplexity, Fireworks, Groq, Cerebras, etc.
- Anthropic-compatible — Anthropic, Amazon Bedrock, etc.
- Fireworks — FLUX.1 [schnell] FP8, FLUX.1 Kontext Pro, FLUX.1 Kontext Max
- Google — Imagen, Gemini image generation, etc.
Multi-Runtime Deployment
LMRouter is built on Hono and runs in multiple environments:
- Node.js — Standard server deployment
- Cloudflare Workers — Lightweight edge deployment at scale
Contributing
We believe LMRouter should be built by the community, for the community. Every contribution, whether it’s fixing a bug, adding a feature, improving documentation, or sharing feedback, helps make LMRouter stronger.
Roadmap
Checkout our Kanban for the latest roadmap.
How to Get Started
- Fork the repository
- Create a feature branch (
git checkout -b feature/my-feature) - Build your changes, code, docs, or tests
- Verify everything works as expected
- Submit a pull request and join the conversation
No contribution is too small, even a typo fix helps. And if you have big ideas, we’d love to hear them.
Tip: If you’re not sure where to start, check out the open issues labeled
good first issue.
License
LMRouter is licensed under the MIT License. See the LICENSE file for details.
探索相关项目
加载中…