Lynkr

Fast-Editor/Lynkr

Optimize LLM token usage with Lynkr, a CLI tool.

520
Stars
55
Forks
2
Open issues
4
Watchers
JavaScript Apache-2.0Last pushed Jul 5, 2026

Overview

Lynkr is an HTTP proxy CLI that helps streamline workflows by optimizing language model interactions and reducing token usage.

Categories

Tags

Similar tools

Install

npm install Lynkr

README

Lynkr

An LLM Gateway which optimises your token usage.

87.6% fewer tokens on JSON tool results. 53% fewer tokens on tool-heavy requests. 171ms semantic cache hits. Zero code changes.

87.6%
JSON Compression
53%
Tool Token Reduction
171ms
Semantic Cache Hits
13+
LLM Providers
0
Code Changes Required

Numbers from a live benchmark against LiteLLM on identical workloads. See full report →


🚀 New: Wrap Mode for AI Coding Tools

Use Lynkr's routing with your AI coding assistant — maximize your subscription value:

npm install -g lynkr


# Claude Code Pro/Max
lynkr wrap claude


Wrapping gives you:

  • ✅ Tier routing (send simple tasks to free Ollama, complex to your subscription/API)
  • ✅ TOON/RTK compression (87% token reduction on tool outputs)
  • ✅ Semantic caching (171ms cache hits)
  • 3-5x more usage from the same subscription limits
  • ✅ Works with OAuth (Claude, Copilot, Cursor) or API keys (Aider, Codex)

Full wrap guide →


Quick Start (2 Minutes)

1. Install Lynkr

npm install -g lynkr

2. Configure Lynkr

The fastest path is the interactive wizard:

lynkr init

It asks four questions — usage mode (Claude Pro/Max via wrap, or direct API keys), tier picks for SIMPLE/MEDIUM/COMPLEX/REASONING across the 12 supported providers, credentials for what you chose, and a few routing-intelligence knobs — then writes a fully-populated .env with sensible production defaults for everything else (caching, compression, policy budgets, MCP sandbox, agents, rate limiting).

Useful flags:

lynkr init --force                # overwrite an existing .env

See docs/init.md for the full wizard reference.

If you'd rather configure by hand, the manual options below still work — copy .env.example to .env and edit it directly:

Option A: Free & Local (Ollama) - Recommended for Testing

# Install Ollama first: https://ollama.com
ollama pull qwen2.5-coder:latest

Then start Lynkr:

lynkr start

3. Connect Your Tool

Cursor IDE

  • Settings → Models → Override Base URL
  • Set to: http://localhost:8081/v1
  • API Key: any-value

Codex CLI

Edit ~/.codex/config.toml:

model_provider = "lynkr"

[model_providers.lynkr]
base_url = "http://localhost:8081/v1"
wire_api = "responses"

Done! Your AI tool now uses your chosen provider.


Common Startup Errors

Error: unable to determine transport target for "pino-pretty"

Problem: You're running an older version (< 9.3.0).

Solution: Update to the latest version:

npm install -g lynkr@latest

If you must use an older version, set NODE_ENV=production before starting.

Warning: Missing tier configuration: TIER_SIMPLE, TIER_MEDIUM...

This is just a warning - you can ignore it. Tier routing is optional.

To remove the warning, add to .env:

TIER_SIMPLE=ollama:qwen2.5-coder:latest
TIER_MEDIUM=ollama:qwen2.5-coder:latest
TIER_COMPLEX=ollama:qwen2.5-coder:latest
TIER_REASONING=ollama:qwen2.5-coder:latest

Warning: FALLBACK_PROVIDER='databricks' is enabled but missing credentials

Solution: Add to .env:

FALLBACK_ENABLED=false

Error: connect ECONNREFUSED ::1:11434 (Ollama)

Problem: Ollama is not running.

Solution:

ollama serve

Keep this terminal open, and start Lynkr in a new terminal.

Error: Connection refused or 404 Not Found

Problem: Lynkr is not running or wrong port.

Solution: Check Lynkr is running on the correct port:

curl http://localhost:8081/

Should return: `{"service":"Lynkr","version":"9.x.x","