Fast-Editor/Lynkr

Streamline your workflow with Lynkr, a CLI tool that acts as an HTTP proxy for efficient code interactions using Claude Code CLI.

Lynk​r – An LLM‑gateway that saves tokens and money

What it is

Lynkr is a Node‑JS‑based proxy you run locally (or in a container) that sits between your AI‑coding tools (Claude Code, Cursor, Codex, etc.) and the large‑language‑model providers you use. It does three things automatically:

  1. Compresses JSON payloads – large tool‑call results are shrunk by ~84 % before they reach the model.
  2. Caches semantically similar requests – a hit returns a cached answer in < 300 ms with zero token cost.
  3. Routes each request to the cheapest‑enough model – a tiny “tier” router decides whether a query can be answered by a free local model (Ollama, llama.cpp, LM Studio) or needs to be escalated to a paid cloud provider (OpenAI, Anthropic, Azure, etc.).

All of this works without any code changes in the client; you only point the client at http://localhost:8081/v1 (or use the provided wrap command for Claude Code).


Who might use it

Use‑case Why Lynkr helps
Individual developers using a local model for everyday edits but still want occasional access to a paid model for hard problems. Cuts token usage by 50‑+ % and keeps subscription credits for the tasks that truly need them.
Teams with a mixed stack (some on‑prem models, some on Azure/OpenAI). Provides a single endpoint that can forward to any of the 14+ supported providers and shows a dashboard of spend vs. savings.
CI/CD or automated code‑review bots that call LLMs many times. Semantic cache eliminates repeated calls; tier routing prevents cheap‑model overloads.

Core features (as described in the README)

Feature What it does Reported benefit
JSON compression (RTK/TOON) Strips unused fields and compresses large tool‑output blobs before sending them to the model. 84 % fewer tokens on JSON‑heavy tool results.
Semantic cache Stores embeddings of recent requests; a near‑duplicate query is answered from cache in < 300 ms, no tokens billed. 0‑token cache hits; latency drop from seconds to milliseconds.
Tier routing Four configurable tiers (SIMPLE, MEDIUM, COMPLEX, REASONING). A k‑NN + bandit router decides the cheapest tier that can handle the request, with nightly auto‑calibration. 53 % token reduction on tool‑heavy calls; up to 15× fewer expensive‑tier hits.
Wrap mode One‑line wrapper (lynkr wrap claude) that injects the gateway into Claude Code, Copilot, Cursor, etc., without changing the tool’s config. Zero code changes; sticky sessions keep the same model for a conversation until it truly outgrows it.
Real‑time SSE streaming Pass‑through for providers that already stream; otherwise transforms OpenAI‑style streams into Anthropic‑style events. Continuous token‑by‑token output even when routing through multiple back‑ends.
Dashboard http://localhost:8081/dashboard shows spend, tier mix, routing accuracy, logs, health of each provider, and actionable insights. Gives visibility into where money is saved and where routing could improve.
Optional Graphify code‑analysis Rust‑based AST analysis (19 languages) that can feed richer complexity scores to the router. More accurate tier decisions for code‑heavy workloads.
Production knobs Rate‑limits, policy budgets, load‑shedding, memory cache, admin hot‑reload, etc. Makes the gateway usable in a CI or long‑running server.

How to get started (quick‑start from the README)

  1. Install – npm install -g lynkr (or Homebrew, Docker, one‑liner script).
  2. Run the wizard – lynkr init creates a .env with your chosen providers and tier definitions.
  3. Start the service – lynkr start (listens on localhost:8081).
  4. Point your tool – e.g., in Cursor set the model URL to http://localhost:8081/v1 and any API‑key value.
  5. Optional – lynkr wrap claude to automatically wrap Claude Code.

Limitations & open points (from the README)

  • The gateway relies on the upstream provider’s pricing data; unknown models are recorded with cost_usd=null unless you supply overrides.
  • Some advanced features (Graphify, load‑shedding, memory system) require extra installation steps (Rust toolchain, extra env vars).
  • Benchmarks are presented against LiteLLM and RouterArena; real‑world savings will depend on your own traffic pattern and model choices.
  • The service is written in Node 20+, so it needs a recent runtime and sufficient RAM for large local models.

Bottom line

Lynkr is a real, production‑ready gateway that lets developers combine free local LLMs with paid cloud APIs, automatically compresses payloads, caches repeated queries, and routes each request to the cheapest tier that can handle it. The README provides detailed installation, configuration, and benchmarking information, making it a genuine open‑source project in the AI‑inference/agent tooling space.

Related

  • Project
  • Project
  • Dispatch
  • Project
  • Project