lynkr 7.2.5 → 8.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.
Files changed (124) hide show
  1. package/README.md +3 -3
  2. package/config/model-tiers.json +89 -0
  3. package/install.sh +6 -1
  4. package/package.json +4 -2
  5. package/scripts/setup.js +0 -1
  6. package/src/agents/executor.js +14 -6
  7. package/src/api/middleware/session.js +15 -2
  8. package/src/api/openai-router.js +162 -37
  9. package/src/api/providers-handler.js +15 -1
  10. package/src/api/router.js +107 -2
  11. package/src/budget/index.js +4 -3
  12. package/src/clients/databricks.js +431 -234
  13. package/src/clients/gpt-utils.js +181 -0
  14. package/src/clients/ollama-utils.js +66 -140
  15. package/src/clients/routing.js +0 -1
  16. package/src/clients/standard-tools.js +99 -3
  17. package/src/config/index.js +133 -35
  18. package/src/context/toon.js +173 -0
  19. package/src/logger/index.js +23 -0
  20. package/src/orchestrator/index.js +688 -213
  21. package/src/routing/agentic-detector.js +320 -0
  22. package/src/routing/complexity-analyzer.js +202 -2
  23. package/src/routing/cost-optimizer.js +305 -0
  24. package/src/routing/index.js +168 -159
  25. package/src/routing/model-tiers.js +365 -0
  26. package/src/server.js +4 -14
  27. package/src/sessions/cleanup.js +3 -3
  28. package/src/sessions/record.js +10 -1
  29. package/src/sessions/store.js +7 -2
  30. package/src/tools/agent-task.js +48 -1
  31. package/src/tools/index.js +19 -2
  32. package/src/tools/lazy-loader.js +7 -0
  33. package/src/tools/tinyfish.js +358 -0
  34. package/src/tools/truncate.js +1 -0
  35. package/.github/FUNDING.yml +0 -15
  36. package/.github/workflows/README.md +0 -215
  37. package/.github/workflows/ci.yml +0 -69
  38. package/.github/workflows/index.yml +0 -62
  39. package/.github/workflows/web-tools-tests.yml +0 -56
  40. package/CITATIONS.bib +0 -6
  41. package/CLAWROUTER_ROUTING_PLAN.md +0 -910
  42. package/DEPLOYMENT.md +0 -1001
  43. package/LYNKR-TUI-PLAN.md +0 -984
  44. package/PERFORMANCE-REPORT.md +0 -866
  45. package/PLAN-per-client-model-routing.md +0 -252
  46. package/ROUTER_COMPARISON.md +0 -173
  47. package/TIER_ROUTING_PLAN.md +0 -771
  48. package/docs/42642f749da6234f41b6b425c3bb07c9.txt +0 -1
  49. package/docs/BingSiteAuth.xml +0 -4
  50. package/docs/docs-style.css +0 -478
  51. package/docs/docs.html +0 -197
  52. package/docs/google5be250e608e6da39.html +0 -1
  53. package/docs/index.html +0 -577
  54. package/docs/index.md +0 -577
  55. package/docs/robots.txt +0 -4
  56. package/docs/sitemap.xml +0 -44
  57. package/docs/style.css +0 -1223
  58. package/documentation/README.md +0 -100
  59. package/documentation/api.md +0 -806
  60. package/documentation/claude-code-cli.md +0 -672
  61. package/documentation/codex-cli.md +0 -397
  62. package/documentation/contributing.md +0 -571
  63. package/documentation/cursor-integration.md +0 -731
  64. package/documentation/docker.md +0 -867
  65. package/documentation/embeddings.md +0 -760
  66. package/documentation/faq.md +0 -659
  67. package/documentation/features.md +0 -396
  68. package/documentation/headroom.md +0 -519
  69. package/documentation/installation.md +0 -706
  70. package/documentation/memory-system.md +0 -476
  71. package/documentation/production.md +0 -601
  72. package/documentation/providers.md +0 -906
  73. package/documentation/testing.md +0 -629
  74. package/documentation/token-optimization.md +0 -323
  75. package/documentation/tools.md +0 -697
  76. package/documentation/troubleshooting.md +0 -893
  77. package/final-test.js +0 -33
  78. package/headroom-sidecar/config.py +0 -93
  79. package/headroom-sidecar/requirements.txt +0 -14
  80. package/headroom-sidecar/server.py +0 -451
  81. package/monitor-agents.sh +0 -31
  82. package/scripts/audit-log-reader.js +0 -399
  83. package/scripts/compact-dictionary.js +0 -204
  84. package/scripts/test-deduplication.js +0 -448
  85. package/src/db/database.sqlite +0 -0
  86. package/test/README.md +0 -212
  87. package/test/azure-openai-config.test.js +0 -204
  88. package/test/azure-openai-error-resilience.test.js +0 -238
  89. package/test/azure-openai-format-conversion.test.js +0 -354
  90. package/test/azure-openai-integration.test.js +0 -281
  91. package/test/azure-openai-routing.test.js +0 -177
  92. package/test/azure-openai-streaming.test.js +0 -171
  93. package/test/bedrock-integration.test.js +0 -471
  94. package/test/comprehensive-test-suite.js +0 -928
  95. package/test/config-validation.test.js +0 -207
  96. package/test/cursor-integration.test.js +0 -484
  97. package/test/format-conversion.test.js +0 -578
  98. package/test/hybrid-routing-integration.test.js +0 -254
  99. package/test/hybrid-routing-performance.test.js +0 -418
  100. package/test/llamacpp-integration.test.js +0 -863
  101. package/test/lmstudio-integration.test.js +0 -335
  102. package/test/memory/extractor.test.js +0 -398
  103. package/test/memory/retriever.test.js +0 -613
  104. package/test/memory/retriever.test.js.bak +0 -585
  105. package/test/memory/search.test.js +0 -537
  106. package/test/memory/search.test.js.bak +0 -389
  107. package/test/memory/store.test.js +0 -344
  108. package/test/memory/store.test.js.bak +0 -312
  109. package/test/memory/surprise.test.js +0 -300
  110. package/test/memory-performance.test.js +0 -472
  111. package/test/openai-integration.test.js +0 -686
  112. package/test/openrouter-error-resilience.test.js +0 -418
  113. package/test/passthrough-mode.test.js +0 -385
  114. package/test/performance-benchmark.js +0 -351
  115. package/test/performance-tests.js +0 -528
  116. package/test/routing.test.js +0 -219
  117. package/test/web-tools.test.js +0 -329
  118. package/test-agents-simple.js +0 -43
  119. package/test-cli-connection.sh +0 -33
  120. package/test-learning-unit.js +0 -126
  121. package/test-learning.js +0 -112
  122. package/test-parallel-agents.sh +0 -124
  123. package/test-parallel-direct.js +0 -155
  124. package/test-subagents.sh +0 -117
