Dev & Engineering llm-gatewayllm-proxyllm-routerprompt-cachingcursorollamatoken-optimization

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.

FollowAgents review · FARS-2.1
Use with care
62/ 100 5-point scale 3.1 / 5
1 2 3 4 5 6
1Trust14 / 29 · 2.4/5

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.

2Reliability9 / 14 · 3.2/5

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.

3Adaptability14 / 18 · 3.9/5

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.

4Convention12 / 18 · 3.3/5

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.

5Effectiveness9 / 13 · 3.5/5

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.

6Verifiability4 / 8 · 2.5/5

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').

Evidence confidence: Low Reviewed Sep 07, 2026 Reviewed revision c5d6a2dc0607
Before you use it
  • 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.
Review evidence [1][2][3][4][5][6][7][8]
See the full review method →

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.

  1. Claude Pro/Max subscribers who want simple requests offloaded to free local Ollama models so subscription capacity is reserved for genuinely hard work.
  2. 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.
  3. Engineering leads who must route team AI coding traffic through company infrastructure such as Databricks, Azure, or Bedrock.
  4. Budget-conscious individual developers who want fully free, offline coding assistance via Ollama, llama.cpp, or LM Studio.
  5. 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.
  6. 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?

Pros
  • 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.
Limitations
  • 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?
Lynkr itself is free and open source (Apache-2.0). Cost depends on routing targets: routing entirely to Ollama/llama.cpp local models is free; cloud providers bill per their token rates. The README's cost table estimates heavy direct Anthropic use at $300-900/month, $0 with Lynkr+Ollama, and $60-240 with Lynkr+OpenRouter; tier routing plus token optimization can save an additional 50-87% on cloud providers.
Do I need to configure all four tiers for it to work?
No. Tier routing is optional — missing TIER_SIMPLE and related settings only produce a warning you can ignore. The lynkr init wizard generates a complete configuration easily.
How does it plug into my existing Claude Code or Cursor setup?
Claude Code launches wrapped via 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.
What happens when routing gets a request wrong?
Lynkr has a guarded escape ladder: risk keywords (auth/middleware paths), force phrases, score drift, and context overflow all trigger re-escalation to a higher tier. Conversations stay pinned via content-fingerprint session ids until a task genuinely outgrows its model. The dashboard's routing-accuracy self-audit shows over- and under-provisioned decisions.
Which model providers does it support?
Four local providers (Ollama, llama.cpp, LM Studio, and one more) plus 14+ cloud providers including OpenRouter, AWS Bedrock, Databricks, Azure OpenAI, Azure Anthropic, OpenAI, Atlas Cloud, DeepSeek, Z.ai, Moonshot AI, and Baidu Qianfan. Note that Baidu Qianfan is flagged unverified in the README.

Compare agents like this one

The same FARS review applied across the shortlist this agent qualifies for.

Related agents