Lynkr is a local gateway that sits between an AI coding tool and the model providers behind it. You point Claude Code, Cursor, Codex CLI, Cline, or Continue at http://localhost:8081 and change nothing else in the tool; Lynkr strips unused tool schemas, compresses large JSON tool results, answers repeated queries from a semantic cache, and routes each request to a model tier chosen from its estimated complexity.
Tier routing is configured with TIERSIMPLE, TIERMEDIUM, TIERCOMPLEX, and TIERREASONING environment variables that name the model for each tier, and only models listed there can be selected. Scoring combines anchor-embedding classification with a local LLM difficulty classifier, force-reasoning patterns, a risk classifier for authentication and credential paths, and an agentic-workflow detector; it reads only cleaned user text, ignoring tool schemas, history, and system reminders. A conversation gets a content fingerprint so one decision pins for the session, with an escape ladder that re-escalates on risk keywords, score drift, or context overflow.
Fourteen providers are supported, four of them local: Ollama, llama.cpp, and LM Studio for offline use, alongside OpenRouter, AWS Bedrock, Databricks, Azure OpenAI, Azure Anthropic, OpenAI, Atlas Cloud, DeepSeek, Z.ai, and Moonshot AI. An interactive lynkr init wizard asks for usage mode, tier picks, credentials, and routing knobs, then writes a populated .env, and a lynkr wrap mode puts the gateway in front of a subscription coding CLI.
The project publishes benchmark figures from a bundled harness run against LiteLLM on the same backends. On a 60-item grep JSON result, compression records 427 tokens against 3,458; a paraphrased second call returns from the semantic cache in 171 ms with no tokens billed; and across 11 routing scenarios Lynkr is judged correct 11 times against 4 for LiteLLM's default heuristic router, whose misses all under-route to a 7B local model. Those scenarios come from Lynkr's own regression suite. On the third-party RouterArena set of 8,400 queries the project reports 68.41% accuracy at $0.29 per 1,000 queries.
A dashboard at /dashboard reads the local telemetry store and shows spend against a flagship-model counterfactual, daily tier mix, over- and under-provisioned request counts, filterable request logs, provider health, and a metric-by-dimension pivot with CSV export; the same numbers are available as JSON endpoints.
Features
- Drop-in proxy: coding tools point at a local base URL and need no code changes
- Tier routing: requests are classified and sent to the model named for that tier, with session stickiness and a guarded escalation ladder
- Tool-result compression: large JSON tool output is compressed in process, and unused tool schemas are stripped from requests
- Semantic cache: near-identical prompts return a cached response with no model tokens billed
- Local providers: Ollama, llama.cpp, and LM Studio run fully offline, alongside 14 cloud providers
- Streaming: native Anthropic passthrough plus cross-format transformation of OpenAI-style upstreams
- Dashboard: spend, tier mix, routing accuracy, request logs, and provider health, with JSON APIs behind it
- Cost tracking: prices resolved from a cached registry, overridable per model, with unknown models recorded as a null cost rather than an estimate
- Status line: a one-line Claude Code status command that always exits zero, so a down proxy cannot break the harness
- Setup wizard: lynkr init writes a complete .env covering caching, compression, policy budgets, and rate limiting
- Optional code analysis: Graphify adds AST-based complexity scoring across 19 languages, with a fallback when it is absent
- Resilience: load shedding on heap pressure and admin hot-reload without a restart
