Production-ready Claude Code proxy supporting 9+ LLM providers with 60-80% cost reduction through token optimization.
Lynkr is a self-hosted proxy server that unlocks Claude Code CLI , Cursor IDE and Codex Cli by enabling:
- π Any LLM Provider - Databricks, AWS Bedrock (100+ models), OpenRouter (100+ models), Ollama (local), llama.cpp, Azure OpenAI, Azure Anthropic, OpenAI, LM Studio
- π° 60-80% Cost Reduction - Built-in token optimization with smart tool selection, prompt caching, and memory deduplication
- π 100% Local/Private - Run completely offline with Ollama or llama.cpp
- π― Zero Code Changes - Drop-in replacement for Anthropic's backend
- π’ Enterprise-Ready - Circuit breakers, load shedding, Prometheus metrics, health checks
Perfect for:
- Developers who want provider flexibility and cost control
- Enterprises needing self-hosted AI with observability
- Privacy-focused teams requiring local model execution
- Teams seeking 60-80% cost reduction through optimization
Option 1: NPM Package (Recommended)
# Install globally
npm install -g lynkr
# Or run directly with npx
npx lynkrOption 2: Git Clone
# Clone repository
git clone https://github.com/vishalveerareddy123/Lynkr.git
cd Lynkr
# Install dependencies
npm install
# Create .env from example
cp .env.example .env
# Edit .env with your provider credentials
nano .env
# Start server
npm startOption 3: Docker
docker-compose up -dLynkr supports 9+ LLM providers:
| Provider | Type | Models | Cost | Privacy |
|---|---|---|---|---|
| AWS Bedrock | Cloud | 100+ (Claude, Titan, Llama, Mistral, etc.) |
|
Cloud |
| Databricks | Cloud | Claude Sonnet 4.5, Opus 4.5 | $$$ | Cloud |
| OpenRouter | Cloud | 100+ (GPT, Claude, Llama, Gemini, etc.) |
|
Cloud |
| Ollama | Local | Unlimited (free, offline) | FREE | π 100% Local |
| llama.cpp | Local | GGUF models | FREE | π 100% Local |
| Azure OpenAI | Cloud | GPT-4o, GPT-5, o1, o3 | $$$ | Cloud |
| Azure Anthropic | Cloud | Claude models | $$$ | Cloud |
| OpenAI | Cloud | GPT-4o, o1, o3 | $$$ | Cloud |
| LM Studio | Local | Local models with GUI | FREE | π 100% Local |
π Full Provider Configuration Guide
Configure Claude Code CLI to use Lynkr:
# Set Lynkr as backend
export ANTHROPIC_BASE_URL=http://localhost:8081
export ANTHROPIC_API_KEY=dummy
# Run Claude Code
claude "Your prompt here"That's it! Claude Code now uses your configured provider.
π Detailed Claude Code Setup
Configure Cursor IDE to use Lynkr:
-
Open Cursor Settings
- Mac:
Cmd+,| Windows/Linux:Ctrl+, - Navigate to: Features β Models
- Mac:
-
Configure OpenAI API Settings
- API Key:
sk-lynkr(any non-empty value) - Base URL:
http://localhost:8081/v1 - Model:
claude-3.5-sonnet(or your provider's model)
- API Key:
-
Test It
- Chat:
Cmd+L/Ctrl+L - Inline edits:
Cmd+K/Ctrl+K - @Codebase search: Requires embeddings setup
- Chat:
Configure Codex Cli to use Lynkr
Option 1: Environment Variable (simplest)
export OPENAI_BASE_URL=http://localhost:8081/v1
export OPENAI_API_KEY=dummy
codex
Option 2: Config File (~/.codex/config.toml)
model_provider = "lynkr"
[model_providers.lynkr]
name = "Lynkr Proxy"
base_url = "http://localhost:8081/v1"
env_key = "OPENAI_API_KEY"
- π¦ Installation Guide - Detailed installation for all methods
- βοΈ Provider Configuration - Complete setup for all 9+ providers
- π― Quick Start Examples - Copy-paste configs
- π₯οΈ Claude Code CLI Setup - Connect Claude Code CLI
- π¨ Cursor IDE Setup - Full Cursor integration with troubleshooting
- π Embeddings Guide - Enable @Codebase semantic search (4 options: Ollama, llama.cpp, OpenRouter, OpenAI)
- β¨ Core Features - Architecture, request flow, format conversion
- π§ Memory System - Titans-inspired long-term memory
- π° Token Optimization - 60-80% cost reduction strategies
- π§ Tools & Execution - Tool calling, execution modes, custom tools
- π³ Docker Deployment - docker-compose setup with GPU support
- π Production Hardening - Circuit breakers, load shedding, metrics
- π API Reference - All endpoints and formats
- π§ Troubleshooting - Common issues and solutions
- β FAQ - Frequently asked questions
- π§ͺ Testing Guide - Running tests and validation
- π DeepWiki Documentation - AI-powered documentation search
- π¬ GitHub Discussions - Community Q&A
- π Report Issues - Bug reports and feature requests
- π¦ NPM Package - Official npm package
- β Multi-Provider Support - 9+ providers including local (Ollama, llama.cpp) and cloud (Bedrock, Databricks, OpenRouter)
- β 60-80% Cost Reduction - Token optimization with smart tool selection, prompt caching, memory deduplication
- β 100% Local Option - Run completely offline with Ollama/llama.cpp (zero cloud dependencies)
- β OpenAI Compatible - Works with Cursor IDE, Continue.dev, and any OpenAI-compatible client
- β Embeddings Support - 4 options for @Codebase search: Ollama (local), llama.cpp (local), OpenRouter, OpenAI
- β MCP Integration - Automatic Model Context Protocol server discovery and orchestration
- β Enterprise Features - Circuit breakers, load shedding, Prometheus metrics, K8s health checks
- β Streaming Support - Real-time token streaming for all providers
- β Memory System - Titans-inspired long-term memory with surprise-based filtering
- β Tool Calling - Full tool support with server and passthrough execution modes
- β Production Ready - Battle-tested with 400+ tests, observability, and error resilience
βββββββββββββββββββ
β Claude Code CLI β or Cursor IDE
ββββββββββ¬βββββββββ
β Anthropic/OpenAI Format
β
βββββββββββββββββββ
β Lynkr Proxy β
β Port: 8081 β
β β
β β’ Format Conv. β
β β’ Token Optim. β
β β’ Provider Routeβ
β β’ Tool Calling β
β β’ Caching β
ββββββββββ¬βββββββββ
β
ββββ Databricks (Claude 4.5)
ββββ AWS Bedrock (100+ models)
ββββ OpenRouter (100+ models)
ββββ Ollama (local, free)
ββββ llama.cpp (local, free)
ββββ Azure OpenAI (GPT-4o, o1)
ββββ OpenAI (GPT-4o, o3)
ββββ Azure Anthropic (Claude)
100% Local (FREE)
export MODEL_PROVIDER=ollama
export OLLAMA_MODEL=qwen2.5-coder:latest
export OLLAMA_EMBEDDINGS_MODEL=nomic-embed-text
npm startAWS Bedrock (100+ models)
export MODEL_PROVIDER=bedrock
export AWS_BEDROCK_API_KEY=your-key
export AWS_BEDROCK_MODEL_ID=anthropic.claude-3-5-sonnet-20241022-v2:0
npm startOpenRouter (simplest cloud)
export MODEL_PROVIDER=openrouter
export OPENROUTER_API_KEY=sk-or-v1-your-key
npm startπ More Examples
We welcome contributions! Please see:
- Contributing Guide - How to contribute
- Testing Guide - Running tests
Apache 2.0 - See LICENSE file for details.
- β Star this repo if Lynkr helps you!
- π¬ Join Discussions - Ask questions, share tips
- π Report Issues - Bug reports welcome
- π Read the Docs - Comprehensive guides
Made with β€οΈ by developers, for developers.