@@ -1,706 +0,0 @@
1
- # Installation Guide
2
-
3
- Complete installation instructions for all supported methods. Choose the option that best fits your workflow.
4
-
5
- ---
6
-
7
- ## Prerequisites
8
-
9
- Before installing Lynkr, ensure you have:
10
-
11
- - **Node.js 18+** (required for the global `fetch` API)
12
- - **npm** (bundled with Node.js)
13
- - At least one of the following:
14
- - **Databricks account** with Claude serving endpoint
15
- - **AWS account** with Bedrock access
16
- - **OpenRouter API key** (get from [openrouter.ai/keys](https://openrouter.ai/keys))
17
- - **Azure OpenAI** or **Azure Anthropic** subscription
18
- - **OpenAI API key** (get from [platform.openai.com/api-keys](https://platform.openai.com/api-keys))
19
- - **Ollama** installed locally (for free local models)
20
- - Optional: **Docker** for containerized deployment or MCP sandboxing
21
- - Optional: **Claude Code CLI** (latest release) for CLI usage
22
-
23
- ---
24
-
25
- ## Installation Methods
26
-
27
- ### Method 1: NPM Package (Recommended)
28
-
29
- **Fastest way to get started:**
30
-
31
- ```bash
32
- # Install globally
33
- npm install -g lynkr
34
-
35
- # Verify installation
36
- lynkr --version
37
- ```
38
-
39
- **Start the server:**
40
- ```bash
41
- lynkr start
42
- # Or simply:
43
- lynkr
44
- ```
45
-
46
- **Benefits:**
47
- - ✅ Global `lynkr` command available everywhere
48
- - ✅ Automatic updates via `npm update -g lynkr`
49
- - ✅ No repository cloning required
50
- - ✅ Works immediately after install
51
-
52
- ---
53
-
54
- ### Method 2: Quick Install Script (curl)
55
-
56
- **One-line installation:**
57
-
58
- ```bash
59
- curl -fsSL https://raw.githubusercontent.com/vishalveerareddy123/Lynkr/main/install.sh | bash
60
- ```
61
-
62
- This will:
63
- - Clone Lynkr to `~/.lynkr`
64
- - Install dependencies
65
- - Create a default `.env` file
66
- - Set up the `lynkr` command
67
-
68
- **Custom installation directory:**
69
- ```bash
70
- curl -fsSL https://raw.githubusercontent.com/vishalveerareddy123/Lynkr/main/install.sh | bash -s -- --dir /opt/lynkr
71
- ```
72
-
73
- ---
74
-
75
- ### Method 3: Git Clone (For Development)
76
-
77
- **Clone from source:**
78
-
79
- ```bash
80
- # Clone repository
81
- git clone https://github.com/vishalveerareddy123/Lynkr.git
82
- cd Lynkr
83
-
84
- # Install dependencies
85
- npm install
86
-
87
- # Create .env from example
88
- cp .env.example .env
89
-
90
- # Edit .env with your provider credentials
91
- nano .env
92
-
93
- # Start server
94
- npm start
95
- ```
96
-
97
- **Development mode (auto-restart on changes):**
98
- ```bash
99
- npm run dev
100
- ```
101
-
102
- **Benefits:**
103
- - ✅ Full source code access
104
- - ✅ Easy to contribute changes
105
- - ✅ Run latest development version
106
- - ✅ Auto-restart in dev mode
107
-
108
- ---
109
-
110
- ### Method 4: Homebrew (macOS/Linux)
111
-
112
- **Install via Homebrew:**
113
-
114
- ```bash
115
- # Add the Lynkr tap
116
- brew tap vishalveerareddy123/lynkr
117
-
118
- # Install Lynkr
119
- brew install lynkr
120
-
121
- # Verify installation
122
- lynkr --version
123
-
124
- # Start server
125
- lynkr start
126
- ```
127
-
128
- **Update Lynkr:**
129
- ```bash
130
- brew upgrade lynkr
131
- ```
132
-
133
- **Benefits:**
134
- - ✅ Native macOS/Linux package management
135
- - ✅ Automatic dependency resolution
136
- - ✅ Easy updates via Homebrew
137
- - ✅ System-wide installation
138
-
139
- ---
140
-
141
- ### Method 5: Docker (Production)
142
-
143
- **Docker Compose (Recommended for Production):**
144
-
145
- ```bash
146
- # Clone repository
147
- git clone https://github.com/vishalveerareddy123/Lynkr.git
148
- cd Lynkr
149
-
150
- # Copy environment template
151
- cp .env.example .env
152
-
153
- # Edit .env with your credentials
154
- nano .env
155
-
156
- # Start services (Lynkr + Ollama)
157
- docker-compose up -d
158
-
159
- # Pull Ollama model (if using Ollama)
160
- docker exec ollama ollama pull llama3.1:8b
161
-
162
- # Verify it's running
163
- curl http://localhost:8081/health/live
164
- ```
165
-
166
- **Standalone Docker:**
167
-
168
- ```bash
169
- # Build image
170
- docker build -t lynkr:latest .
171
-
172
- # Run container
173
- docker run -d \
174
- --name lynkr \
175
- -p 8081:8081 \
176
- -e MODEL_PROVIDER=databricks \
177
- -e DATABRICKS_API_BASE=https://your-workspace.databricks.com \
178
- -e DATABRICKS_API_KEY=your-key \
179
- -v $(pwd)/data:/app/data \
180
- lynkr:latest
181
- ```
182
-
183
- **Benefits:**
184
- - ✅ Isolated environment
185
- - ✅ Easy deployment to Kubernetes/cloud
186
- - ✅ Bundled with Ollama (docker-compose)
187
- - ✅ Volume persistence for data
188
- - ✅ Production-ready configuration
189
-
190
- See [Docker Deployment Guide](docker.md) for advanced options (GPU support, K8s, health checks).
191
-
192
- ---
193
-
194
- ## Configuration
195
-
196
- After installation, configure Lynkr for your chosen provider:
197
-
198
- ### Creating Configuration File
199
-
200
- **Option A: Environment Variables (Recommended for Quick Start)**
201
- ```bash
202
- export MODEL_PROVIDER=databricks
203
- export DATABRICKS_API_BASE=https://your-workspace.databricks.com
204
- export DATABRICKS_API_KEY=your-key
205
- lynkr start
206
- ```
207
-
208
- **Option B: .env File (Recommended for Production)**
209
- ```bash
210
- # Copy example file
211
- cp .env.example .env
212
-
213
- # Edit with your credentials
214
- nano .env
215
- ```
216
-
217
- Example `.env` file:
218
- ```env
219
- # Core Configuration
220
- MODEL_PROVIDER=databricks
221
- PORT=8081
222
- LOG_LEVEL=info
223
- WORKSPACE_ROOT=/path/to/your/projects
224
-
225
- # Databricks Configuration
226
- DATABRICKS_API_BASE=https://your-workspace.cloud.databricks.com
227
- DATABRICKS_API_KEY=dapi1234567890abcdef
228
-
229
- # Tool Execution
230
- TOOL_EXECUTION_MODE=server
231
-
232
- # Memory System (optional)
233
- MEMORY_ENABLED=true
234
- MEMORY_RETRIEVAL_LIMIT=5
235
- ```
236
-
237
- ---
238
-
239
- ## Quick Start Examples
240
-
241
- Choose your provider and follow the setup steps:
242
-
243
- ### 1. Databricks (Production)
244
-
245
- **Best for:** Enterprise production use, Claude Sonnet 4.5, Claude Opus 4.5
246
-
247
- ```bash
248
- # Install
249
- npm install -g lynkr
250
-
251
- # Configure
252
- export MODEL_PROVIDER=databricks
253
- export DATABRICKS_API_BASE=https://your-workspace.cloud.databricks.com
254
- export DATABRICKS_API_KEY=dapi1234567890abcdef
255
-
256
- # Start
257
- lynkr start
258
- ```
259
-
260
- **Get Databricks credentials:**
261
- 1. Log in to your Databricks workspace
262
- 2. Go to **Settings** → **User Settings**
263
- 3. Click **Generate New Token**
264
- 4. Copy the token (this is your `DATABRICKS_API_KEY`)
265
- 5. Your workspace URL is like `https://your-workspace.cloud.databricks.com`
266
-
267
- ---
268
-
269
- ### 2. AWS Bedrock (100+ Models)
270
-
271
- **Best for:** AWS ecosystem, multi-model flexibility, Claude + alternatives
272
-
273
- ```bash
274
- # Install
275
- npm install -g lynkr
276
-
277
- # Configure
278
- export MODEL_PROVIDER=bedrock
279
- export AWS_BEDROCK_API_KEY=AKIAIOSFODNN7EXAMPLE
280
- export AWS_BEDROCK_REGION=us-east-1
281
- export AWS_BEDROCK_MODEL_ID=anthropic.claude-3-5-sonnet-20241022-v2:0
282
-
283
- # Start
284
- lynkr start
285
- ```
286
-
287
- **Get AWS Bedrock credentials:**
288
- 1. Log in to AWS Console
289
- 2. Navigate to **IAM** → **Security Credentials**
290
- 3. Create new access key
291
- 4. Enable Bedrock in your region (us-east-1, us-west-2, etc.)
292
- 5. Request model access in Bedrock console
293
-
294
- **Popular Bedrock models:**
295
- - `anthropic.claude-3-5-sonnet-20241022-v2:0` - Claude 3.5 Sonnet
296
- - `us.anthropic.claude-sonnet-4-5-20250929-v1:0` - Claude 4.5 Sonnet
297
- - `amazon.titan-text-express-v1` - Amazon Titan
298
- - `meta.llama3-70b-instruct-v1:0` - Llama 3
299
- - See [BEDROCK_MODELS.md](../BEDROCK_MODELS.md) for complete list
300
-
301
- ---
302
-
303
- ### 3. OpenRouter (Simplest Cloud)
304
-
305
- **Best for:** Quick setup, 100+ models, cost flexibility
306
-
307
- ```bash
308
- # Install
309
- npm install -g lynkr
310
-
311
- # Configure
312
- export MODEL_PROVIDER=openrouter
313
- export OPENROUTER_API_KEY=sk-or-v1-your-key
314
- export OPENROUTER_MODEL=anthropic/claude-3.5-sonnet
315
-
316
- # Start
317
- lynkr start
318
- ```
319
-
320
- **Get OpenRouter API key:**
321
- 1. Visit [openrouter.ai](https://openrouter.ai)
322
- 2. Sign in with GitHub, Google, or email
323
- 3. Go to [openrouter.ai/keys](https://openrouter.ai/keys)
324
- 4. Create a new API key
325
- 5. Add credits (pay-as-you-go, no subscription)
326
-
327
- **Popular OpenRouter models:**
328
- - `anthropic/claude-3.5-sonnet` - Claude 3.5 Sonnet
329
- - `openai/gpt-4o` - GPT-4o
330
- - `openai/gpt-4o-mini` - GPT-4o mini (affordable)
331
- - `google/gemini-pro-1.5` - Gemini Pro
332
- - `meta-llama/llama-3.1-70b-instruct` - Llama 3.1
333
- - See [openrouter.ai/models](https://openrouter.ai/models) for complete list
334
-
335
- ---
336
-
337
- ### 4. Ollama (100% Local, FREE)
338
-
339
- **Best for:** Local development, privacy, offline use, no API costs
340
-
341
- ```bash
342
- # Install Ollama first
343
- brew install ollama # macOS
344
- # Or download from: https://ollama.ai/download
345
-
346
- # Start Ollama service
347
- ollama serve
348
-
349
- # Pull a model (in separate terminal)
350
- ollama pull llama3.1:8b
351
-
352
- # Install Lynkr
353
- npm install -g lynkr
354
-
355
- # Configure
356
- export MODEL_PROVIDER=ollama
357
- export OLLAMA_MODEL=llama3.1:8b
358
-
359
- # Start
360
- lynkr start
361
- ```
362
-
363
- **Recommended Ollama models for Claude Code:**
364
- - `llama3.1:8b` - Good balance (tool calling supported)
365
- - `llama3.2` - Latest Llama (tool calling supported)
366
- - `qwen2.5:14b` - Strong reasoning (larger model, 7b struggles with tools)
367
- - `mistral:7b-instruct` - Fast and capable
368
-
369
- **Model sizes:**
370
- - 7B models: ~4-5GB download
371
- - 8B models: ~4.7GB download
372
- - 14B models: ~8GB download
373
- - 32B models: ~18GB download
374
-
375
- ---
376
-
377
- ### 5. llama.cpp (Maximum Performance)
378
-
379
- **Best for:** Custom GGUF models, maximum control, optimized inference
380
-
381
- ```bash
382
- # Install and build llama.cpp
383
- git clone https://github.com/ggerganov/llama.cpp
384
- cd llama.cpp && make
385
-
386
- # Download a GGUF model
387
- wget https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct-GGUF/resolve/main/qwen2.5-coder-7b-instruct-q4_k_m.gguf
388
-
389
- # Start llama-server
390
- ./llama-server -m qwen2.5-coder-7b-instruct-q4_k_m.gguf --port 8080
391
-
392
- # In separate terminal, install Lynkr
393
- npm install -g lynkr
394
-
395
- # Configure
396
- export MODEL_PROVIDER=llamacpp
397
- export LLAMACPP_ENDPOINT=http://localhost:8080
398
- export LLAMACPP_MODEL=qwen2.5-coder-7b
399
-
400
- # Start
401
- lynkr start
402
- ```
403
-
404
- **llama.cpp vs Ollama:**
405
-
406
- | Feature | Ollama | llama.cpp |
407
- |---------|--------|-----------|
408
- | Setup | Easy (app) | Manual (compile) |
409
- | Model Format | Ollama-specific | Any GGUF model |
410
- | Performance | Good | Excellent (optimized C++) |
411
- | GPU Support | Yes | Yes (CUDA, Metal, ROCm, Vulkan) |
412
- | Memory Usage | Higher | Lower (quantization options) |
413
- | API | Custom | OpenAI-compatible |
414
- | Flexibility | Limited models | Any GGUF from HuggingFace |
415
-
416
- ---
417
-
418
- ### 6. Azure OpenAI
419
-
420
- **Best for:** Azure integration, Microsoft ecosystem, GPT-4o, o1, o3
421
-
422
- ```bash
423
- # Install
424
- npm install -g lynkr
425
-
426
- # Configure (IMPORTANT: Use full endpoint URL)
427
- export MODEL_PROVIDER=azure-openai
428
- export AZURE_OPENAI_ENDPOINT="https://your-resource.openai.azure.com/openai/deployments/YOUR-DEPLOYMENT/chat/completions?api-version=2025-01-01-preview"
429
- export AZURE_OPENAI_API_KEY=your-azure-api-key
430
- export AZURE_OPENAI_DEPLOYMENT=gpt-4o
431
-
432
- # Start
433
- lynkr start
434
- ```
435
-
436
- **Get Azure OpenAI credentials:**
437
- 1. Log in to [Azure Portal](https://portal.azure.com)
438
- 2. Navigate to **Azure OpenAI** service
439
- 3. Go to **Keys and Endpoint**
440
- 4. Copy **KEY 1** (this is your API key)
441
- 5. Copy **Endpoint** URL
442
- 6. Create a deployment (gpt-4o, gpt-4o-mini, etc.)
443
-
444
- **Supported deployments:**
445
- - `gpt-4o` - Latest GPT-4o
446
- - `gpt-4o-mini` - Smaller, faster GPT-4o
447
- - `gpt-5-chat` - GPT-5 (if available in your region)
448
- - `o1-preview` - Reasoning model
449
- - `o3-mini` - Latest reasoning model
450
-
451
- ---
452
-
453
- ### 7. Azure Anthropic
454
-
455
- **Best for:** Azure-hosted Claude models
456
-
457
- ```bash
458
- # Install
459
- npm install -g lynkr
460
-
461
- # Configure
462
- export MODEL_PROVIDER=azure-anthropic
463
- export AZURE_ANTHROPIC_ENDPOINT=https://your-resource.services.ai.azure.com/anthropic/v1/messages
464
- export AZURE_ANTHROPIC_API_KEY=your-azure-api-key
465
-
466
- # Start
467
- lynkr start
468
- ```
469
-
470
- ---
471
-
472
- ### 8. OpenAI (Direct)
473
-
474
- **Best for:** Direct OpenAI API access, lowest latency to OpenAI
475
-
476
- ```bash
477
- # Install
478
- npm install -g lynkr
479
-
480
- # Configure
481
- export MODEL_PROVIDER=openai
482
- export OPENAI_API_KEY=sk-your-openai-api-key
483
- export OPENAI_MODEL=gpt-4o
484
-
485
- # Start
486
- lynkr start
487
- ```
488
-
489
- **Get OpenAI API key:**
490
- 1. Visit [platform.openai.com](https://platform.openai.com)
491
- 2. Sign up or log in
492
- 3. Go to [API Keys](https://platform.openai.com/api-keys)
493
- 4. Create a new API key
494
- 5. Add credits to your account
495
-
496
- **Supported models:**
497
- - `gpt-4o` - Latest GPT-4o
498
- - `gpt-4o-mini` - Affordable GPT-4o
499
- - `o1-preview` - Reasoning model
500
- - `o1-mini` - Smaller reasoning model
501
-
502
- ---
503
-
504
- ### 9. LM Studio (Local with GUI)
505
-
506
- **Best for:** Local models with graphical interface
507
-
508
- ```bash
509
- # Download and install LM Studio from: https://lmstudio.ai
510
-
511
- # In LM Studio:
512
- # 1. Download a model (e.g., Qwen2.5-Coder-7B)
513
- # 2. Start local server (port 1234)
514
-
515
- # Install Lynkr
516
- npm install -g lynkr
517
-
518
- # Configure
519
- export MODEL_PROVIDER=lmstudio
520
- export LMSTUDIO_ENDPOINT=http://localhost:1234
521
-
522
- # Start
523
- lynkr start
524
- ```
525
-
526
- ---
527
-
528
- ## Hybrid Routing (Cost Optimization)
529
-
530
- **Use local Ollama for simple tasks, fallback to cloud for complex ones:**
531
-
532
- ```bash
533
- # Start Ollama
534
- ollama serve
535
- ollama pull llama3.1:8b
536
-
537
- # Configure hybrid routing
538
- export MODEL_PROVIDER=ollama
539
- export OLLAMA_MODEL=llama3.1:8b
540
- export PREFER_OLLAMA=true
541
- export FALLBACK_ENABLED=true
542
- export FALLBACK_PROVIDER=databricks
543
- export DATABRICKS_API_BASE=https://your-workspace.databricks.com
544
- export DATABRICKS_API_KEY=your-key
545
-
546
- # Start Lynkr
547
- lynkr start
548
- ```
549
-
550
- **How it works:**
551
- - **0-2 tools**: Ollama (free, local, fast)
552
- - **3-15 tools**: OpenRouter (if configured) or fallback to Databricks
553
- - **16+ tools**: Databricks/Azure (most capable)
554
- - **Ollama failures**: Automatic transparent fallback to cloud
555
-
556
- **Cost savings:**
557
- - **65-100%** for requests that stay on Ollama
558
- - **40-87%** faster for simple requests
559
- - **Privacy**: Simple queries never leave your machine
560
-
561
- ---
562
-
563
- ## Verification & Testing
564
-
565
- ### Check Server Health
566
-
567
- ```bash
568
- # Basic health check
569
- curl http://localhost:8081/health/live
570
-
571
- # Expected response:
572
- # {
573
- # "status": "ok",
574
- # "provider": "databricks",
575
- # "timestamp": "2026-01-11T12:00:00.000Z"
576
- # }
577
- ```
578
-
579
- ### Check Readiness (includes provider connectivity)
580
-
581
- ```bash
582
- curl http://localhost:8081/health/ready
583
-
584
- # Expected response (all checks passing):
585
- # {
586
- # "status": "ready",
587
- # "checks": {
588
- # "database": "ok",
589
- # "provider": "ok"
590
- # }
591
- # }
592
- ```
593
-
594
- ### Test with Claude Code CLI
595
-
596
- ```bash
597
- # Configure Claude Code CLI
598
- export ANTHROPIC_BASE_URL=http://localhost:8081
599
- export ANTHROPIC_API_KEY=dummy
600
-
601
- # Test simple query
602
- claude "What is 2+2?"
603
-
604
- # Should return response from your configured provider
605
- ```
606
-
607
- ---
608
-
609
- ## Environment Variables Reference
610
-
611
- See [Provider Configuration Guide](providers.md) for complete environment variable reference for all providers.
612
-
613
- ### Core Variables
614
-
615
- | Variable | Description | Default |
616
- |----------|-------------|---------|
617
- | `MODEL_PROVIDER` | Provider to use (`databricks`, `bedrock`, `openrouter`, `ollama`, `llamacpp`, `azure-openai`, `azure-anthropic`, `openai`, `lmstudio`) | `databricks` |
618
- | `PORT` | HTTP port for proxy server | `8081` |
619
- | `WORKSPACE_ROOT` | Workspace directory path | `process.cwd()` |
620
- | `LOG_LEVEL` | Logging level (`error`, `warn`, `info`, `debug`) | `info` |
621
- | `TOOL_EXECUTION_MODE` | Where tools execute (`server`, `client`) | `server` |
622
-
623
- ### Provider-Specific Variables
624
-
625
- Each provider requires specific credentials and configuration. See [Provider Configuration](providers.md) for complete details.
626
-
627
- ---
628
-
629
- ## Troubleshooting
630
-
631
- ### Server Won't Start
632
-
633
- **Issue:** `Error: MODEL_PROVIDER requires credentials`
634
-
635
- **Solution:**
636
- ```bash
637
- # Check your provider is configured
638
- echo $MODEL_PROVIDER
639
- echo $DATABRICKS_API_KEY # or other provider key
640
-
641
- # If empty, set them:
642
- export MODEL_PROVIDER=databricks
643
- export DATABRICKS_API_KEY=your-key
644
- ```
645
-
646
- ### Connection Refused
647
-
648
- **Issue:** `ECONNREFUSED` when connecting to provider
649
-
650
- **Solution:**
651
- 1. Check provider URL is correct
652
- 2. Verify API key is valid
653
- 3. Check network connectivity
654
- 4. For Ollama: Ensure `ollama serve` is running
655
-
656
- ### Port Already in Use
657
-
658
- **Issue:** `Error: listen EADDRINUSE: address already in use :::8081`
659
-
660
- **Solution:**
661
- ```bash
662
- # Find process using port 8081
663
- lsof -i :8081
664
-
665
- # Kill the process
666
- kill -9 <PID>
667
-
668
- # Or use different port
669
- export PORT=8082
670
- lynkr start
671
- ```
672
-
673
- ### Ollama Model Not Found
674
-
675
- **Issue:** `Error: model "llama3.1:8b" not found`
676
-
677
- **Solution:**
678
- ```bash
679
- # List available models
680
- ollama list
681
-
682
- # Pull the model
683
- ollama pull llama3.1:8b
684
-
685
- # Verify it's available
686
- ollama list
687
- ```
688
-
689
- ---
690
-
691
- ## Next Steps
692
-
693
- - **[Provider Configuration](providers.md)** - Detailed configuration for all providers
694
- - **[Claude Code CLI Setup](claude-code-cli.md)** - Connect Claude Code CLI
695
- - **[Cursor Integration](cursor-integration.md)** - Connect Cursor IDE
696
- - **[Features Guide](features.md)** - Learn about advanced features
697
- - **[Production Deployment](production.md)** - Deploy to production
698
-
699
- ---
700
-
701
- ## Getting Help
702
-
703
- - **[Troubleshooting Guide](troubleshooting.md)** - Common issues and solutions
704
- - **[FAQ](faq.md)** - Frequently asked questions
705
- - **[GitHub Discussions](https://github.com/vishalveerareddy123/Lynkr/discussions)** - Community Q&A
706
- - **[GitHub Issues](https://github.com/vishalveerareddy123/Lynkr/issues)** - Report bugs