lynkr

Intelligent LLM routing proxy with complexity-based tier routing, agentic workflow detection, and multi-provider failover. Drop-in replacement for direct provider APIs.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "lynkr" with this command: npx skills add vishalveerareddy123/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

  1. Complexity Analysis - Scores each request 0-100 based on token count, tool usage, code patterns, and domain keywords
  2. Tier Routing - Maps score to a tier (SIMPLE/MEDIUM/COMPLEX/REASONING), each configured with a specific provider:model
  3. Agentic Detection - Detects multi-step workflows (tool loops, autonomous agents) and upgrades to higher tiers
  4. Cost Optimization - Picks the cheapest provider that can handle the tier
  5. 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-Role header 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:

HeaderDescription
X-Lynkr-ProviderProvider that handled the request
X-Lynkr-ModelModel used
X-Lynkr-TierComplexity tier (SIMPLE/MEDIUM/COMPLEX/REASONING)
X-Lynkr-Complexity-ScoreNumeric score 0-100
X-Lynkr-Routing-MethodHow the route was decided
X-Lynkr-Cost-OptimizedWhether cost optimization changed the provider

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Automation

RelayPlane

Agent ops layer for OpenClaw — observability, governance, and cost optimization with automatic failover. Never breaks your setup.

Registry SourceRecently Updated
2.8K5Profile unavailable
Automation

Reivo

Track AI agent costs in real-time, set budget limits, and auto-detect runaway loops. Smart routing reduces costs 40-60%. Works with OpenAI, Anthropic, and Go...

Registry SourceRecently Updated
2331Profile unavailable
Automation

Openclaw Router

Intelligent Model Routing - Save 60% on AI Costs / 智能路由系统 - 节省 60% 成本

Registry SourceRecently Updated
4280Profile unavailable
General

Ollama Ollama Herd

Ollama Ollama Herd — multimodal Ollama model router that herds your Ollama LLMs into one smart Ollama endpoint. Route Ollama Llama, Qwen, DeepSeek, Phi, Mist...

Registry SourceRecently Updated
1542Profile unavailable