lynkr 9.2.0 → 9.2.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/README.md +249 -25
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -27,48 +27,102 @@
|
|
|
27
27
|
npm install -g lynkr
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
### 2.
|
|
30
|
+
### 2. Configure Lynkr
|
|
31
|
+
|
|
32
|
+
First run creates a `.env` file. Edit it with your provider settings.
|
|
33
|
+
|
|
34
|
+
**Option A: Free & Local (Ollama) - Recommended for Testing**
|
|
31
35
|
|
|
32
|
-
**Option A: Free & Local (Ollama)**
|
|
33
36
|
```bash
|
|
34
37
|
# Install Ollama first: https://ollama.com
|
|
35
38
|
ollama pull qwen2.5-coder:latest
|
|
36
|
-
|
|
37
|
-
# Start Lynkr
|
|
38
|
-
lynkr start
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
Create/edit `.env` in your project directory:
|
|
42
42
|
```bash
|
|
43
|
+
# Provider
|
|
43
44
|
MODEL_PROVIDER=ollama
|
|
44
45
|
FALLBACK_ENABLED=false
|
|
46
|
+
|
|
47
|
+
# Ollama Configuration
|
|
48
|
+
OLLAMA_ENDPOINT=http://localhost:11434
|
|
45
49
|
OLLAMA_MODEL=qwen2.5-coder:latest
|
|
50
|
+
|
|
51
|
+
# Server
|
|
52
|
+
PORT=8081
|
|
53
|
+
|
|
54
|
+
# Increase limits for Claude Code/Cursor
|
|
55
|
+
POLICY_MAX_STEPS=50
|
|
56
|
+
POLICY_MAX_TOOL_CALLS=100
|
|
57
|
+
|
|
58
|
+
# Disable overly strict command filtering
|
|
59
|
+
POLICY_SAFE_COMMANDS_ENABLED=false
|
|
46
60
|
```
|
|
47
61
|
|
|
48
|
-
**Option B: Cloud
|
|
62
|
+
**Option B: Cloud (OpenRouter) - Recommended for Production**
|
|
63
|
+
|
|
49
64
|
```bash
|
|
50
65
|
# Get API key from https://openrouter.ai
|
|
51
|
-
lynkr start
|
|
52
66
|
```
|
|
53
67
|
|
|
54
|
-
|
|
68
|
+
Create/edit `.env`:
|
|
55
69
|
```bash
|
|
70
|
+
# Provider
|
|
56
71
|
MODEL_PROVIDER=openrouter
|
|
57
72
|
OPENROUTER_API_KEY=sk-or-v1-your-key-here
|
|
58
73
|
FALLBACK_ENABLED=false
|
|
74
|
+
|
|
75
|
+
# Server
|
|
76
|
+
PORT=8081
|
|
77
|
+
|
|
78
|
+
# Increase limits
|
|
79
|
+
POLICY_MAX_STEPS=50
|
|
80
|
+
POLICY_MAX_TOOL_CALLS=100
|
|
81
|
+
|
|
82
|
+
# Optional: Enable caching
|
|
83
|
+
PROMPT_CACHE_ENABLED=true
|
|
84
|
+
SEMANTIC_CACHE_ENABLED=true
|
|
59
85
|
```
|
|
60
86
|
|
|
61
87
|
**Option C: Enterprise (AWS Bedrock)**
|
|
62
|
-
```bash
|
|
63
|
-
lynkr start
|
|
64
|
-
```
|
|
65
88
|
|
|
66
|
-
|
|
89
|
+
Create/edit `.env`:
|
|
67
90
|
```bash
|
|
91
|
+
# Provider
|
|
68
92
|
MODEL_PROVIDER=bedrock
|
|
69
93
|
AWS_BEDROCK_API_KEY=your-aws-key
|
|
70
94
|
AWS_BEDROCK_MODEL_ID=anthropic.claude-3-5-sonnet-20241022-v2:0
|
|
71
95
|
FALLBACK_ENABLED=false
|
|
96
|
+
|
|
97
|
+
# Server
|
|
98
|
+
PORT=8081
|
|
99
|
+
|
|
100
|
+
# Increase limits
|
|
101
|
+
POLICY_MAX_STEPS=50
|
|
102
|
+
POLICY_MAX_TOOL_CALLS=100
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**Option D: Enterprise (Databricks)**
|
|
106
|
+
|
|
107
|
+
Create/edit `.env`:
|
|
108
|
+
```bash
|
|
109
|
+
# Provider
|
|
110
|
+
MODEL_PROVIDER=databricks
|
|
111
|
+
DATABRICKS_API_BASE=https://your-workspace.cloud.databricks.com
|
|
112
|
+
DATABRICKS_API_KEY=your-token
|
|
113
|
+
FALLBACK_ENABLED=false
|
|
114
|
+
|
|
115
|
+
# Server
|
|
116
|
+
PORT=8081
|
|
117
|
+
|
|
118
|
+
# Increase limits
|
|
119
|
+
POLICY_MAX_STEPS=50
|
|
120
|
+
POLICY_MAX_TOOL_CALLS=100
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Then start Lynkr:
|
|
124
|
+
```bash
|
|
125
|
+
lynkr start
|
|
72
126
|
```
|
|
73
127
|
|
|
74
128
|
### 3. Connect Your Tool
|
|
@@ -169,52 +223,222 @@ Lynkr analyzes each request and routes it to the appropriate tier. Simple questi
|
|
|
169
223
|
|
|
170
224
|
---
|
|
171
225
|
|
|
172
|
-
##
|
|
226
|
+
## Complete .env Examples
|
|
227
|
+
|
|
228
|
+
### MVP: Minimal Working Setup (Ollama)
|
|
229
|
+
|
|
230
|
+
Copy-paste ready configuration for immediate use:
|
|
173
231
|
|
|
174
|
-
### Minimal Ollama Setup
|
|
175
232
|
```bash
|
|
176
|
-
# .env
|
|
233
|
+
# .env - Minimal Ollama Setup
|
|
234
|
+
|
|
235
|
+
# ============================================
|
|
236
|
+
# REQUIRED: Provider Configuration
|
|
237
|
+
# ============================================
|
|
177
238
|
MODEL_PROVIDER=ollama
|
|
178
239
|
FALLBACK_ENABLED=false
|
|
240
|
+
|
|
241
|
+
# ============================================
|
|
242
|
+
# REQUIRED: Ollama Settings
|
|
243
|
+
# ============================================
|
|
244
|
+
OLLAMA_ENDPOINT=http://localhost:11434
|
|
179
245
|
OLLAMA_MODEL=qwen2.5-coder:latest
|
|
246
|
+
|
|
247
|
+
# ============================================
|
|
248
|
+
# REQUIRED: Server Configuration
|
|
249
|
+
# ============================================
|
|
250
|
+
PORT=8081
|
|
251
|
+
HOST=0.0.0.0
|
|
252
|
+
|
|
253
|
+
# ============================================
|
|
254
|
+
# REQUIRED: Claude Code/Cursor Compatibility
|
|
255
|
+
# ============================================
|
|
180
256
|
POLICY_MAX_STEPS=50
|
|
181
257
|
POLICY_MAX_TOOL_CALLS=100
|
|
258
|
+
POLICY_SAFE_COMMANDS_ENABLED=false
|
|
259
|
+
|
|
260
|
+
# ============================================
|
|
261
|
+
# OPTIONAL: Performance (Recommended)
|
|
262
|
+
# ============================================
|
|
263
|
+
LOG_LEVEL=warn
|
|
264
|
+
LOAD_SHEDDING_ENABLED=true
|
|
265
|
+
LOAD_SHEDDING_HEAP_THRESHOLD=0.85
|
|
182
266
|
```
|
|
183
267
|
|
|
184
|
-
|
|
268
|
+
**Steps:**
|
|
269
|
+
1. Install Ollama: `curl -fsSL https://ollama.com/install.sh | sh`
|
|
270
|
+
2. Pull model: `ollama pull qwen2.5-coder:latest`
|
|
271
|
+
3. Copy above to `.env` in your project directory
|
|
272
|
+
4. Run: `lynkr start`
|
|
273
|
+
|
|
274
|
+
---
|
|
275
|
+
|
|
276
|
+
### Production: Cloud with Tier Routing (OpenRouter)
|
|
277
|
+
|
|
278
|
+
Optimized for cost savings with smart routing:
|
|
279
|
+
|
|
185
280
|
```bash
|
|
186
|
-
# .env
|
|
281
|
+
# .env - Production OpenRouter Setup
|
|
282
|
+
|
|
283
|
+
# ============================================
|
|
284
|
+
# REQUIRED: Provider Configuration
|
|
285
|
+
# ============================================
|
|
187
286
|
MODEL_PROVIDER=openrouter
|
|
188
|
-
OPENROUTER_API_KEY=sk-or-v1-your-key
|
|
287
|
+
OPENROUTER_API_KEY=sk-or-v1-your-key-here
|
|
189
288
|
FALLBACK_ENABLED=false
|
|
190
289
|
|
|
191
|
-
#
|
|
290
|
+
# ============================================
|
|
291
|
+
# REQUIRED: Server Configuration
|
|
292
|
+
# ============================================
|
|
293
|
+
PORT=8081
|
|
294
|
+
HOST=0.0.0.0
|
|
295
|
+
|
|
296
|
+
# ============================================
|
|
297
|
+
# TIER ROUTING: Smart Cost Optimization
|
|
298
|
+
# ============================================
|
|
299
|
+
# Simple queries → Cheap/fast model
|
|
192
300
|
TIER_SIMPLE=openrouter:google/gemini-flash-1.5
|
|
301
|
+
|
|
302
|
+
# Normal coding → Balanced model
|
|
193
303
|
TIER_MEDIUM=openrouter:anthropic/claude-3.5-sonnet
|
|
304
|
+
|
|
305
|
+
# Complex refactoring → Powerful model
|
|
194
306
|
TIER_COMPLEX=openrouter:anthropic/claude-opus-4
|
|
307
|
+
|
|
308
|
+
# Deep reasoning → Most capable model
|
|
195
309
|
TIER_REASONING=openrouter:anthropic/claude-opus-4
|
|
196
310
|
|
|
197
|
-
#
|
|
311
|
+
# ============================================
|
|
312
|
+
# REQUIRED: Claude Code/Cursor Compatibility
|
|
313
|
+
# ============================================
|
|
198
314
|
POLICY_MAX_STEPS=50
|
|
199
315
|
POLICY_MAX_TOOL_CALLS=100
|
|
316
|
+
POLICY_SAFE_COMMANDS_ENABLED=false
|
|
200
317
|
|
|
201
|
-
#
|
|
318
|
+
# ============================================
|
|
319
|
+
# OPTIONAL: Token Optimization (60-80% savings)
|
|
320
|
+
# ============================================
|
|
202
321
|
PROMPT_CACHE_ENABLED=true
|
|
203
322
|
SEMANTIC_CACHE_ENABLED=true
|
|
323
|
+
SEMANTIC_CACHE_THRESHOLD=0.95
|
|
324
|
+
TOOL_INJECTION_ENABLED=false
|
|
325
|
+
|
|
326
|
+
# ============================================
|
|
327
|
+
# OPTIONAL: Performance Tuning
|
|
328
|
+
# ============================================
|
|
329
|
+
LOG_LEVEL=warn
|
|
330
|
+
LOAD_SHEDDING_ENABLED=true
|
|
331
|
+
LOAD_SHEDDING_HEAP_THRESHOLD=0.85
|
|
204
332
|
```
|
|
205
333
|
|
|
206
|
-
|
|
334
|
+
**Expected savings:** 70-90% of requests use Gemini Flash ($). Only 10-30% use Claude Opus ($$$).
|
|
335
|
+
|
|
336
|
+
---
|
|
337
|
+
|
|
338
|
+
### Enterprise: Databricks Foundation Models
|
|
339
|
+
|
|
340
|
+
For teams using Databricks Model Serving:
|
|
341
|
+
|
|
207
342
|
```bash
|
|
208
|
-
# .env
|
|
343
|
+
# .env - Enterprise Databricks Setup
|
|
344
|
+
|
|
345
|
+
# ============================================
|
|
346
|
+
# REQUIRED: Provider Configuration
|
|
347
|
+
# ============================================
|
|
209
348
|
MODEL_PROVIDER=databricks
|
|
210
349
|
DATABRICKS_API_BASE=https://your-workspace.cloud.databricks.com
|
|
211
|
-
DATABRICKS_API_KEY=
|
|
350
|
+
DATABRICKS_API_KEY=dapi1234567890abcdef
|
|
212
351
|
FALLBACK_ENABLED=false
|
|
213
352
|
|
|
353
|
+
# ============================================
|
|
354
|
+
# REQUIRED: Model Configuration
|
|
355
|
+
# ============================================
|
|
356
|
+
# Option 1: Single model (no tier routing)
|
|
357
|
+
DATABRICKS_MODEL=databricks-meta-llama-3-1-405b-instruct
|
|
358
|
+
|
|
359
|
+
# Option 2: Tier routing (comment out above, uncomment below)
|
|
360
|
+
# TIER_SIMPLE=databricks:databricks-meta-llama-3-1-70b-instruct
|
|
361
|
+
# TIER_MEDIUM=databricks:databricks-claude-sonnet-4-5
|
|
362
|
+
# TIER_COMPLEX=databricks:databricks-claude-opus-4-6
|
|
363
|
+
# TIER_REASONING=databricks:databricks-claude-opus-4-6
|
|
364
|
+
|
|
365
|
+
# ============================================
|
|
366
|
+
# REQUIRED: Server Configuration
|
|
367
|
+
# ============================================
|
|
368
|
+
PORT=8081
|
|
369
|
+
HOST=0.0.0.0
|
|
370
|
+
|
|
371
|
+
# ============================================
|
|
372
|
+
# REQUIRED: Claude Code/Cursor Compatibility
|
|
373
|
+
# ============================================
|
|
374
|
+
POLICY_MAX_STEPS=50
|
|
375
|
+
POLICY_MAX_TOOL_CALLS=100
|
|
376
|
+
POLICY_SAFE_COMMANDS_ENABLED=false
|
|
377
|
+
|
|
378
|
+
# ============================================
|
|
379
|
+
# OPTIONAL: Enterprise Features
|
|
380
|
+
# ============================================
|
|
381
|
+
LOG_LEVEL=info
|
|
382
|
+
LOAD_SHEDDING_ENABLED=true
|
|
383
|
+
LOAD_SHEDDING_HEAP_THRESHOLD=0.85
|
|
384
|
+
|
|
385
|
+
# Optional: Metrics for monitoring
|
|
386
|
+
# PROMETHEUS_METRICS_ENABLED=true
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
---
|
|
390
|
+
|
|
391
|
+
### Hybrid: Local + Cloud Fallback
|
|
392
|
+
|
|
393
|
+
Use free Ollama, fallback to cloud when needed:
|
|
394
|
+
|
|
395
|
+
```bash
|
|
396
|
+
# .env - Hybrid Setup (Advanced)
|
|
397
|
+
|
|
398
|
+
# ============================================
|
|
399
|
+
# PRIMARY: Local Ollama
|
|
400
|
+
# ============================================
|
|
401
|
+
MODEL_PROVIDER=ollama
|
|
402
|
+
OLLAMA_ENDPOINT=http://localhost:11434
|
|
403
|
+
OLLAMA_MODEL=qwen2.5-coder:latest
|
|
404
|
+
|
|
405
|
+
# ============================================
|
|
406
|
+
# FALLBACK: Cloud Provider
|
|
407
|
+
# ============================================
|
|
408
|
+
FALLBACK_ENABLED=true
|
|
409
|
+
FALLBACK_PROVIDER=openrouter
|
|
410
|
+
OPENROUTER_API_KEY=sk-or-v1-your-key-here
|
|
411
|
+
|
|
412
|
+
# ============================================
|
|
413
|
+
# TIER ROUTING: Mix Local + Cloud
|
|
414
|
+
# ============================================
|
|
415
|
+
TIER_SIMPLE=ollama:qwen2.5:3b
|
|
416
|
+
TIER_MEDIUM=ollama:qwen2.5:7b
|
|
417
|
+
TIER_COMPLEX=openrouter:anthropic/claude-3.5-sonnet
|
|
418
|
+
TIER_REASONING=openrouter:anthropic/claude-opus-4
|
|
419
|
+
|
|
420
|
+
# ============================================
|
|
421
|
+
# REQUIRED: Server Configuration
|
|
422
|
+
# ============================================
|
|
423
|
+
PORT=8081
|
|
424
|
+
HOST=0.0.0.0
|
|
425
|
+
|
|
426
|
+
# ============================================
|
|
427
|
+
# REQUIRED: Claude Code/Cursor Compatibility
|
|
428
|
+
# ============================================
|
|
214
429
|
POLICY_MAX_STEPS=50
|
|
215
430
|
POLICY_MAX_TOOL_CALLS=100
|
|
431
|
+
POLICY_SAFE_COMMANDS_ENABLED=false
|
|
432
|
+
|
|
433
|
+
# ============================================
|
|
434
|
+
# OPTIONAL: Performance
|
|
435
|
+
# ============================================
|
|
436
|
+
LOG_LEVEL=warn
|
|
437
|
+
LOAD_SHEDDING_ENABLED=true
|
|
216
438
|
```
|
|
217
439
|
|
|
440
|
+
**Best of both worlds:** 80% of requests stay local (free). Complex tasks use cloud (paid).
|
|
441
|
+
|
|
218
442
|
---
|
|
219
443
|
|
|
220
444
|
## Common Issues & Fixes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lynkr",
|
|
3
|
-
"version": "9.2.
|
|
3
|
+
"version": "9.2.1",
|
|
4
4
|
"description": "Self-hosted Claude Code & Cursor proxy with Databricks,AWS BedRock,Azure adapters, openrouter, Ollama,llamacpp,LM Studio, workspace tooling, and MCP integration.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|