lynkr 8.0.0 → 9.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.lynkr/telemetry.db +0 -0
- package/.lynkr/telemetry.db-shm +0 -0
- package/.lynkr/telemetry.db-wal +0 -0
- package/README.md +196 -322
- package/lynkr-skill.tar.gz +0 -0
- package/package.json +4 -3
- package/src/api/openai-router.js +64 -13
- package/src/api/providers-handler.js +171 -3
- package/src/api/router.js +9 -2
- package/src/clients/circuit-breaker.js +10 -247
- package/src/clients/codex-process.js +342 -0
- package/src/clients/codex-utils.js +143 -0
- package/src/clients/databricks.js +210 -63
- package/src/clients/resilience.js +540 -0
- package/src/clients/retry.js +22 -167
- package/src/clients/standard-tools.js +23 -0
- package/src/config/index.js +77 -0
- package/src/context/compression.js +42 -9
- package/src/context/distill.js +492 -0
- package/src/orchestrator/index.js +48 -8
- package/src/routing/complexity-analyzer.js +258 -5
- package/src/routing/index.js +12 -2
- package/src/routing/latency-tracker.js +148 -0
- package/src/routing/model-tiers.js +2 -0
- package/src/routing/quality-scorer.js +113 -0
- package/src/routing/telemetry.js +464 -0
- package/src/server.js +13 -12
- package/src/tools/code-graph.js +538 -0
- package/src/tools/code-mode.js +304 -0
- package/src/tools/index.js +4 -0
- package/src/tools/lazy-loader.js +18 -0
- package/src/tools/mcp-remote.js +7 -0
- package/src/tools/smart-selection.js +11 -0
- package/src/tools/tinyfish.js +358 -0
- package/src/tools/truncate.js +1 -0
- package/src/utils/payload.js +206 -0
- package/src/utils/perf-timer.js +80 -0
- package/.github/FUNDING.yml +0 -15
- package/.github/workflows/README.md +0 -215
- package/.github/workflows/ci.yml +0 -69
- package/.github/workflows/index.yml +0 -62
- package/.github/workflows/web-tools-tests.yml +0 -56
- package/CITATIONS.bib +0 -6
- package/DEPLOYMENT.md +0 -1001
- package/LYNKR-TUI-PLAN.md +0 -984
- package/PERFORMANCE-REPORT.md +0 -866
- package/PLAN-per-client-model-routing.md +0 -252
- package/docs/42642f749da6234f41b6b425c3bb07c9.txt +0 -1
- package/docs/BingSiteAuth.xml +0 -4
- package/docs/docs-style.css +0 -478
- package/docs/docs.html +0 -198
- package/docs/google5be250e608e6da39.html +0 -1
- package/docs/index.html +0 -577
- package/docs/index.md +0 -584
- package/docs/robots.txt +0 -4
- package/docs/sitemap.xml +0 -44
- package/docs/style.css +0 -1223
- package/docs/toon-integration-spec.md +0 -130
- package/documentation/README.md +0 -101
- package/documentation/api.md +0 -806
- package/documentation/claude-code-cli.md +0 -679
- package/documentation/codex-cli.md +0 -397
- package/documentation/contributing.md +0 -571
- package/documentation/cursor-integration.md +0 -734
- package/documentation/docker.md +0 -874
- package/documentation/embeddings.md +0 -762
- package/documentation/faq.md +0 -713
- package/documentation/features.md +0 -403
- package/documentation/headroom.md +0 -519
- package/documentation/installation.md +0 -758
- package/documentation/memory-system.md +0 -476
- package/documentation/production.md +0 -636
- package/documentation/providers.md +0 -1009
- package/documentation/routing.md +0 -476
- package/documentation/testing.md +0 -629
- package/documentation/token-optimization.md +0 -325
- package/documentation/tools.md +0 -697
- package/documentation/troubleshooting.md +0 -969
- package/final-test.js +0 -33
- package/headroom-sidecar/config.py +0 -93
- package/headroom-sidecar/requirements.txt +0 -14
- package/headroom-sidecar/server.py +0 -451
- package/monitor-agents.sh +0 -31
- package/scripts/audit-log-reader.js +0 -399
- package/scripts/compact-dictionary.js +0 -204
- package/scripts/test-deduplication.js +0 -448
- package/src/db/database.sqlite +0 -0
- package/te +0 -11622
- package/test/README.md +0 -212
- package/test/azure-openai-config.test.js +0 -213
- package/test/azure-openai-error-resilience.test.js +0 -238
- package/test/azure-openai-format-conversion.test.js +0 -354
- package/test/azure-openai-integration.test.js +0 -287
- package/test/azure-openai-routing.test.js +0 -175
- package/test/azure-openai-streaming.test.js +0 -171
- package/test/bedrock-integration.test.js +0 -457
- package/test/comprehensive-test-suite.js +0 -928
- package/test/config-validation.test.js +0 -207
- package/test/cursor-integration.test.js +0 -484
- package/test/format-conversion.test.js +0 -578
- package/test/hybrid-routing-integration.test.js +0 -269
- package/test/hybrid-routing-performance.test.js +0 -428
- package/test/llamacpp-integration.test.js +0 -882
- package/test/lmstudio-integration.test.js +0 -347
- package/test/memory/extractor.test.js +0 -398
- package/test/memory/retriever.test.js +0 -613
- package/test/memory/retriever.test.js.bak +0 -585
- package/test/memory/search.test.js +0 -537
- package/test/memory/search.test.js.bak +0 -389
- package/test/memory/store.test.js +0 -344
- package/test/memory/store.test.js.bak +0 -312
- package/test/memory/surprise.test.js +0 -300
- package/test/memory-performance.test.js +0 -472
- package/test/openai-integration.test.js +0 -683
- package/test/openrouter-error-resilience.test.js +0 -418
- package/test/passthrough-mode.test.js +0 -385
- package/test/performance-benchmark.js +0 -351
- package/test/performance-tests.js +0 -528
- package/test/routing.test.js +0 -225
- package/test/toon-compression.test.js +0 -131
- package/test/web-tools.test.js +0 -329
- package/test-agents-simple.js +0 -43
- package/test-cli-connection.sh +0 -33
- package/test-learning-unit.js +0 -126
- package/test-learning.js +0 -112
- package/test-parallel-agents.sh +0 -124
- package/test-parallel-direct.js +0 -155
- package/test-subagents.sh +0 -117
package/documentation/faq.md
DELETED
|
@@ -1,713 +0,0 @@
|
|
|
1
|
-
# Frequently Asked Questions (FAQ)
|
|
2
|
-
|
|
3
|
-
Common questions about Lynkr, installation, configuration, and usage.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## General Questions
|
|
8
|
-
|
|
9
|
-
### What is Lynkr?
|
|
10
|
-
|
|
11
|
-
Lynkr is a self-hosted proxy server that enables Claude Code CLI and Cursor IDE to work with multiple LLM providers (Databricks, AWS Bedrock, OpenRouter, Ollama, Moonshot AI, etc.) instead of being locked to Anthropic's API.
|
|
12
|
-
|
|
13
|
-
**Key benefits:**
|
|
14
|
-
- 💰 **60-80% cost savings** through token optimization
|
|
15
|
-
- 🔓 **Provider flexibility** - Choose from 12+ providers
|
|
16
|
-
- 🔒 **Privacy** - Run 100% locally with Ollama or llama.cpp
|
|
17
|
-
- ✅ **Zero code changes** - Drop-in replacement for Anthropic backend
|
|
18
|
-
|
|
19
|
-
---
|
|
20
|
-
|
|
21
|
-
### Can I use Lynkr with the official Claude Code CLI?
|
|
22
|
-
|
|
23
|
-
**Yes!** Lynkr is designed as a drop-in replacement for Anthropic's backend. Simply set `ANTHROPIC_BASE_URL` to point to your Lynkr server:
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
export ANTHROPIC_BASE_URL=http://localhost:8081
|
|
27
|
-
export ANTHROPIC_API_KEY=dummy # Required by CLI, but ignored by Lynkr
|
|
28
|
-
claude "Your prompt here"
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
All Claude Code CLI features work through Lynkr.
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
### Does Lynkr work with Cursor IDE?
|
|
36
|
-
|
|
37
|
-
**Yes!** Lynkr provides OpenAI-compatible endpoints that work with Cursor:
|
|
38
|
-
|
|
39
|
-
1. Start Lynkr: `lynkr start`
|
|
40
|
-
2. Configure Cursor Settings → Models:
|
|
41
|
-
- **API Key:** `sk-lynkr` (any non-empty value)
|
|
42
|
-
- **Base URL:** `http://localhost:8081/v1`
|
|
43
|
-
- **Model:** Your provider's model (e.g., `claude-3.5-sonnet`)
|
|
44
|
-
|
|
45
|
-
All Cursor features work: chat (`Cmd+L`), inline edits (`Cmd+K`), and @Codebase search (with embeddings).
|
|
46
|
-
|
|
47
|
-
See [Cursor Integration Guide](cursor-integration.md) for details.
|
|
48
|
-
|
|
49
|
-
---
|
|
50
|
-
|
|
51
|
-
### How much does Lynkr cost?
|
|
52
|
-
|
|
53
|
-
Lynkr itself is **100% FREE** and open source (Apache 2.0 license).
|
|
54
|
-
|
|
55
|
-
**Costs depend on your provider:**
|
|
56
|
-
- **Ollama/llama.cpp**: 100% FREE (runs on your hardware)
|
|
57
|
-
- **OpenRouter**: ~$5-10/month (100+ models)
|
|
58
|
-
- **AWS Bedrock**: ~$10-20/month (100+ models)
|
|
59
|
-
- **Databricks**: Enterprise pricing (contact Databricks)
|
|
60
|
-
- **Azure/OpenAI**: Standard provider pricing
|
|
61
|
-
|
|
62
|
-
**With token optimization**, Lynkr reduces provider costs by **60-80%** through smart tool selection, prompt caching, and memory deduplication.
|
|
63
|
-
|
|
64
|
-
---
|
|
65
|
-
|
|
66
|
-
### What's the difference between Lynkr and native Claude Code?
|
|
67
|
-
|
|
68
|
-
| Feature | Native Claude Code | Lynkr |
|
|
69
|
-
|---------|-------------------|-------|
|
|
70
|
-
| **Providers** | Anthropic only | 12+ providers |
|
|
71
|
-
| **Cost** | Full Anthropic pricing | 60-80% cheaper |
|
|
72
|
-
| **Local models** | ❌ Cloud-only | ✅ Ollama, llama.cpp |
|
|
73
|
-
| **Privacy** | ☁️ Cloud | 🔒 Can run 100% locally |
|
|
74
|
-
| **Token optimization** | ❌ None | ✅ 6 optimization phases |
|
|
75
|
-
| **MCP support** | Limited | ✅ Full orchestration |
|
|
76
|
-
| **Enterprise features** | Limited | ✅ Circuit breakers, metrics, K8s-ready |
|
|
77
|
-
| **Cost transparency** | Hidden | ✅ Full tracking |
|
|
78
|
-
| **License** | Proprietary | ✅ Apache 2.0 (open source) |
|
|
79
|
-
|
|
80
|
-
---
|
|
81
|
-
|
|
82
|
-
## Installation & Setup
|
|
83
|
-
|
|
84
|
-
### How do I install Lynkr?
|
|
85
|
-
|
|
86
|
-
**Option 1: NPM (Recommended)**
|
|
87
|
-
```bash
|
|
88
|
-
npm install -g lynkr
|
|
89
|
-
lynkr start
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
**Option 2: Homebrew (macOS)**
|
|
93
|
-
```bash
|
|
94
|
-
brew tap vishalveerareddy123/lynkr
|
|
95
|
-
brew install lynkr
|
|
96
|
-
lynkr start
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
**Option 3: Git Clone**
|
|
100
|
-
```bash
|
|
101
|
-
git clone https://github.com/vishalveerareddy123/Lynkr.git
|
|
102
|
-
cd Lynkr && npm install && npm start
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
See [Installation Guide](installation.md) for all methods.
|
|
106
|
-
|
|
107
|
-
---
|
|
108
|
-
|
|
109
|
-
### Which provider should I use?
|
|
110
|
-
|
|
111
|
-
**Depends on your priorities:**
|
|
112
|
-
|
|
113
|
-
**For Privacy (100% Local, FREE):**
|
|
114
|
-
- ✅ **Ollama** - Easy setup, 100% private
|
|
115
|
-
- ✅ **llama.cpp** - Maximum performance, GGUF models
|
|
116
|
-
- **Setup:** 5-15 minutes
|
|
117
|
-
- **Cost:** $0 (runs on your hardware)
|
|
118
|
-
|
|
119
|
-
**For Simplicity (Easiest Cloud):**
|
|
120
|
-
- ✅ **OpenRouter** - One key for 100+ models
|
|
121
|
-
- **Setup:** 2 minutes
|
|
122
|
-
- **Cost:** ~$5-10/month
|
|
123
|
-
|
|
124
|
-
**For AWS Ecosystem:**
|
|
125
|
-
- ✅ **AWS Bedrock** - 100+ models, Claude + alternatives
|
|
126
|
-
- **Setup:** 5 minutes
|
|
127
|
-
- **Cost:** ~$10-20/month
|
|
128
|
-
|
|
129
|
-
**For Affordable Cloud + Reasoning:**
|
|
130
|
-
- ✅ **Moonshot AI** - Kimi K2, thinking models
|
|
131
|
-
- **Setup:** 2 minutes
|
|
132
|
-
- **Cost:** ~$5-10/month
|
|
133
|
-
|
|
134
|
-
**For Enterprise:**
|
|
135
|
-
- ✅ **Databricks** - Claude 4.5, enterprise SLA
|
|
136
|
-
- **Setup:** 10 minutes
|
|
137
|
-
- **Cost:** Enterprise pricing
|
|
138
|
-
|
|
139
|
-
See [Provider Configuration Guide](providers.md) for detailed comparison.
|
|
140
|
-
|
|
141
|
-
---
|
|
142
|
-
|
|
143
|
-
### Can I use multiple providers?
|
|
144
|
-
|
|
145
|
-
**Yes!** Lynkr supports tier-based routing:
|
|
146
|
-
|
|
147
|
-
```bash
|
|
148
|
-
# Set all 4 TIER_* env vars to enable tier-based routing
|
|
149
|
-
export TIER_SIMPLE=ollama:llama3.2
|
|
150
|
-
export TIER_MEDIUM=openrouter:openai/gpt-4o-mini
|
|
151
|
-
export TIER_COMPLEX=azure-openai:gpt-4o
|
|
152
|
-
export TIER_REASONING=azure-openai:gpt-4o
|
|
153
|
-
export FALLBACK_ENABLED=true
|
|
154
|
-
export FALLBACK_PROVIDER=databricks
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
**How it works:**
|
|
158
|
-
- Each request is scored for complexity (0-100) and mapped to a tier
|
|
159
|
-
- **SIMPLE (0-25)**: Ollama (free, local, fast) or Moonshot (affordable cloud)
|
|
160
|
-
- **MEDIUM (26-50)**: OpenRouter or mid-range cloud model
|
|
161
|
-
- **COMPLEX (51-75)**: Capable cloud models
|
|
162
|
-
- **REASONING (76-100)**: Best available models
|
|
163
|
-
- **Provider failures**: Automatic transparent fallback
|
|
164
|
-
|
|
165
|
-
**Cost savings:** 65-100% for requests routed to local/cheap models.
|
|
166
|
-
|
|
167
|
-
---
|
|
168
|
-
|
|
169
|
-
### What is MODEL_PROVIDER and do I still need it?
|
|
170
|
-
|
|
171
|
-
`MODEL_PROVIDER` sets a single static provider for all requests. When you set `MODEL_PROVIDER=ollama`, every request goes to Ollama regardless of complexity.
|
|
172
|
-
|
|
173
|
-
**With TIER_\* vars configured:** `MODEL_PROVIDER` is not used for routing — the tier system picks the provider per-request. However, `MODEL_PROVIDER` is still read for startup checks (e.g. waiting for Ollama) and as a fallback default in edge cases. Keep it set to your most-used provider.
|
|
174
|
-
|
|
175
|
-
**Without TIER_\* vars:** `MODEL_PROVIDER` is the only thing that controls where requests go.
|
|
176
|
-
|
|
177
|
-
---
|
|
178
|
-
|
|
179
|
-
### How do MODEL_PROVIDER and TIER_\* work together?
|
|
180
|
-
|
|
181
|
-
They are two separate routing modes:
|
|
182
|
-
|
|
183
|
-
| Scenario | What happens |
|
|
184
|
-
|----------|-------------|
|
|
185
|
-
| `MODEL_PROVIDER` only | Static routing — all requests go to that provider |
|
|
186
|
-
| All 4 `TIER_*` set | Tier routing — TIER_\* **overrides** MODEL_PROVIDER for routing |
|
|
187
|
-
| Only 1-3 `TIER_*` set | Tier routing disabled — falls back to `MODEL_PROVIDER` |
|
|
188
|
-
| Both set | TIER_\* takes priority for routing; MODEL_PROVIDER is kept as a config default |
|
|
189
|
-
|
|
190
|
-
**Example:** If you have `MODEL_PROVIDER=ollama` and `TIER_COMPLEX=databricks:claude-sonnet`, complex requests go to Databricks even though MODEL_PROVIDER says ollama.
|
|
191
|
-
|
|
192
|
-
---
|
|
193
|
-
|
|
194
|
-
### What happens if I only set some TIER_\* vars?
|
|
195
|
-
|
|
196
|
-
All 4 must be set (`TIER_SIMPLE`, `TIER_MEDIUM`, `TIER_COMPLEX`, `TIER_REASONING`) for tier routing to activate. If any are missing, tier routing is disabled entirely and `MODEL_PROVIDER` is used for all requests.
|
|
197
|
-
|
|
198
|
-
This is intentional — partial tier config could lead to unexpected gaps where some complexity levels have no provider assigned.
|
|
199
|
-
|
|
200
|
-
---
|
|
201
|
-
|
|
202
|
-
### What is FALLBACK_PROVIDER?
|
|
203
|
-
|
|
204
|
-
The fallback provider is a safety net for when the tier-selected provider fails (timeout, connection refused, rate limit). If `FALLBACK_ENABLED=true` and the primary provider for a request fails, Lynkr retries the request against `FALLBACK_PROVIDER` transparently.
|
|
205
|
-
|
|
206
|
-
- Only triggers when tier routing is active
|
|
207
|
-
- Cannot be a local provider (ollama, llamacpp, lmstudio) — use cloud providers
|
|
208
|
-
- Defaults to `databricks`
|
|
209
|
-
- If you don't have cloud credentials, set `FALLBACK_ENABLED=false`
|
|
210
|
-
|
|
211
|
-
---
|
|
212
|
-
|
|
213
|
-
## Provider-Specific Questions
|
|
214
|
-
|
|
215
|
-
### Can I use Ollama models with Lynkr and Cursor?
|
|
216
|
-
|
|
217
|
-
**Yes!** Ollama works for both chat AND embeddings (100% local, FREE):
|
|
218
|
-
|
|
219
|
-
**Chat setup:**
|
|
220
|
-
```bash
|
|
221
|
-
export MODEL_PROVIDER=ollama
|
|
222
|
-
export OLLAMA_MODEL=llama3.1:8b # or qwen2.5-coder, mistral, etc.
|
|
223
|
-
lynkr start
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
**Embeddings setup (for @Codebase):**
|
|
227
|
-
```bash
|
|
228
|
-
ollama pull nomic-embed-text
|
|
229
|
-
export OLLAMA_EMBEDDINGS_MODEL=nomic-embed-text
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
**Recommended models:**
|
|
233
|
-
- **Chat**: `llama3.1:8b` - Good balance, tool calling supported
|
|
234
|
-
- **Chat**: `qwen2.5:14b` - Better reasoning (7b struggles with tools)
|
|
235
|
-
- **Embeddings**: `nomic-embed-text` (137M) - Best all-around
|
|
236
|
-
|
|
237
|
-
**100% local, 100% private, 100% FREE!** 🔒
|
|
238
|
-
|
|
239
|
-
---
|
|
240
|
-
|
|
241
|
-
### How do I enable @Codebase search in Cursor with Lynkr?
|
|
242
|
-
|
|
243
|
-
@Codebase semantic search requires embeddings. Choose ONE option:
|
|
244
|
-
|
|
245
|
-
**Option 1: Ollama (100% Local, FREE)** 🔒
|
|
246
|
-
```bash
|
|
247
|
-
ollama pull nomic-embed-text
|
|
248
|
-
export OLLAMA_EMBEDDINGS_MODEL=nomic-embed-text
|
|
249
|
-
```
|
|
250
|
-
|
|
251
|
-
**Option 2: llama.cpp (100% Local, FREE)** 🔒
|
|
252
|
-
```bash
|
|
253
|
-
./llama-server -m nomic-embed-text.gguf --port 8080 --embedding
|
|
254
|
-
export LLAMACPP_EMBEDDINGS_ENDPOINT=http://localhost:8080/embeddings
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
**Option 3: OpenRouter (Cloud, ~$0.01-0.10/month)**
|
|
258
|
-
```bash
|
|
259
|
-
export OPENROUTER_API_KEY=sk-or-v1-your-key
|
|
260
|
-
# Works automatically if you're already using OpenRouter for chat!
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
**Option 4: OpenAI (Cloud, ~$0.01-0.10/month)**
|
|
264
|
-
```bash
|
|
265
|
-
export OPENAI_API_KEY=sk-your-key
|
|
266
|
-
```
|
|
267
|
-
|
|
268
|
-
**After configuring, restart Lynkr.** @Codebase will then work in Cursor!
|
|
269
|
-
|
|
270
|
-
See [Embeddings Guide](embeddings.md) for details.
|
|
271
|
-
|
|
272
|
-
---
|
|
273
|
-
|
|
274
|
-
### What are the performance differences between providers?
|
|
275
|
-
|
|
276
|
-
| Provider | Latency | Cost | Tool Support | Best For |
|
|
277
|
-
|----------|---------|------|--------------|----------|
|
|
278
|
-
| **Ollama** | 100-500ms | **FREE** | Good | Local, privacy, offline |
|
|
279
|
-
| **llama.cpp** | 50-300ms | **FREE** | Good | Performance, GPU |
|
|
280
|
-
| **OpenRouter** | 500ms-2s | $-$$ | Excellent | Flexibility, 100+ models |
|
|
281
|
-
| **Databricks/Azure** | 500ms-2s | $$$ | Excellent | Enterprise, Claude 4.5 |
|
|
282
|
-
| **AWS Bedrock** | 500ms-2s | $-$$$ | Excellent* | AWS, 100+ models |
|
|
283
|
-
| **Moonshot AI** | 500ms-2s | $ | Good | Affordable, thinking models |
|
|
284
|
-
| **OpenAI** | 500ms-2s | $$ | Excellent | GPT-4o, o1, o3 |
|
|
285
|
-
|
|
286
|
-
_* Tool calling only supported by Claude models on Bedrock_
|
|
287
|
-
|
|
288
|
-
---
|
|
289
|
-
|
|
290
|
-
### Does AWS Bedrock support tool calling?
|
|
291
|
-
|
|
292
|
-
**Only Claude models support tool calling on Bedrock.**
|
|
293
|
-
|
|
294
|
-
✅ **Supported (with tools):**
|
|
295
|
-
- `anthropic.claude-3-5-sonnet-20241022-v2:0`
|
|
296
|
-
- `anthropic.claude-3-opus-20240229-v1:0`
|
|
297
|
-
- `us.anthropic.claude-sonnet-4-5-20250929-v1:0`
|
|
298
|
-
|
|
299
|
-
❌ **Not supported (no tools):**
|
|
300
|
-
- Amazon Titan models
|
|
301
|
-
- Meta Llama models
|
|
302
|
-
- Mistral models
|
|
303
|
-
- Cohere models
|
|
304
|
-
- AI21 models
|
|
305
|
-
|
|
306
|
-
Other models work via Converse API but won't use Read/Write/Bash tools.
|
|
307
|
-
|
|
308
|
-
See [BEDROCK_MODELS.md](../BEDROCK_MODELS.md) for complete model catalog.
|
|
309
|
-
|
|
310
|
-
---
|
|
311
|
-
|
|
312
|
-
## Features & Capabilities
|
|
313
|
-
|
|
314
|
-
### What is token optimization and how does it save costs?
|
|
315
|
-
|
|
316
|
-
Lynkr includes **6 token optimization phases** that reduce costs by **60-80%**:
|
|
317
|
-
|
|
318
|
-
1. **Smart Tool Selection** (50-70% reduction)
|
|
319
|
-
- Filters tools based on request type
|
|
320
|
-
- Only sends relevant tools to model
|
|
321
|
-
- Example: Chat query doesn't need git tools
|
|
322
|
-
|
|
323
|
-
2. **Prompt Caching** (30-45% reduction)
|
|
324
|
-
- Caches repeated prompts
|
|
325
|
-
- Reuses system prompts
|
|
326
|
-
- Reduces redundant token usage
|
|
327
|
-
|
|
328
|
-
3. **Memory Deduplication** (20-30% reduction)
|
|
329
|
-
- Removes duplicate memories
|
|
330
|
-
- Compresses conversation history
|
|
331
|
-
- Eliminates redundant context
|
|
332
|
-
|
|
333
|
-
4. **Tool Response Truncation** (15-25% reduction)
|
|
334
|
-
- Truncates long tool outputs
|
|
335
|
-
- Keeps only relevant portions
|
|
336
|
-
- Reduces tool result tokens
|
|
337
|
-
|
|
338
|
-
5. **Dynamic System Prompts** (10-20% reduction)
|
|
339
|
-
- Adapts prompts to request type
|
|
340
|
-
- Shorter prompts for simple queries
|
|
341
|
-
- Longer prompts only when needed
|
|
342
|
-
|
|
343
|
-
6. **Conversation Compression** (15-25% reduction)
|
|
344
|
-
- Summarizes old messages
|
|
345
|
-
- Keeps recent context full
|
|
346
|
-
- Compresses historical turns
|
|
347
|
-
|
|
348
|
-
**At 100k requests/month, this translates to $6,400-9,600/month savings ($77k-115k/year).**
|
|
349
|
-
|
|
350
|
-
See [Token Optimization Guide](token-optimization.md) for details.
|
|
351
|
-
|
|
352
|
-
---
|
|
353
|
-
|
|
354
|
-
### What is the memory system?
|
|
355
|
-
|
|
356
|
-
Lynkr includes a **Titans-inspired long-term memory system** that remembers important context across conversations:
|
|
357
|
-
|
|
358
|
-
**Key features:**
|
|
359
|
-
- 🧠 **Surprise-Based Updates** - Only stores novel, important information
|
|
360
|
-
- 🔍 **Semantic Search** - Full-text search with Porter stemmer
|
|
361
|
-
- 📊 **Multi-Signal Retrieval** - Ranks by recency, importance, relevance
|
|
362
|
-
- ⚡ **Automatic Integration** - Zero latency overhead (<50ms retrieval)
|
|
363
|
-
- 🛠️ **Management Tools** - `memory_search`, `memory_add`, `memory_forget`
|
|
364
|
-
|
|
365
|
-
**What gets remembered:**
|
|
366
|
-
- ✅ User preferences ("I prefer Python")
|
|
367
|
-
- ✅ Important decisions ("Decided to use React")
|
|
368
|
-
- ✅ Project facts ("This app uses PostgreSQL")
|
|
369
|
-
- ✅ New entities (first mention of files, functions)
|
|
370
|
-
- ❌ Greetings, confirmations, repeated info
|
|
371
|
-
|
|
372
|
-
**Configuration:**
|
|
373
|
-
```bash
|
|
374
|
-
export MEMORY_ENABLED=true # Enable/disable
|
|
375
|
-
export MEMORY_RETRIEVAL_LIMIT=5 # Memories per request
|
|
376
|
-
export MEMORY_SURPRISE_THRESHOLD=0.3 # Min score to store
|
|
377
|
-
```
|
|
378
|
-
|
|
379
|
-
See [Memory System Guide](memory-system.md) for details.
|
|
380
|
-
|
|
381
|
-
---
|
|
382
|
-
|
|
383
|
-
### What are tool execution modes?
|
|
384
|
-
|
|
385
|
-
Lynkr supports two tool execution modes:
|
|
386
|
-
|
|
387
|
-
**Server Mode (Default)**
|
|
388
|
-
```bash
|
|
389
|
-
export TOOL_EXECUTION_MODE=server
|
|
390
|
-
```
|
|
391
|
-
- Tools run on the machine running Lynkr
|
|
392
|
-
- Good for: Standalone proxy, shared team server
|
|
393
|
-
- File operations access server filesystem
|
|
394
|
-
|
|
395
|
-
**Client Mode (Passthrough)**
|
|
396
|
-
```bash
|
|
397
|
-
export TOOL_EXECUTION_MODE=client
|
|
398
|
-
```
|
|
399
|
-
- Tools run on Claude Code CLI side (your local machine)
|
|
400
|
-
- Good for: Local development, accessing local files
|
|
401
|
-
- Full integration with local environment
|
|
402
|
-
|
|
403
|
-
---
|
|
404
|
-
|
|
405
|
-
### Does Lynkr support MCP (Model Context Protocol)?
|
|
406
|
-
|
|
407
|
-
**Yes!** Lynkr includes full MCP orchestration:
|
|
408
|
-
|
|
409
|
-
- 🔍 **Automatic Discovery** - Scans `~/.claude/mcp` for manifests
|
|
410
|
-
- 🚀 **JSON-RPC 2.0 Client** - Communicates with MCP servers
|
|
411
|
-
- 🛠️ **Dynamic Tool Registration** - Exposes MCP tools in proxy
|
|
412
|
-
- 🔒 **Docker Sandbox** - Optional container isolation
|
|
413
|
-
|
|
414
|
-
**Configuration:**
|
|
415
|
-
```bash
|
|
416
|
-
export MCP_MANIFEST_DIRS=~/.claude/mcp
|
|
417
|
-
export MCP_SANDBOX_ENABLED=true
|
|
418
|
-
```
|
|
419
|
-
|
|
420
|
-
MCP tools integrate seamlessly with Claude Code CLI and Cursor.
|
|
421
|
-
|
|
422
|
-
---
|
|
423
|
-
|
|
424
|
-
## Deployment & Production
|
|
425
|
-
|
|
426
|
-
### Can I deploy Lynkr to production?
|
|
427
|
-
|
|
428
|
-
**Yes!** Lynkr includes 14 production-hardening features:
|
|
429
|
-
|
|
430
|
-
- **Reliability:** Circuit breakers, exponential backoff, load shedding
|
|
431
|
-
- **Observability:** Prometheus metrics, structured logging, health checks
|
|
432
|
-
- **Security:** Input validation, policy enforcement, sandboxing
|
|
433
|
-
- **Performance:** Prompt caching, token optimization, connection pooling
|
|
434
|
-
- **Deployment:** Kubernetes-ready health checks, graceful shutdown, Docker support
|
|
435
|
-
|
|
436
|
-
See [Production Hardening Guide](production.md) for details.
|
|
437
|
-
|
|
438
|
-
---
|
|
439
|
-
|
|
440
|
-
### How do I deploy with Docker?
|
|
441
|
-
|
|
442
|
-
**docker-compose (Recommended):**
|
|
443
|
-
```bash
|
|
444
|
-
git clone https://github.com/vishalveerareddy123/Lynkr.git
|
|
445
|
-
cd Lynkr
|
|
446
|
-
cp .env.example .env
|
|
447
|
-
# Edit .env with your credentials
|
|
448
|
-
docker-compose up -d
|
|
449
|
-
```
|
|
450
|
-
|
|
451
|
-
**Standalone Docker:**
|
|
452
|
-
```bash
|
|
453
|
-
docker build -t lynkr .
|
|
454
|
-
docker run -d -p 8081:8081 -e MODEL_PROVIDER=databricks -e DATABRICKS_API_KEY=your-key lynkr
|
|
455
|
-
```
|
|
456
|
-
|
|
457
|
-
See [Docker Deployment Guide](docker.md) for advanced options (GPU, K8s, volumes).
|
|
458
|
-
|
|
459
|
-
---
|
|
460
|
-
|
|
461
|
-
### What metrics does Lynkr collect?
|
|
462
|
-
|
|
463
|
-
Lynkr collects comprehensive metrics in Prometheus format:
|
|
464
|
-
|
|
465
|
-
**Request Metrics:**
|
|
466
|
-
- Request rate (requests/sec)
|
|
467
|
-
- Latency percentiles (p50, p95, p99)
|
|
468
|
-
- Error rate and types
|
|
469
|
-
- Status code distribution
|
|
470
|
-
|
|
471
|
-
**Token Metrics:**
|
|
472
|
-
- Token usage per request
|
|
473
|
-
- Token cost per request
|
|
474
|
-
- Cumulative token usage
|
|
475
|
-
- Cache hit rate
|
|
476
|
-
|
|
477
|
-
**System Metrics:**
|
|
478
|
-
- Memory usage
|
|
479
|
-
- CPU usage
|
|
480
|
-
- Active connections
|
|
481
|
-
- Circuit breaker state
|
|
482
|
-
|
|
483
|
-
**Access metrics:**
|
|
484
|
-
```bash
|
|
485
|
-
curl http://localhost:8081/metrics
|
|
486
|
-
# Returns Prometheus-format metrics
|
|
487
|
-
```
|
|
488
|
-
|
|
489
|
-
See [Production Guide](production.md) for metrics configuration.
|
|
490
|
-
|
|
491
|
-
---
|
|
492
|
-
|
|
493
|
-
## Troubleshooting
|
|
494
|
-
|
|
495
|
-
### Lynkr won't start - what should I check?
|
|
496
|
-
|
|
497
|
-
1. **Missing credentials:**
|
|
498
|
-
```bash
|
|
499
|
-
echo $MODEL_PROVIDER
|
|
500
|
-
echo $DATABRICKS_API_KEY # or other provider key
|
|
501
|
-
```
|
|
502
|
-
|
|
503
|
-
2. **Port already in use:**
|
|
504
|
-
```bash
|
|
505
|
-
lsof -i :8081
|
|
506
|
-
kill -9 <PID>
|
|
507
|
-
# Or use different port: export PORT=8082
|
|
508
|
-
```
|
|
509
|
-
|
|
510
|
-
3. **Missing dependencies:**
|
|
511
|
-
```bash
|
|
512
|
-
npm install
|
|
513
|
-
# Or: npm install -g lynkr --force
|
|
514
|
-
```
|
|
515
|
-
|
|
516
|
-
See [Troubleshooting Guide](troubleshooting.md) for more issues.
|
|
517
|
-
|
|
518
|
-
---
|
|
519
|
-
|
|
520
|
-
### Why is my first request slow?
|
|
521
|
-
|
|
522
|
-
**This is normal:**
|
|
523
|
-
- **Ollama/llama.cpp:** Model loading (1-5 seconds)
|
|
524
|
-
- **Cloud providers:** Cold start (2-5 seconds)
|
|
525
|
-
- **Subsequent requests are fast**
|
|
526
|
-
|
|
527
|
-
**Solutions:**
|
|
528
|
-
|
|
529
|
-
1. **Keep Ollama running:**
|
|
530
|
-
```bash
|
|
531
|
-
ollama serve # Keep running in background
|
|
532
|
-
```
|
|
533
|
-
|
|
534
|
-
2. **Warm up after startup:**
|
|
535
|
-
```bash
|
|
536
|
-
curl http://localhost:8081/health/ready?deep=true
|
|
537
|
-
```
|
|
538
|
-
|
|
539
|
-
---
|
|
540
|
-
|
|
541
|
-
### How do I enable debug logging?
|
|
542
|
-
|
|
543
|
-
```bash
|
|
544
|
-
export LOG_LEVEL=debug
|
|
545
|
-
lynkr start
|
|
546
|
-
|
|
547
|
-
# Check logs for detailed request/response info
|
|
548
|
-
```
|
|
549
|
-
|
|
550
|
-
---
|
|
551
|
-
|
|
552
|
-
## Cost & Pricing
|
|
553
|
-
|
|
554
|
-
### How much can I save with Lynkr?
|
|
555
|
-
|
|
556
|
-
**Scenario:** 100,000 requests/month, average 50k input tokens, 2k output tokens
|
|
557
|
-
|
|
558
|
-
| Provider | Without Lynkr | With Lynkr (60% savings) | Monthly Savings |
|
|
559
|
-
|----------|---------------|-------------------------|-----------------|
|
|
560
|
-
| **Claude Sonnet 4.5** | $16,000 | $6,400 | **$9,600** |
|
|
561
|
-
| **GPT-4o** | $12,000 | $4,800 | **$7,200** |
|
|
562
|
-
| **Ollama (Local)** | API costs | $0 | **$12,000+** |
|
|
563
|
-
|
|
564
|
-
**ROI:** $77k-115k/year in savings.
|
|
565
|
-
|
|
566
|
-
**Token optimization breakdown:**
|
|
567
|
-
- Smart tool selection: 50-70% reduction
|
|
568
|
-
- Prompt caching: 30-45% reduction
|
|
569
|
-
- Memory deduplication: 20-30% reduction
|
|
570
|
-
- Tool truncation: 15-25% reduction
|
|
571
|
-
|
|
572
|
-
---
|
|
573
|
-
|
|
574
|
-
### What's the cheapest setup?
|
|
575
|
-
|
|
576
|
-
**100% FREE Setup:**
|
|
577
|
-
```bash
|
|
578
|
-
# Chat: Ollama (local, free)
|
|
579
|
-
export MODEL_PROVIDER=ollama
|
|
580
|
-
export OLLAMA_MODEL=llama3.1:8b
|
|
581
|
-
|
|
582
|
-
# Embeddings: Ollama (local, free)
|
|
583
|
-
export OLLAMA_EMBEDDINGS_MODEL=nomic-embed-text
|
|
584
|
-
```
|
|
585
|
-
|
|
586
|
-
**Total cost: $0/month** 🔒
|
|
587
|
-
- 100% private (all data stays on your machine)
|
|
588
|
-
- Works offline
|
|
589
|
-
- Full Claude Code CLI + Cursor support
|
|
590
|
-
|
|
591
|
-
**Hardware requirements:**
|
|
592
|
-
- 8GB+ RAM for 7-8B models
|
|
593
|
-
- 16GB+ RAM for 14B models
|
|
594
|
-
- Optional: GPU for faster inference
|
|
595
|
-
|
|
596
|
-
---
|
|
597
|
-
|
|
598
|
-
## Security & Privacy
|
|
599
|
-
|
|
600
|
-
### Is Lynkr secure for production use?
|
|
601
|
-
|
|
602
|
-
**Yes!** Lynkr includes multiple security features:
|
|
603
|
-
|
|
604
|
-
- **Input Validation:** Zero-dependency schema validation
|
|
605
|
-
- **Policy Enforcement:** Git, test, web fetch policies
|
|
606
|
-
- **Sandboxing:** Optional Docker isolation for MCP tools
|
|
607
|
-
- **Authentication:** API key support (provider-level)
|
|
608
|
-
- **Rate Limiting:** Load shedding during overload
|
|
609
|
-
- **Logging:** Structured logs with request ID correlation
|
|
610
|
-
|
|
611
|
-
**Best practices:**
|
|
612
|
-
- Run behind reverse proxy (nginx, Caddy)
|
|
613
|
-
- Use HTTPS for external access
|
|
614
|
-
- Rotate API keys regularly
|
|
615
|
-
- Enable policy restrictions
|
|
616
|
-
- Monitor metrics and logs
|
|
617
|
-
|
|
618
|
-
---
|
|
619
|
-
|
|
620
|
-
### Can I run Lynkr completely offline?
|
|
621
|
-
|
|
622
|
-
**Yes!** Use local providers:
|
|
623
|
-
|
|
624
|
-
**Option 1: Ollama**
|
|
625
|
-
```bash
|
|
626
|
-
export MODEL_PROVIDER=ollama
|
|
627
|
-
export OLLAMA_MODEL=llama3.1:8b
|
|
628
|
-
export OLLAMA_EMBEDDINGS_MODEL=nomic-embed-text
|
|
629
|
-
```
|
|
630
|
-
|
|
631
|
-
**Option 2: llama.cpp**
|
|
632
|
-
```bash
|
|
633
|
-
export MODEL_PROVIDER=llamacpp
|
|
634
|
-
export LLAMACPP_ENDPOINT=http://localhost:8080
|
|
635
|
-
export LLAMACPP_EMBEDDINGS_ENDPOINT=http://localhost:8080/embeddings
|
|
636
|
-
```
|
|
637
|
-
|
|
638
|
-
**Result:**
|
|
639
|
-
- ✅ Zero internet required
|
|
640
|
-
- ✅ 100% private (all data stays local)
|
|
641
|
-
- ✅ Works in air-gapped environments
|
|
642
|
-
- ✅ Full Claude Code CLI + Cursor support
|
|
643
|
-
|
|
644
|
-
---
|
|
645
|
-
|
|
646
|
-
### Where is my data stored?
|
|
647
|
-
|
|
648
|
-
**Local data (on machine running Lynkr):**
|
|
649
|
-
- **SQLite databases:** `data/` directory
|
|
650
|
-
- `memories.db` - Long-term memories
|
|
651
|
-
- `sessions.db` - Conversation history
|
|
652
|
-
- `workspace-index.db` - Workspace metadata
|
|
653
|
-
- **Configuration:** `.env` file
|
|
654
|
-
- **Logs:** stdout (or log file if configured)
|
|
655
|
-
|
|
656
|
-
**Provider data:**
|
|
657
|
-
- **Cloud providers:** Sent to provider (Databricks, Bedrock, OpenRouter, etc.)
|
|
658
|
-
- **Local providers:** Stays on your machine (Ollama, llama.cpp)
|
|
659
|
-
|
|
660
|
-
**Privacy recommendation:**
|
|
661
|
-
Use Ollama or llama.cpp for 100% local, private operation.
|
|
662
|
-
|
|
663
|
-
---
|
|
664
|
-
|
|
665
|
-
## Getting Help
|
|
666
|
-
|
|
667
|
-
### Where can I get help?
|
|
668
|
-
|
|
669
|
-
- **[Troubleshooting Guide](troubleshooting.md)** - Common issues and solutions
|
|
670
|
-
- **[GitHub Discussions](https://github.com/vishalveerareddy123/Lynkr/discussions)** - Community Q&A
|
|
671
|
-
- **[GitHub Issues](https://github.com/vishalveerareddy123/Lynkr/issues)** - Report bugs
|
|
672
|
-
- **[Documentation](README.md)** - Complete guides
|
|
673
|
-
|
|
674
|
-
### How do I report a bug?
|
|
675
|
-
|
|
676
|
-
1. Check [GitHub Issues](https://github.com/vishalveerareddy123/Lynkr/issues) for existing reports
|
|
677
|
-
2. If new, create an issue with:
|
|
678
|
-
- Lynkr version
|
|
679
|
-
- Provider being used
|
|
680
|
-
- Full error message
|
|
681
|
-
- Steps to reproduce
|
|
682
|
-
- Debug logs (with `LOG_LEVEL=debug`)
|
|
683
|
-
|
|
684
|
-
### How can I contribute?
|
|
685
|
-
|
|
686
|
-
See [Contributing Guide](contributing.md) for:
|
|
687
|
-
- Code contributions
|
|
688
|
-
- Documentation improvements
|
|
689
|
-
- Bug reports
|
|
690
|
-
- Feature requests
|
|
691
|
-
|
|
692
|
-
---
|
|
693
|
-
|
|
694
|
-
## License
|
|
695
|
-
|
|
696
|
-
### What license is Lynkr under?
|
|
697
|
-
|
|
698
|
-
**Apache 2.0** - Free and open source.
|
|
699
|
-
|
|
700
|
-
You can:
|
|
701
|
-
- ✅ Use commercially
|
|
702
|
-
- ✅ Modify the code
|
|
703
|
-
- ✅ Distribute
|
|
704
|
-
- ✅ Sublicense
|
|
705
|
-
- ✅ Use privately
|
|
706
|
-
|
|
707
|
-
**No restrictions for:**
|
|
708
|
-
- Personal use
|
|
709
|
-
- Commercial use
|
|
710
|
-
- Internal company use
|
|
711
|
-
- Redistribution
|
|
712
|
-
|
|
713
|
-
See [LICENSE](../LICENSE) file for details.
|