v2.0 — Intent × Difficulty Routing

One endpoint.
Every LLM you need.
Zero lock-in.

Smart routing across 7 providers and 27 models — DeepSeek, GLM, Qwen, Doubao, MiniMax, Kimi, and Claude. Pick the right model for every task, automatically.

Get Started → View on GitHub
7
Providers
27
Models
8×3
Routing Matrix
0
External Dependencies
How routing works
Request
model: "auto"
messages + tools
Classify
intent → code
difficulty → medium
Route
matrix[code][medium]
qwen-coder

Built for the multi-model reality.

No single model is best at everything. Route to the right one, every time.

🧭

Intent × Difficulty Routing

8 intents × 3 difficulty levels → 24-cell matrix picks the best model automatically. Override any cell via API, no restarts.

🔑

Key Pool + AES-256-GCM

Multiple keys per provider, encrypted at rest. Free-tier-first selection. Automatic cooldown on 429 with transparent fallback.

📡

Streaming Passthrough

SSE streams flow through untouched — zero buffering, zero content-type mangling. Works with Cursor, Continue, LangChain.

🤖

Anthropic / Claude Support

Claude Sonnet 4, Opus 4, Haiku 3.5 — full protocol adaptation from Messages API to OpenAI-compatible format, transparent to clients.

📊

Real-time Dashboard

Live request monitoring, provider stats, intent×difficulty heatmap, timeline charts — all in a single-file HTML panel.

🪶

Zero Bloat

Express + better-sqlite3 + dotenv. That's it. No Redis, no Docker, no Kubernetes. npm install && npm start

The 8 × 3 Matrix

Every request is classified by intent and difficulty, then routed to the best-fit model.

Intent 🟢 Easy 🟡 Medium 🔴 Hard
💬 chat glm-4-flash deepseek-v3 qwen-max
💻 code glm-4-flash qwen-coder deepseek-coder
🧠 reasoning deepseek-v3 deepseek-r1 minimax-m1
✨ creative doubao-lite minimax-creative glm-z1
🔍 search glm-4-flash kimi qwen-max
👁️ vision glm-4v qwen-vl kimi-vl
🌐 translation qwen-turbo deepseek-v3 glm-4
📝 summarization glm-4-flash qwen-long glm-4-long

Seven providers. One key pool.

Domestic-first, global-ready. All behind a single OpenAI-compatible endpoint.

DeepSeek
3 models
Best-in-class reasoning (R1) and coding. Most popular free tier in the Chinese AI ecosystem.
deepseek-v3 deepseek-r1 deepseek-coder
智谱 GLM
5 models
GLM-4-Flash at 100 RPM free. GLM-4-Long with 1M context. The Swiss army knife of Chinese LLMs.
glm-4 glm-4-flash glm-4-long glm-z1 glm-4v
通义 Qwen
6 models
Qwen-Long at 10M context. Best multi-variant lineup. Alibaba's flagship open-weight series.
qwen-max qwen-plus qwen-turbo qwen-coder qwen-vl qwen-long
豆包 Doubao
3 models
ByteDance's Volcengine Ark. Uses endpoint_id mapping — transparently handled by the gateway.
doubao-pro doubao-lite doubao-pro-128k
MiniMax
3 models
M1 at 1M context for deep reasoning. abab6.5s for creative writing. The creative dark horse.
minimax-m1 minimax-text minimax-creative
Kimi / Moonshot
4 models
Best search-augmented chat. VL for multimodal. Moonshot's flagship product, loved by Chinese developers.
kimi kimi-8k kimi-32k kimi-vl
Anthropic Claude
3 models
Claude Sonnet 4, Opus 4, Haiku 3.5 — full protocol adaptation, transparent to OpenAI-compatible clients.
claude-sonnet-4 claude-opus-4 claude-haiku-3.5

See everything in real time.

Monitor requests, track provider performance, visualize routing decisions — all from a single page.

1,247
Total Requests
89ms
Avg Latency
0.3%
Error Rate
2.1M
Tokens Used
📈 Timeline charts (requests + latency)
🔄 Auto-refresh every 3 seconds
🌐 Provider distribution cards
🎯 Intent × Difficulty heatmap
🔐 Bearer token authentication
📱 Responsive, zero dependencies

Up and running in 30 seconds.

Terminal
# Clone & build git clone https://github.com/xiaopengs/llm-keypool.git cd llm-keypool npm install && npm run build # Generate encryption key node -e "console.log(require('crypto').randomBytes(32).toString('hex'))" # Configure & launch cp .env.example .env npm start # → [keypool] v2.0.0 listening on :3131 # Add your first key curl -X POST http://localhost:3131/api/keys \ -H "Authorization: Bearer YOUR_TOKEN" \ -H "Content-Type: application/json" \ -d '{"provider":"deepseek","api_key":"sk-xxx","tier":"free"}'
Python — auto-routing
from openai import OpenAI client = OpenAI( base_url="http://localhost:3131/v1", api_key="anything" # Proxy handles upstream auth ) # Auto-route: intent=code, difficulty=hard → deepseek-coder response = client.chat.completions.create( model="auto", messages=[{"role": "user", "content": "Write a Rust HTTP server"}] ) # Use Claude directly response = client.chat.completions.create( model="claude-sonnet-4", messages=[{"role": "user", "content": "Explain quantum computing"}] )
cURL — routing metadata in response headers
curl http://localhost:3131/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{"model":"auto","messages":[{"role":"user","content":"hello"}]}' \ -D - # Response headers: # X-Routed-Provider: deepseek # X-Routed-Model: deepseek-v3 # X-Intent-Detected: chat # X-Difficulty: easy