Lynkr
A self-hosted LLM gateway that slashes token usage for AI coding tools through JSON compression, semantic caching, and complexity-based tier routing — with zero code changes.
Evidence shows a local proxy intercepting all AI-tool traffic: it compresses, caches and rewrites requests/responses (semantic cache, TOON, SSE reshaping), but no evidence of data minimization, user confirmation flows, or sensitive-data redaction; data flows to 14+ cloud providers are documented, hence a mid score; dependency security is backed by a CI audit gate and a public-registry lockfile check (though the audit degrades to warn-and-pass on timeout); curl|bash installer, postinstall script, and a prestart that can start docker compose are documented external effects; no rollback mechanism is documented; the author is named in LICENSE (Vishal Veera Reddy), publisher unverified.
README has an extensive common-errors section (pino-pretty, tier warnings, ECONNREFUSED), so failure messaging is well handled; many test scripts and a CI matrix support self-consistency, but internal inconsistencies exist (provider count alternates 12+/14+, dual docs/ vs documentation/ paths, wide version narrative), hence the deduction; dependency availability is corroborated by retry/circuit-breaker/degradation test filenames.
Audience and scenarios are clearly defined (Claude Code/Cursor/Codex users, local-free vs cloud-paid, wrap mode) — a genuine strength, full marks; capability boundaries are partly honest (Baidu marked unverified, benchmark admits home-field advantage) but headline marketing numbers (84%, 53%, beating GPT-5) lack qualification, hence the deduction; routing trigger logic is described in detail (FORCE_REASONING, risk classifier, agentic detection) but is asserted, not verified; environment fit spans Node 20+, Docker, Homebrew.
Full Apache-2.0 text present — license full marks; FAQ and install notes are thorough; information architecture is flawed (two documentation directory schemes, potentially broken links); no CHANGELOG file exists, versioning relies on workflows, hence the deduction; maintenance responsibility rests on a single named author with no governance/contributor/update commitments, hence the deduction; naming (lynkr/lynkr-setup/lynkr-statusline) is stable.
Output usability is evidenced by dashboard, statusline, CSV export; marginal-value claims (token savings, routing economics) are specific and backed by a runnable benchmark script, but remain unexecuted claims — a static review can only award a mid score; cost-benefit narrative vs LiteLLM has data but derives from self-run benchmarks.
Claims are mostly traceable to named scripts (benchmark-tier-routing.js, docs/benchmarking.md) and configs (litellm-autorouter-v2.yaml); but third-party corroboration is weak — the cited RouterArena 'ICLR 2026' benchmark carries a future date and unverifiable repository, hence the deduction; fact/inference separation is comparatively good (unverified labels, fairness notes, 'not measured yet ≠ all-clear').
- The proxy intercepts and caches all AI-tool traffic (including prompts that may contain code and secrets) and forwards it to any configured cloud provider — review data-egress paths before enterprise use;
- The semantic cache persists prompts/responses locally with no documented encryption or retention policy;
- install.sh executes via curl|bash and postinstall runs a native-module check script — assess supply-chain risk yourself;
- All performance and savings figures come from self-run benchmarks; the third-party RouterArena benchmark is questionable (future-dated) and unverified by this static review;
- The CI audit degrades to warn-and-pass during npm registry incidents — not a clean security audit;
- No CHANGELOG or rollback mechanism is documented; back up .env and local cache data before upgrading.
What does this agent do, and when should you use it?
Lynkr (GitHub: Fast-Editor/Lynkr) is a self-hosted LLM gateway built on Node.js 20+ that runs as an HTTP proxy on localhost:8081, sitting between AI coding tools like Claude Code, Cursor, Codex CLI, Cline, and Continue and their model providers. Before requests reach a model, it strips unused tools, compresses large JSON tool results with TOON/RTK (claimed 84% token reduction), serves repeated queries from a semantic cache (claimed 171ms hits, 0 tokens billed), and routes each request by complexity across SIMPLE/MEDIUM/COMPLEX/REASONING tiers spanning 14+ providers — including free local options (Ollama, llama.cpp, LM Studio) and cloud backends like Bedrock, Azure, OpenRouter, and Databricks. Routing decisions come from an anchor-embedding classifier combined with a local LLM difficulty classifier, with sticky sessions and automatic escalation. A built-in dashboard exposes spend, tier mix, routing accuracy, and request logs. Licensed under Apache-2.0, it installs via npm, Homebrew, Docker, or from source.
Started with lynkr start, Lynkr exposes an Anthropic-compatible endpoint at http://localhost:8081/v1; coding tools only need their Base URL pointed at it. Incoming requests pass through: tool stripping (removing unused tools — 53% fewer tokens on tool-heavy requests per the README), TOON binary compression of large JSON tool results, semantic cache lookup, and an intent scorer combining an anchor-embedding classifier with a local LLM difficulty classifier (qwen2.5:3b) that assigns a tier, then routes to the provider configured in .env via TIER_SIMPLE through TIER_REASONING. A lynkr wrap claude wrap mode provides fingerprint-based sticky routing with automatic escalation. All tiers support SSE streaming (native passthrough and cross-format transform). Additional features include MCP integration, a Titans-inspired memory system, cost tracking via a LiteLLM-sourced pricing registry, optional Graphify AST code analysis, a telemetry dashboard at /dashboard, and a lynkr-statusline status bar.
- Claude Pro/Max subscribers who want simple requests offloaded to free local Ollama models so subscription capacity is reserved for genuinely hard work.
- Developers using Cursor or Codex CLI daily, whose grep results, file reads, and test output generate large JSON tool payloads that need compression to cut costs.
- Engineering leads who must route team AI coding traffic through company infrastructure such as Databricks, Azure, or Bedrock.
- Budget-conscious individual developers who want fully free, offline coding assistance via Ollama, llama.cpp, or LM Studio.
- Teams auditing AI coding spend, using the built-in dashboard for savings vs. flagship counterfactuals, tier mix, routing accuracy, and per-session cost drill-downs.
- Users who want to verify routing quality themselves by running
node benchmark-tier-routing.js, a 19-scenario routing regression harness with a head-to-head mode against LiteLLM.
What are this agent's strengths and limitations?
- TOON JSON compression is a concrete differentiator: the bundled benchmark compresses a 60-item grep JSON from 3,458 to 427 tokens (87.6%) — LiteLLM and OpenRouter offer nothing comparable.
- Tier routing uses a verified cascade (FORCE_REASONING regex, risk classifier, agentic detector, anchor embeddings plus local LLM classifier) and scores only cleaned user text, so tool schemas don't skew routing; self-reported 11/11 routing correctness.
- Semantic cache hits measured at 171ms with 0 tokens billed in the project's benchmark for near-identical prompts.
- Four local providers (Ollama, llama.cpp, LM Studio, plus one more) enable fully free offline usage, alongside 14+ cloud providers.
- The dashboard goes beyond spend: it shows savings against flagship-model counterfactuals, a routing-accuracy self-audit, and evidence-backed findings ranked by past overspend.
- Zero code changes — a drop-in Base URL replacement for Claude Code, Cursor, and Codex.
- Performance claims come primarily from the project's own benchmark script and self-described third-party data (RouterArena, LiteLLM head-to-head); the benchmark scenarios derive from Lynkr's own regression suite, acknowledged as home-field advantage, so independent verification is limited.
- Routing quality depends on embedding models and a local LLM classifier (~500ms warm call); if local classifier models are unavailable, parts of the cascade fail.
- Requires a persistent Node.js 20+ service on port 8081; local backends like Ollama add installation and RAM overhead (oversized models can fail to load).
- Some provider configurations are unverified — the README explicitly marks Baidu Qianfan as untested against a live key.
- Missing TIER_* config only warns but degrades functionality; advanced features (Graphify needs a Rust build, semantic cache, memory system) require extra installation or configuration.
How do you install or deploy this agent?
NPM (recommended): npm install -g lynkr. Alternatives: one-line installer curl -fsSL https://raw.githubusercontent.com/Fast-Editor/Lynkr/main/install.sh | bash; Homebrew brew tap fast-editor/lynkr && brew install lynkr; Docker git clone https://github.com/Fast-Editor/Lynkr.git && cd Lynkr && docker-compose up -d; or from source (clone, then npm install && cp .env.example .env && npm start). Requires Node.js 20+; if using Ollama, install it first and run ollama pull qwen2.5-coder:latest.
How do you use this agent?
1) Run lynkr init — the interactive wizard asks four questions (usage mode, tier picks across providers, credentials, routing knobs) and writes a fully populated .env; alternatively copy .env.example and edit manually, e.g. MODEL_PROVIDER=ollama plus TIER_SIMPLE=ollama:qwen2.5:3b and other tier entries. 2) Start with lynkr start (default port 8081). 3) Connect your tool: in Cursor, override the Base URL to http://localhost:8081/v1 with any API key; in Codex CLI set base_url = "http://localhost:8081/v1" in ~/.codex/config.toml; for Claude Code launch via lynkr wrap claude. 4) Open http://localhost:8081/dashboard to review spend and routing telemetry. Optionally enable PROMPT_CACHE_ENABLED=true and SEMANTIC_CACHE_ENABLED=true for full optimization.
How does this agent compare with similar options?
The README includes a feature comparison against LiteLLM, OpenRouter, and PortKey, plus benchmark data: in a same-backend head-to-head with LiteLLM v1.94 Auto Router v2, LiteLLM's heuristic router scored 4/11 routing-correct with systematic under-routing to a 7B local model, and its LLM classifier adds a paid per-request GPT-5.2 call; Lynkr self-reports 11/11. LiteLLM requires a Python + Docker + PostgreSQL stack, while Lynkr needs only Node.js. OpenRouter is a non-self-hostable SaaS with no local-model support. Adopters should validate these numbers against their own workloads.
FAQ
What does Lynkr cost to use?
Do I need to configure all four tiers for it to work?
lynkr init wizard generates a complete configuration easily.How does it plug into my existing Claude Code or Cursor setup?
lynkr wrap claude; Cursor overrides the Base URL to http://localhost:8081/v1 in Settings → Models with any API key value; Codex CLI edits base_url in ~/.codex/config.toml. All are zero-code-change configuration swaps.