Lynkr AI Routing Proxy
/install lynkr
Lynkr - Intelligent LLM Routing Proxy
Lynkr routes AI coding requests to the best available model based on task complexity, cost, and provider health. It supports 12+ providers and works as an OpenAI-compatible proxy.
Quick Start
npm install -g lynkr
lynkr --port 8081
Then point your AI coding tool at http://localhost:8081/v1.
How It Works
- Complexity Analysis - Scores each request 0-100 based on token count, tool usage, code patterns, and domain keywords
- Tier Routing - Maps score to a tier (SIMPLE/MEDIUM/COMPLEX/REASONING), each configured with a specific provider:model
- Agentic Detection - Detects multi-step workflows (tool loops, autonomous agents) and upgrades to higher tiers
- Cost Optimization - Picks the cheapest provider that can handle the tier
- Circuit Breaker + Failover - Automatic failover when a provider is down
Configuration for OpenClaw
Set tier routing in your environment:
MODEL_PROVIDER=ollama
TIER_SIMPLE=ollama:qwen2.5-coder:7b
TIER_MEDIUM=openrouter:anthropic/claude-sonnet-4-20250514
TIER_COMPLEX=bedrock:anthropic.claude-sonnet-4-20250514-v1:0
TIER_REASONING=bedrock:anthropic.claude-sonnet-4-20250514-v1:0
OpenClaw Mode
When running under OpenClaw, enable model name rewriting so the actual provider and model appear in responses:
OPENCLAW_MODE=true
This replaces the generic model: "auto" in responses with the actual provider/model that handled the request (e.g., ollama/qwen2.5-coder:7b or bedrock/claude-sonnet-4).
Provider Registration
Add to your openclaw.json:
{
"models": {
"providers": [
{
"name": "lynkr",
"type": "openai-compatible",
"base_url": "http://localhost:8081/v1",
"api_key": "any-value",
"models": ["auto"]
}
]
},
"agents": {
"defaults": {
"models": {
"primary": "lynkr/auto",
"fallback": "lynkr/auto"
}
}
}
}
Features
- 12+ providers: Ollama, OpenAI, Anthropic (Azure/Bedrock/Direct), OpenRouter, Vertex, Moonshot, Z.AI, LM Studio, llama.cpp
- Smart routing: Heuristic + optional BERT-based complexity classification
- Tool support: Server-side tool execution with IDE-aware tool mapping (Cursor, Cline, Continue, Codex)
- Session management: Persistent sessions with cross-request deduplication
- Observability: Prometheus metrics, circuit breaker status, routing decision headers (
X-Lynkr-*) - Agent-aware:
X-Agent-Roleheader for multi-agent framework routing hints - Lazy tool loading: On-demand tool registration for fast startup
- History compression: Automatic conversation trimming for long sessions
Response Headers
Every response includes routing metadata:
| Header | Description |
|---|---|
X-Lynkr-Provider |
Provider that handled the request |
X-Lynkr-Model |
Model used |
X-Lynkr-Tier |
Complexity tier (SIMPLE/MEDIUM/COMPLEX/REASONING) |
X-Lynkr-Complexity-Score |
Numeric score 0-100 |
X-Lynkr-Routing-Method |
How the route was decided |
X-Lynkr-Cost-Optimized |
Whether cost optimization changed the provider |
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install lynkr - 安装完成后,直接呼叫该 Skill 的名称或使用
/lynkr触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Lynkr AI Routing Proxy 是什么?
Intelligent LLM routing proxy with complexity-based tier routing, agentic workflow detection, and multi-provider failover. Drop-in replacement for direct pro... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 99 次。
如何安装 Lynkr AI Routing Proxy?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install lynkr」即可一键安装,无需额外配置。
Lynkr AI Routing Proxy 是免费的吗?
是的,Lynkr AI Routing Proxy 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Lynkr AI Routing Proxy 支持哪些平台?
Lynkr AI Routing Proxy 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Lynkr AI Routing Proxy?
由 Vishal Veera Reddy(@vishalveerareddy123)开发并维护,当前版本 v0.6.0。