{"_id":"lynkr-classroom","_rev":"3-c8436c9b65e491d9c13dc6aeb3d1f34f","name":"lynkr-classroom","dist-tags":{"latest":"10.0.1"},"versions":{"0.0.0-stage":{"name":"lynkr-classroom","version":"0.0.0-stage","_id":"lynkr-classroom@0.0.0-stage","stub":true,"maintainers":[{"name":"veerareddyvishal56","email":"veerareddyvishal56@gmail.com"}],"dist":{"shasum":"d5768714973742752fa4d8af78bf65c07354bd4c","tarball":"https://registry.npmjs.org/lynkr-classroom/-/lynkr-classroom-0.0.0-stage.tgz","fileCount":2,"integrity":"sha512-t0ciBwZoti+s12+F320kLCeSJffc8NNIrL/0cxaoF7Y8UAGNtpVwEWRYk24j+VvMO3eQ+jccOH046x9LgJdIqQ==","signatures":[{"sig":"MEUCIQDE4VAUk1VLpLp9fJtcDcPP8MjbWbqxLEUupLmyHvaq7gIgb5vYkrbgHU1kbkfOiXVVK/DcybLbtdNmB9GtALESDow=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":337},"_npmUser":{"name":"veerareddyvishal56","email":"veerareddyvishal56@gmail.com"},"description":"Temporary package placeholder for staged publishing","directories":{}},"10.0.0":{"name":"lynkr-classroom","version":"10.0.0","keywords":["llm","llm-gateway","llm-proxy","llm-router","ai-gateway","tier-routing","claude","claude-code","anthropic","cursor","codex","openai","openrouter","ollama","llamacpp","lm-studio","bedrock","aws-bedrock","azure-openai","databricks","gemini","mcp","model-context-protocol","prompt-cache","self-hosted","litellm-alternative","portkey-alternative","copilot-alternative","classroom","education","tutoring","course-management","ai-education","socratic-method","solution-blocking"],"author":{"name":"Vishal Veera Reddy"},"license":"Apache-2.0","_id":"lynkr-classroom@10.0.0","maintainers":[{"name":"veerareddyvishal56","email":"veerareddyvishal56@gmail.com"}],"homepage":"https://fast-editor.github.io/Lynkr/","bugs":{"url":"https://github.com/Fast-Editor/Lynkr/issues"},"bin":{"lynkr-classroom":"bin/cli.js","lynkr-classroom-setup":"scripts/setup.js","lynkr-classroom-statusline":"bin/statusline.js"},"dist":{"shasum":"a746b358655974519e447caa24c578c62f00227a","tarball":"https://registry.npmjs.org/lynkr-classroom/-/lynkr-classroom-10.0.0.tgz","fileCount":266,"integrity":"sha512-bsSBz2sWZdsVGVrz205ronyB+iJlFRxjUkNToo+rSRg+RebXV3xxk4F+GYn5Bbl0C82SbJwXmsrTf5VSQIOsQg==","signatures":[{"sig":"MEUCIQCViwBP3G0+/90o63HmGzWpwe/IquNyKXL99X1DwfgIJgIgeLjciJ5EV+dh0WO4kgTQBUo4vfESe3BJEx7n2P6Zh5o=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIHvaC5KSjnqT4E0amIktLTsZvPsYXWN3t7eUodisqRf/AiAS4JziId13Cny3KzVhvJauqveaFJOdt1AP/LIW/GdabA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":4654888},"main":"index.js","engines":{"node":">=20.0.0"},"gitHead":"3bfc8f20f1f35e9899709916bfba34fff00f17b0","scripts":{"dev":"nodemon index.js","lint":"eslint src index.js","stop":"node -e \"if(process.env.HEADROOM_ENABLED==='true'&&process.env.HEADROOM_DOCKER_ENABLED!=='false'){process.exit(0)}else{process.exit(1)}\" && docker compose --profile headroom down || echo 'Headroom skipped (disabled or Docker not running)'","test":"npm run test:unit && npm run test:performance","start":"node index.js 2>&1 | npx pino-pretty --sync","prestart":"node -e \"if(process.env.HEADROOM_ENABLED==='true'&&process.env.HEADROOM_DOCKER_ENABLED!=='false'){process.exit(0)}else{process.exit(1)}\" && docker compose --profile headroom up -d --build headroom 2>/dev/null || echo 'Headroom skipped (disabled or Docker not running)'","test:all":"npm run test:unit && npm run test:performance && npm run test:benchmark","test:unit":"LYNKR_KNN_DIR=/tmp/lynkr-test-knn DATABRICKS_API_KEY=test-key DATABRICKS_API_BASE=http://test.com LOG_FILE_ENABLED=false node --test test/routing.test.js test/hybrid-routing-integration.test.js test/retry-logic.test.js test/sse-transformer.test.js test/passthrough-stream.test.js test/passthrough-mode.test.js test/openrouter-error-resilience.test.js test/format-conversion.test.js test/azure-openai-config.test.js test/azure-openai-format-conversion.test.js test/azure-openai-routing.test.js test/azure-openai-streaming.test.js test/azure-openai-error-resilience.test.js test/azure-openai-integration.test.js test/openai-integration.test.js test/atlas-integration.test.js test/toon-compression.test.js test/gcf-compression.test.js test/llamacpp-integration.test.js test/resilience.test.js test/telemetry-routing.test.js test/memory/store.test.js test/memory/surprise.test.js test/memory/extractor.test.js test/memory/search.test.js test/memory/retriever.test.js test/memory/distiller.test.js test/memory/distiller-freeze.test.js test/memory/wiki.test.js test/memory/skills-cache.test.js test/memory/tencentdb-launcher.test.js test/distill.test.js test/large-payload.test.js test/prompt-cache-injection.test.js test/risk-analyzer.test.js test/interaction-block.test.js test/preflight.test.js test/token-reduction.test.js test/session-affinity.test.js test/cache-state.test.js test/cache-switch-cost.test.js test/lens-recommendations.test.js test/model-registry-cost.test.js test/output-format-guard.test.js test/tier-fallback.test.js test/wrap.test.js test/init.test.js test/tool-call-response-metadata.test.js test/degradation.test.js test/routing-telemetry-columns.test.js test/sticky-routing.test.js test/knn-ambiguous-escalate.test.js test/deescalator.test.js test/client-profiles.test.js test/openai-ingress-tool-injection.test.js test/tool-result-compression-gate.test.js test/strip-internal-fields.test.js test/complexity-tool-subtraction.test.js test/bandit.test.js test/routing-propensity.test.js test/reward-pipeline.test.js test/knn-cold-start.test.js test/calibration.test.js test/feedback-loop.test.js test/session-fingerprint.test.js test/side-request-guards.test.js test/verifier.test.js test/intent-score.test.js test/difficulty-classifier.test.js test/classifier-setup.test.js test/usage-stats.test.js test/loop-guard.test.js test/moonshot-model-mapping.test.js test/baidu-model-mapping.test.js test/tenant-policy-ingress-parity.test.js test/decide.test.js test/embeddings-degradation.test.js test/health-probe.test.js test/stuck-detector.test.js test/onnx-embedder.test.js test/ope.test.js test/hierarchical-budget.test.js test/token-rate-limit.test.js test/otel-export.test.js test/mcp-broker.test.js test/compression-budget.test.js test/gpt-utils.test.js test/dedup-observe-only.test.js test/context-window-header.test.js test/token-budget-auto.test.js test/opencode-setup.test.js test/auth-mode-first-party.test.js test/harness-envelope.test.js test/task-ledger.test.js test/jev-router.test.js test/jev-routing.test.js test/force-patterns.test.js test/upstream-fidelity.test.js test/tool-schema-compression.test.js test/passthrough-route.test.js test/quota-ledger.test.js test/shortfall-semantic.test.js test/routing-decisions.test.js test/routing-corpus.test.js test/switch-gate-grounding.test.js","test:quick":"LYNKR_KNN_DIR=/tmp/lynkr-test-knn DATABRICKS_API_KEY=test-key DATABRICKS_API_BASE=http://test.com node --test test/routing.test.js","postinstall":"node scripts/check-native.js","test:memory":"LYNKR_KNN_DIR=/tmp/lynkr-test-knn DATABRICKS_API_KEY=test-key DATABRICKS_API_BASE=http://test.com node --test test/memory/store.test.js test/memory/surprise.test.js test/memory/extractor.test.js test/memory/search.test.js test/memory/retriever.test.js test/memory/distiller.test.js test/memory/distiller-freeze.test.js test/memory/wiki.test.js test/memory/skills-cache.test.js test/memory/tencentdb-launcher.test.js","rebuild-native":"node scripts/check-native.js","test:benchmark":"LYNKR_KNN_DIR=/tmp/lynkr-test-knn DATABRICKS_API_KEY=test-key DATABRICKS_API_BASE=http://test.com node test/performance-benchmark.js","start:supervised":"while true; do node index.js 2>&1 | npx pino-pretty --sync; code=$?; echo \"[supervisor] lynkr exited ($code) — restarting in 3s\"; sleep 3; done","test:performance":"LYNKR_KNN_DIR=/tmp/lynkr-test-knn DATABRICKS_API_KEY=test-key DATABRICKS_API_BASE=http://test.com node test/hybrid-routing-performance.test.js && DATABRICKS_API_KEY=test-key DATABRICKS_API_BASE=http://test.com node test/performance-tests.js","seed:capabilities":"node scripts/seed-capabilities.js --refresh","test:new-features":"LYNKR_KNN_DIR=/tmp/lynkr-test-knn DATABRICKS_API_KEY=test-key DATABRICKS_API_BASE=http://test.com node --test test/passthrough-mode.test.js test/openrouter-error-resilience.test.js test/format-conversion.test.js"},"_npmUser":{"name":"veerareddyvishal56","email":"veerareddyvishal56@gmail.com"},"overrides":{"sharp":"^0.35.4","adm-zip":"^0.6.1"},"repository":{"url":"git+https://github.com/Fast-Editor/Lynkr.git","type":"git"},"_npmVersion":"11.16.0","description":"Self-hosted LLM gateway with classroom mode for educational use. Combines tier-routing (60-80% cost savings) with solution blocking, Socratic tutoring, course management, and audit trails for Claude Code.","directories":{},"_nodeVersion":"26.3.0","allowScripts":{},"dependencies":{"diff":"^5.2.0","pino":"^8.17.2","chalk":"^4.1.2","dotenv":"^16.4.5","express":"^5.1.0","unzipper":"^0.12.5","cockatiel":"^3.2.1","pino-http":"^8.6.0","pino-roll":"^4.0.0","js-tiktoken":"^1.0.20","hnswlib-node":"^3.0.0","@toon-format/toon":"^2.1.0","express-rate-limit":"^8.2.1","@blackwell-systems/gcf":"2.4.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.57.0","nodemon":"^3.1.0","pino-pretty":"^10.2.0","@napi-rs/cli":"^3.6.2"},"optionalDependencies":{"dockerode":"^5.0.1","tree-sitter":"^0.21.1","better-sqlite3":"^12.11.1","tree-sitter-python":"^0.21.0","tree-sitter-javascript":"^0.21.0","tree-sitter-typescript":"^0.21.0","@huggingface/transformers":"^4.2.0"},"_npmOperationalInternal":{"tmp":"tmp/lynkr-classroom_10.0.0_1792790518117_0.23130209912359878","host":"s3://npm-registry-packages-npm-production"}},"10.0.1":{"_id":"lynkr-classroom@10.0.1","bin":{"lynkr-classroom":"bin/cli.js","lynkr-classroom-setup":"scripts/setup.js","lynkr-classroom-statusline":"bin/statusline.js"},"bugs":{"url":"https://github.com/Fast-Editor/Lynkr/issues"},"dist":{"shasum":"65f39f3c83d32de9142abd86eb3fbcc201a73ba0","tarball":"https://registry.npmjs.org/lynkr-classroom/-/lynkr-classroom-10.0.1.tgz","fileCount":266,"integrity":"sha512-esAwLOGedqHsk1MSJAi+7CBP5eOyKubxpnh+KuQJ8PvKjhSN53pKEf+vYwXN6sccQJWxsshwaHrhJXZJ9b0MKg==","signatures":[{"sig":"MEUCIQCgQbs5VmHJ4BsAmKUnAWjYG7twUtPP5uMcGO601J5IrwIgQN5gucUkl4wY3M278H2aTjk8SRoy/1XY+BrClRwgzQA=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDrHjimqQTukhVJXG9x4QEZZaALe8anU2Nqun3E7iTIBAIgIL8vrAzzjJysCBM/PDztFv0j3KXDcETOxdzAm52fuuM="}],"unpackedSize":4654888},"main":"index.js","name":"lynkr-classroom","author":{"name":"Vishal Veera Reddy"},"engines":{"node":">=20.0.0"},"gitHead":"6fe6db3061a28ab5d799057de5571b7452158b46","license":"Apache-2.0","scripts":{"dev":"nodemon index.js","lint":"eslint src index.js","stop":"node -e \"if(process.env.HEADROOM_ENABLED==='true'&&process.env.HEADROOM_DOCKER_ENABLED!=='false'){process.exit(0)}else{process.exit(1)}\" && docker compose --profile headroom down || echo 'Headroom skipped (disabled or Docker not running)'","test":"npm run test:unit && npm run test:performance","start":"node index.js 2>&1 | npx pino-pretty --sync","prestart":"node -e \"if(process.env.HEADROOM_ENABLED==='true'&&process.env.HEADROOM_DOCKER_ENABLED!=='false'){process.exit(0)}else{process.exit(1)}\" && docker compose --profile headroom up -d --build headroom 2>/dev/null || echo 'Headroom skipped (disabled or Docker not running)'","test:all":"npm run test:unit && npm run test:performance && npm run test:benchmark","test:unit":"LYNKR_KNN_DIR=/tmp/lynkr-test-knn DATABRICKS_API_KEY=test-key DATABRICKS_API_BASE=http://test.com LOG_FILE_ENABLED=false node --test test/routing.test.js test/hybrid-routing-integration.test.js test/retry-logic.test.js test/sse-transformer.test.js test/passthrough-stream.test.js test/passthrough-mode.test.js test/openrouter-error-resilience.test.js test/format-conversion.test.js test/azure-openai-config.test.js test/azure-openai-format-conversion.test.js test/azure-openai-routing.test.js test/azure-openai-streaming.test.js test/azure-openai-error-resilience.test.js test/azure-openai-integration.test.js test/openai-integration.test.js test/atlas-integration.test.js test/toon-compression.test.js test/gcf-compression.test.js test/llamacpp-integration.test.js test/resilience.test.js test/telemetry-routing.test.js test/memory/store.test.js test/memory/surprise.test.js test/memory/extractor.test.js test/memory/search.test.js test/memory/retriever.test.js test/memory/distiller.test.js test/memory/distiller-freeze.test.js test/memory/wiki.test.js test/memory/skills-cache.test.js test/memory/tencentdb-launcher.test.js test/distill.test.js test/large-payload.test.js test/prompt-cache-injection.test.js test/risk-analyzer.test.js test/interaction-block.test.js test/preflight.test.js test/token-reduction.test.js test/session-affinity.test.js test/cache-state.test.js test/cache-switch-cost.test.js test/lens-recommendations.test.js test/model-registry-cost.test.js test/output-format-guard.test.js test/tier-fallback.test.js test/wrap.test.js test/init.test.js test/tool-call-response-metadata.test.js test/degradation.test.js test/routing-telemetry-columns.test.js test/sticky-routing.test.js test/knn-ambiguous-escalate.test.js test/deescalator.test.js test/client-profiles.test.js test/openai-ingress-tool-injection.test.js test/tool-result-compression-gate.test.js test/strip-internal-fields.test.js test/complexity-tool-subtraction.test.js test/bandit.test.js test/routing-propensity.test.js test/reward-pipeline.test.js test/knn-cold-start.test.js test/calibration.test.js test/feedback-loop.test.js test/session-fingerprint.test.js test/side-request-guards.test.js test/verifier.test.js test/intent-score.test.js test/difficulty-classifier.test.js test/classifier-setup.test.js test/usage-stats.test.js test/loop-guard.test.js test/moonshot-model-mapping.test.js test/baidu-model-mapping.test.js test/tenant-policy-ingress-parity.test.js test/decide.test.js test/embeddings-degradation.test.js test/health-probe.test.js test/stuck-detector.test.js test/onnx-embedder.test.js test/ope.test.js test/hierarchical-budget.test.js test/token-rate-limit.test.js test/otel-export.test.js test/mcp-broker.test.js test/compression-budget.test.js test/gpt-utils.test.js test/dedup-observe-only.test.js test/context-window-header.test.js test/token-budget-auto.test.js test/opencode-setup.test.js test/auth-mode-first-party.test.js test/harness-envelope.test.js test/task-ledger.test.js test/jev-router.test.js test/jev-routing.test.js test/force-patterns.test.js test/upstream-fidelity.test.js test/tool-schema-compression.test.js test/passthrough-route.test.js test/quota-ledger.test.js test/shortfall-semantic.test.js test/routing-decisions.test.js test/routing-corpus.test.js test/switch-gate-grounding.test.js","test:quick":"LYNKR_KNN_DIR=/tmp/lynkr-test-knn DATABRICKS_API_KEY=test-key DATABRICKS_API_BASE=http://test.com node --test test/routing.test.js","postinstall":"node scripts/check-native.js","test:memory":"LYNKR_KNN_DIR=/tmp/lynkr-test-knn DATABRICKS_API_KEY=test-key DATABRICKS_API_BASE=http://test.com node --test test/memory/store.test.js test/memory/surprise.test.js test/memory/extractor.test.js test/memory/search.test.js test/memory/retriever.test.js test/memory/distiller.test.js test/memory/distiller-freeze.test.js test/memory/wiki.test.js test/memory/skills-cache.test.js test/memory/tencentdb-launcher.test.js","rebuild-native":"node scripts/check-native.js","test:benchmark":"LYNKR_KNN_DIR=/tmp/lynkr-test-knn DATABRICKS_API_KEY=test-key DATABRICKS_API_BASE=http://test.com node test/performance-benchmark.js","start:supervised":"while true; do node index.js 2>&1 | npx pino-pretty --sync; code=$?; echo \"[supervisor] lynkr exited ($code) — restarting in 3s\"; sleep 3; done","test:performance":"LYNKR_KNN_DIR=/tmp/lynkr-test-knn DATABRICKS_API_KEY=test-key DATABRICKS_API_BASE=http://test.com node test/hybrid-routing-performance.test.js && DATABRICKS_API_KEY=test-key DATABRICKS_API_BASE=http://test.com node test/performance-tests.js","seed:capabilities":"node scripts/seed-capabilities.js --refresh","test:new-features":"LYNKR_KNN_DIR=/tmp/lynkr-test-knn DATABRICKS_API_KEY=test-key DATABRICKS_API_BASE=http://test.com node --test test/passthrough-mode.test.js test/openrouter-error-resilience.test.js test/format-conversion.test.js"},"version":"10.0.1","_npmUser":{"name":"veerareddyvishal56","email":"veerareddyvishal56@gmail.com"},"homepage":"https://fast-editor.github.io/Lynkr/","keywords":["llm","llm-gateway","llm-proxy","llm-router","ai-gateway","tier-routing","claude","claude-code","anthropic","cursor","codex","openai","openrouter","ollama","llamacpp","lm-studio","bedrock","aws-bedrock","azure-openai","databricks","gemini","mcp","model-context-protocol","prompt-cache","self-hosted","litellm-alternative","portkey-alternative","copilot-alternative","classroom","education","tutoring","course-management","ai-education","socratic-method","solution-blocking"],"overrides":{"sharp":"^0.35.4","adm-zip":"^0.6.1"},"repository":{"url":"git+https://github.com/Fast-Editor/Lynkr.git","type":"git"},"_npmVersion":"11.16.0","description":"Self-hosted LLM gateway with classroom mode for educational use. Combines tier-routing (60-80% cost savings) with solution blocking, Socratic tutoring, course management, and audit trails for Claude Code.","directories":{},"maintainers":[{"name":"veerareddyvishal56","email":"veerareddyvishal56@gmail.com"}],"_nodeVersion":"26.3.0","allowScripts":{},"dependencies":{"diff":"^5.2.0","pino":"^8.17.2","chalk":"^4.1.2","dotenv":"^16.4.5","express":"^5.1.0","unzipper":"^0.12.5","cockatiel":"^3.2.1","pino-http":"^8.6.0","pino-roll":"^4.0.0","js-tiktoken":"^1.0.20","hnswlib-node":"^3.0.0","@toon-format/toon":"^2.1.0","express-rate-limit":"^8.2.1","@blackwell-systems/gcf":"2.4.0"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^8.57.0","nodemon":"^3.1.0","pino-pretty":"^10.2.0","@napi-rs/cli":"^3.6.2"},"optionalDependencies":{"dockerode":"^5.0.1","tree-sitter":"^0.21.1","better-sqlite3":"^12.11.1","tree-sitter-python":"^0.21.0","tree-sitter-javascript":"^0.21.0","tree-sitter-typescript":"^0.21.0","@huggingface/transformers":"^4.2.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/lynkr-classroom_10.0.1_1792790835585_0.06589148142423684"}}},"time":{"created":"2026-10-23T21:19:48.847Z","modified":"2026-10-23T21:27:15.935Z","0.0.0-stage":"2026-10-23T21:19:48.847Z","10.0.0":"2026-10-23T21:21:58.287Z","10.0.1":"2026-10-23T21:27:15.764Z"},"bugs":{"url":"https://github.com/Fast-Editor/Lynkr/issues"},"author":{"name":"Vishal Veera Reddy"},"license":"Apache-2.0","homepage":"https://fast-editor.github.io/Lynkr/","keywords":["llm","llm-gateway","llm-proxy","llm-router","ai-gateway","tier-routing","claude","claude-code","anthropic","cursor","codex","openai","openrouter","ollama","llamacpp","lm-studio","bedrock","aws-bedrock","azure-openai","databricks","gemini","mcp","model-context-protocol","prompt-cache","self-hosted","litellm-alternative","portkey-alternative","copilot-alternative","classroom","education","tutoring","course-management","ai-education","socratic-method","solution-blocking"],"repository":{"url":"git+https://github.com/Fast-Editor/Lynkr.git","type":"git"},"description":"Self-hosted LLM gateway with classroom mode for educational use. Combines tier-routing (60-80% cost savings) with solution blocking, Socratic tutoring, course management, and audit trails for Claude Code.","maintainers":[{"name":"veerareddyvishal56","email":"veerareddyvishal56@gmail.com"}],"readme":"# Lynkr Classroom\n\n**Complete LLM Gateway + Educational Classroom Mode**\n\nCombines Lynkr's powerful tier-routing gateway (60-80% cost savings) with built-in classroom mode for educational use. Perfect for CS professors teaching with AI assistants.\n\n### 🎓 Classroom Features\n- **Solution Blocking** — Prevents students from getting complete code solutions\n- **Socratic Tutoring** — Guides students with hints instead of answers\n- **Course Management** — Plugin system for assignment delivery and tracking\n- **Audit Trails** — NDJSON logs of all student interactions\n- **Course Generator** — Interactive CLI to create course plugins\n- **Tool Guards** — Block file edits on assignment code\n\n### 🚀 Gateway Features (from Lynkr)\n- **Tiered Routing** — 60-80% cost savings via smart model routing\n- **14+ LLM Providers** — AWS Bedrock, OpenRouter, Databricks, Azure, Ollama, and more\n- **Token Optimization** — 84% compression on JSON, 53% on tool calls\n- **Semantic Caching** — Sub-300ms cache hits\n- **MCP Tools** — Full tool use support\n\n[![npm version](https://img.shields.io/npm/v/lynkr.svg)](https://www.npmjs.com/package/lynkr)\n[![Tests](https://img.shields.io/badge/tests-1249%20passing-brightgreen)](https://github.com/Fast-Editor/Lynkr)\n[![License: Apache 2.0](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)\n[![Node.js](https://img.shields.io/badge/node-20%2B-green)](https://nodejs.org)\n[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/Fast-Editor/Lynkr)\n\n<table>\n<tr>\n<td align=\"center\"><strong>84%</strong><br/>JSON Compression</td>\n<td align=\"center\"><strong>53%</strong><br/>Tool Token Reduction</td>\n<td align=\"center\"><strong>&lt;300ms</strong><br/>Semantic Cache Hits</td>\n<td align=\"center\"><strong>14+</strong><br/>LLM Providers</td>\n<td align=\"center\"><strong>0</strong><br/>Code Changes Required</td>\n</tr>\n</table>\n\n> Numbers from the bundled benchmark against LiteLLM on identical free local backends — run it yourself: `node benchmark-tier-routing.js`. It doubles as a 19-scenario routing regression harness (currently 12/12 correctness checks), and `MODE=routing` runs a routing-only head-to-head that judges **both** proxies on the same acceptable-tier sets — including LiteLLM's Auto Router v2. [How it works →](docs/benchmarking.md)\n\n> **Agentic benchmark (Terminal-Bench core, 80 tasks, Oct 2026):** Lynkr **42/80 for $1.54** vs openrouter/auto **44/80 for $4.72** on the same VM and evening — tied on accuracy within single-run noise (Lynkr's three runs: 39, 39, 42) at ~30% of the cost; vLLM Semantic Router on the same models/hosts: 25/80 (34 agent timeouts from unbounded upstream stalls and per-turn CPU classification). [Full comparison, fairness notes and what it changed in Lynkr →](docs/terminal-bench-router-comparison.md)\n\n> **Third-party benchmark:** on [RouterArena](https://github.com/RouteWorks/RouterArena) (ICLR 2026, 8,400 queries) Lynkr's routing scores **67.65 arena / 68.41% accuracy at $0.29 per 1K queries with 92.38 robustness** — above GPT-5's built-in router and NotDiamond at a fraction of their cost. [Methodology & caveats →](docs/routerarena-benchmark.md)\n\n---\n\n## 🎓 Quick Start (Professors)\n\n**Set up a course for your students in 5 minutes:**\n\n```bash\n# Install\nnpm install -g lynkr-classroom\n\n# Generate a course interactively\nlynkr-classroom generate-course\n\n# Get a shareable command for students\nlynkr-classroom wrap claude --course file://./your-course.zip\n```\n\n**Your students get:**\n- Hints and guidance, not complete solutions\n- Can't directly edit assignment files\n- All interactions audited for your review\n\n**You get:**\n- NDJSON audit logs at `~/.lynkr/classroom/audit-{courseId}.jsonl`\n- Insights into student problem-solving patterns\n- Full control over tutoring style and grading rubric\n\n---\n\n## 🚀 Wrap Mode for AI Coding Tools\n\n**Use Lynkr's routing with your AI coding assistant — maximize your subscription value:**\n\n```bash\nnpm install -g lynkr-classroom\n\n# Claude Code with classroom mode\nlynkr-classroom wrap claude\n\n# With a course (for professors)\nlynkr-classroom wrap claude --course file://./cs101.zip\n```\n\n**Wrapping gives you:**\n- ✅ Tier routing (send simple tasks to free Ollama, complex to your subscription/API)\n- ✅ Sticky sessions: one routing decision per conversation via content fingerprinting, with automatic escalation when the task outgrows the model\n- ✅ TOON/RTK compression (84% token reduction on large JSON tool outputs)\n- ✅ Semantic caching (sub-300ms cache hits, 0 tokens billed)\n- ✅ **Your subscription is used only where it counts** — simple requests route to your own local/API models, so subscription capacity goes to the work that needs it\n- ✅ **Classroom mode** (optional) — Solution blocking and tutoring for educational use\n- ✅ Works with OAuth (Claude, Copilot, Cursor) or API keys (Aider, Codex)\n\n[Full wrap guide →](docs/wrap-guide.md)\n\n---\n\n## Quick Start (2 Minutes)\n\n### 1. Install Lynkr\n\n```bash\nnpm install -g lynkr\n```\n\n### 2. Configure Lynkr\n\nThe fastest path is the interactive wizard:\n\n```bash\nlynkr init\n```\n\nIt asks four questions — usage mode (Claude Pro/Max via wrap, or direct API keys), tier picks for SIMPLE/MEDIUM/COMPLEX/REASONING across the 14 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, rate limiting).\n\nUseful flags:\n\n```bash\nlynkr init --force                # overwrite an existing .env\n```\n\nSee [`docs/init.md`](docs/init.md) for the full wizard reference.\n\nIf you'd rather configure by hand, the manual options below still work — copy `.env.example` to `.env` and edit it directly:\n\n**Option A: Free & Local (Ollama) - Recommended for Testing**\n\n```bash\n# Install Ollama first: https://ollama.com\nollama pull qwen2.5-coder:latest\n```\n\n\nThen start Lynkr:\n\n```bash\nlynkr start\n```\n\n### 3. Connect Your Tool\n\n\n**Cursor IDE**\n- Settings → Models → Override Base URL\n- Set to: `http://localhost:8081/v1`\n- API Key: `any-value`\n\n**Codex CLI**\n\nEdit `~/.codex/config.toml`:\n```toml\nmodel_provider = \"lynkr\"\n\n[model_providers.lynkr]\nbase_url = \"http://localhost:8081/v1\"\nwire_api = \"responses\"\n```\n\n✅ **Done!** Your AI tool now uses your chosen provider.\n\n---\n\n## Common Startup Errors\n\n### Error: `unable to determine transport target for \"pino-pretty\"`\n\n**Problem:** You're running an older version (< 9.3.0).\n\n**Solution:** Update to the latest version:\n```bash\nnpm install -g lynkr@latest\n```\n\nIf you must use an older version, set `NODE_ENV=production` before starting.\n\n### Warning: `Missing tier configuration: TIER_SIMPLE, TIER_MEDIUM...`\n\n**This is just a warning - you can ignore it.** Tier routing is optional.\n\nTo remove the warning, add to `.env`:\n```bash\nTIER_SIMPLE=ollama:qwen2.5-coder:latest\nTIER_MEDIUM=ollama:qwen2.5-coder:latest\nTIER_COMPLEX=ollama:qwen2.5-coder:latest\nTIER_REASONING=ollama:qwen2.5-coder:latest\n```\n\n### Warning: `FALLBACK_PROVIDER='databricks' is enabled but missing credentials`\n\n**Solution:** Add to `.env`:\n```bash\nFALLBACK_ENABLED=false\n```\n\n### Error: `connect ECONNREFUSED ::1:11434` (Ollama)\n\n**Problem:** Ollama is not running.\n\n**Solution:**\n```bash\nollama serve\n```\n\nKeep this terminal open, and start Lynkr in a new terminal.\n\n### Error: `Connection refused` or `404 Not Found`\n\n**Problem:** Lynkr is not running or wrong port.\n\n**Solution:** Check Lynkr is running on the correct port:\n```bash\ncurl http://localhost:8081/\n```\n\nShould return: `{\"service\":\"Lynkr\",\"version\":\"9.x.x\",\"status\":\"running\"}`\n\n---\n\n## Why Lynkr?\n\nAI coding tools lock you into one provider and send every token raw. Lynkr breaks both locks.\n\n```\nClaude Code / Cursor / Codex / Cline / Continue\n                    ↓\n                  Lynkr\n          ┌─────────────────────┐\n          │  Strip unused tools  │  ← 53% fewer tokens on tool calls\n          │  Compress JSON blobs │  ← 84% on large tool results\n          │  Semantic cache      │  ← <300ms hits, 0 tokens billed\n          │  Route by complexity │  ← cheap model for simple, cloud for hard\n          │  Learn from outcomes │  ← kNN + bandit + auto-calibration\n          └─────────────────────┘\n                    ↓\n    Ollama | Bedrock | Azure | Moonshot | OpenRouter | OpenAI\n```\n\n**What you get:**\n- ✅ **53% fewer tokens** on tool-heavy requests (Claude Code, Cursor sessions)\n- ✅ **84% compression** on large JSON tool results (grep, file reads, test output)\n- ✅ **Semantic cache** serves repeated queries in under 300ms with 0 tokens billed\n- ✅ **Automatic tier routing** — simple questions go to cheap models, complex ones escalate; sessions stick to one model until the task genuinely outgrows it\n- ✅ **A closed learning loop** — every outcome trains a kNN router and bandit, and tier thresholds re-calibrate nightly from your own traffic\n- ✅ Route through **your company's infrastructure** (Databricks, Azure, Bedrock)\n- ✅ **Zero code changes** — just change one environment variable\n\n---\n\n## Supported Providers\n\n| Provider | Type | Example Models | Cost |\n|----------|------|---------------|------|\n| **Ollama** | Local | qwen2.5-coder, deepseek-coder, llama3 | **Free** |\n| **llama.cpp** | Local | Any GGUF model | **Free** |\n| **LM Studio** | Local | Local models with GUI | **Free** |\n| **OpenRouter** | Cloud | GPT-4o, Claude 3.5, Llama 3, Gemini | $ |\n| **OrcaRouter** | Cloud | Chat, reasoning, image, video (one endpoint, live catalog) | $ (zero-markup) |\n| **AWS Bedrock** | Cloud | Claude, Llama, Mistral, Titan | $$ |\n| **Databricks** | Cloud | Claude Sonnet 4.5, Opus 4.6 | $$$ |\n| **Azure OpenAI** | Cloud | GPT-4o, o1, o3 | $$$ |\n| **Azure Anthropic** | Cloud | Claude Sonnet, Opus | $$$ |\n| **OpenAI** | Cloud | GPT-4o, o3-mini | $$$ |\n| **Atlas Cloud** | Cloud | Qwen, DeepSeek, and other OpenAI-compatible models | $-$$$ |\n| **DeepSeek** | Cloud | DeepSeek R1, Reasoner | $ |\n| **Z.ai** | Cloud | GLM-4.7, GLM-4.5-Air | $ |\n| **Moonshot AI** | Cloud | Kimi K2.6, Kimi K3 | $ |\n| **Baidu Qianfan** | Cloud | ERNIE 4.5 Turbo, ERNIE X1.1 | $ (unverified — not yet probed against a live key) |\n| **Fireworks AI** | Cloud | Kimi K2, GLM-5, DeepSeek V3 (serverless) | $ (unverified — not yet probed against a live key) |\n\n**4 local providers** for 100% offline, free usage. **14+ cloud providers** for scale.\n\n<div align=\"center\">\n  <a href=\"https://www.atlascloud.ai/?utm_source=github&amp;utm_medium=readme&amp;utm_campaign=lynkr\">\n    <picture>\n      <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://www.atlascloud.ai/logo-white.svg\">\n      <img src=\"https://www.atlascloud.ai/logo.svg\" alt=\"Atlas Cloud\" width=\"196\">\n    </picture>\n  </a>\n  <br>\n  <sub>Use Lynkr with Atlas Cloud's OpenAI-compatible API and route across its live model catalog with one optional provider configuration. <a href=\"https://www.atlascloud.ai/?utm_source=github&amp;utm_medium=readme&amp;utm_campaign=lynkr\">Explore Atlas Cloud</a>.</sub>\n</div>\n\n---\n\n## Advanced: Tier Routing (Save Even More)\n\nRoute different request types to different models automatically:\n\n```bash\n# .env file\nMODEL_PROVIDER=ollama\nFALLBACK_ENABLED=false\n\n# Use small/fast models for simple tasks\nTIER_SIMPLE=ollama:qwen2.5:3b\n\n# Use medium models for normal coding\nTIER_MEDIUM=ollama:qwen2.5:7b\n\n# Use powerful models for complex architecture\nTIER_COMPLEX=ollama:deepseek-r1:14b\nTIER_REASONING=ollama:deepseek-r1:14b\n\n# Optional: Limits (remove for unlimited) for long conversations\nPOLICY_MAX_STEPS=50\nPOLICY_MAX_TOOL_CALLS=100\n```\n\nLynkr analyzes each request and routes it to the appropriate tier. Simple questions use fast models. Complex refactoring uses powerful models. The scorer combines anchor-embedding classification (WS7, payload-invariant) with an LLM difficulty classifier (Phase 6, added 2026-07-19) that catches topic-vs-difficulty confounding — `list the exports from this file` correctly routes to MEDIUM instead of getting boosted to REASONING by \"technical vocabulary\" alone.\n\n**Result:** 70-90% of requests use cheaper/faster models. Only hard problems hit expensive models. **15× reduction in expensive-tier over-routing** vs the anchor-only baseline on the 381-prompt eval set (0.6% vs ~15%).\n\nTier configuration is strictly authoritative — bandit exploration is constrained to the models you've listed in `TIER_*`, and multi-turn conversations score with a recency-weighted sliding window so context isn't lost on short follow-ups. Conversations get a content-fingerprint session id (clients like Claude Code send none), the decision pins for the session, and a guarded escape ladder (risk keywords, force phrases, score drift, context overflow) re-escalates the moment a task outgrows its model. Full pipeline: [`docs/routing-intelligence.md`](docs/routing-intelligence.md) · intent scorer: [`docs/intent-window-routing.md`](docs/intent-window-routing.md) · verify any change: [`docs/benchmarking.md`](docs/benchmarking.md).\n\n---\n\n\n## Common Issues & Fixes\n\n| Issue | Solution |\n|-------|----------|\n| **\"Service temporarily overloaded\"** | Ollama model too large for RAM. Use smaller model or increase `--max-old-space-size` |\n| **\"Route not found: HEAD /\"** | Ignore - harmless health check from Claude Code |\n| **\"Hallucinated tool calls\"** | Normal - Lynkr automatically filters invalid tools |\n| **\"Safe Command DSL blocked\"** | Add `POLICY_SAFE_COMMANDS_ENABLED=false` to `.env` |\n| **\"spawn graphify ENOENT\"** | Optional feature. Set `CODE_GRAPH_ENABLED=false` in `.env` (see Advanced Features section for installation) |\n| **Slow first request (20+ sec)** | Ollama loading model into memory. Add `OLLAMA_KEEP_ALIVE=30m` in Ollama config |\n| **No response after N turns** | Remove `POLICY_MAX_STEPS` and `POLICY_MAX_TOOL_CALLS` from `.env` (unlimited by default in v9.3.0+) |\n\n---\n\n## Advanced Features\n\n### Real-time SSE streaming (all tiers)\n\nResponses stream token-by-token instead of arriving all at once — including\nthrough the tier router. Two mechanisms, both on by default:\n\n- **Native passthrough**: when the upstream already speaks Anthropic SSE\n  (Anthropic endpoints, Z.AI, Ollama v0.14+), Lynkr pipes the bytes straight\n  through with backpressure. Kill switch: `LYNKR_NATIVE_PASSTHROUGH=false`.\n- **Cross-format transform**: OpenAI-format upstreams (OpenAI, Azure OpenAI,\n  OpenRouter, Databricks, llama.cpp, LM Studio) are reshaped into Anthropic\n  events in flight — including reassembling tool-call argument fragments into\n  clean `tool_use` blocks. Kill switch: `LYNKR_STREAM_TRANSFORM=false`.\n\nThe `LYNKR_VISIBLE_ROUTING` badge streams too (injected as the first content\nblock), and telemetry is recorded on stream close with real token counts.\nFallback safety: if an upstream fails before the first byte, the request\nfalls back to the buffered path automatically.\n\n```bash\n# Ollama thinking models (MiniMax): streaming skips the <think>-leak repair.\n# If you see raw <think> text in responses, buffer that provider instead:\nLYNKR_OLLAMA_BUFFER_RESPONSES=true   # default true; false = stream Ollama\n```\n\n### Token Optimization (60-80% savings)\n```bash\n# Enable all optimizations\nPROMPT_CACHE_ENABLED=true\nSEMANTIC_CACHE_ENABLED=true\n```\n\nAlways-on (no config): **RTK tool-result compression**\n(test/git/grep/lint/build/JSON output), **MCP tool dedup** (drops\nbuilt-in WebSearch/WebFetch when an Exa/Tavily MCP tool is present), and\n**request bypass** (Claude CLI Warmup / title-extraction calls are answered\nlocally, never hitting a provider).\n\nOptional **terse-output mode** to cut *output* tokens:\n```bash\nCAVEMAN_ENABLED=true        # off by default — nudges the model to be concise\nCAVEMAN_LEVEL=lite          # lite | full | ultra\n```\n\n### Built-in dashboard\n\nOpen `http://localhost:8081/dashboard` while Lynkr is running. No setup, reads\nthe local telemetry store:\n\n- **Spend & savings** — actual cost vs what the same traffic would have cost\n  on the flagship model (the counterfactual no pass-through gateway can show,\n  since they neither pick your model nor see local-model traffic)\n- **Tier mix** — daily request breakdown across SIMPLE/MEDIUM/COMPLEX/REASONING\n- **Routing accuracy** — over-/under-provisioned request counts, a self-audit\n  of the tier router's decisions\n- **Request logs** — filterable by provider, tier, and errors, with latency,\n  tokens, and cost per request; every session id links to a drill-down\n- **Provider health** — configured providers, credential warnings, circuit\n  breaker states\n- **Insights** — analyzer findings ranked by *past overspend* (auditable\n  against spend already recorded, never projected savings): dead tool\n  schemas paying rent, harness side-traffic served on expensive tiers,\n  weak prompt-cache hit ratios, and Wilson-bounded tier-downsize verdicts.\n  Each finding ships its evidence rows, the fix, the caveat, and how the\n  figure was computed. \"Not measured yet\" is rendered distinctly from\n  zero — an un-run scan is not an all-clear.\n- **Explore** — a Metric × Dimension (× Stack) pivot over routing telemetry\n  (spend/tokens/requests/sessions by provider, model, tier, request type,\n  day…) with preset views, period-over-period deltas, and CSV export\n- **Session drill-down** — per-model cost mix and an input-context-per-call\n  chart where distillation and cache behavior are directly visible\n- **Cache receipts** — projected switch/hold economics from cache-aware\n  routing next to the *measured* companion (dollars saved by cache reads\n  actually served)\n\nJSON APIs behind it\n(`/dashboard/api/overview|usage|routing|logs|recommendations|analytics|sessions/:id|statusline`)\nif you want the raw numbers.\n\n### Status line for Claude Code\n\nOne line after every turn — routed tier, served model, today's spend, and\ncache re-read share — with zero token cost (out-of-band, never enters model\ncontext). Add to `~/.claude/settings.json`:\n\n```json\n\"statusLine\": { \"type\": \"command\", \"command\": \"lynkr-statusline\" }\n```\n\n```\n◆ Opus 4.8 · MEDIUM → minimax-m3:cloud (ollama) · today $0.06 · cache 67%\n```\n\nAlways prints exactly one line and always exits 0 — a down proxy can never\nbreak the harness. Set `LYNKR_PORT` if Lynkr isn't on 8081.\n\n### Cost tracking & model pricing\nPer-request cost is computed from a model-pricing registry (LiteLLM → models.dev,\ncached 24h) and recorded in telemetry. Models the registry doesn't know record\n`cost_usd=null` (logged once) rather than a fabricated price. Pin prices for\nunknown models:\n```bash\n# Per-1M-token USD prices, JSON keyed by model name\nMODEL_PRICE_OVERRIDES={\"my-model\":{\"input\":0.5,\"output\":1.5}}\n```\n\n### Memory System (Titans-inspired)\n```bash\nMEMORY_ENABLED=true\nMEMORY_TTL=3600000  # 1 hour\n```\n\n### Load Shedding & Resilience\n```bash\nLOAD_SHEDDING_ENABLED=true\nLOAD_SHEDDING_HEAP_THRESHOLD=0.85\n```\n\n### Admin Hot-Reload (no restart needed)\n```bash\ncurl -X POST http://localhost:8081/v1/admin/reload\n```\n\n### Code Intelligence (Optional - Graphify)\n\n**Graphify** provides AST-based code analysis for smarter routing decisions.\n\n**Installation (Rust required):**\n```bash\n# Install Rust if not already installed\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\nsource $HOME/.cargo/env\n\n# Build and install graphify\ngit clone https://github.com/safishamsi/graphify\ncd graphify\ncargo build --release\nsudo cp target/release/graphify /usr/local/bin/\n\n# Verify installation\ngraphify --version\n```\n\n**Enable in `.env`:**\n```bash\nCODE_GRAPH_ENABLED=true\nCODE_GRAPH_WORKSPACE=/path/to/your/project  # Optional, defaults to cwd\n```\n\n**Features:**\n- AST-based complexity scoring\n- Structural code analysis (19 languages supported)\n- Enhanced routing decisions based on code structure\n\n**Note:** Graphify is completely optional. If not installed, Lynkr falls back to simpler complexity analysis.\n\n---\n\n## Installation Methods\n\n**NPM (recommended)**\n```bash\nnpm install -g lynkr\n```\n\n**One-line installer**\n```bash\ncurl -fsSL https://raw.githubusercontent.com/Fast-Editor/Lynkr/main/install.sh | bash\n```\n\n**Homebrew** (macOS / Linux)\n```bash\nbrew tap fast-editor/lynkr\nbrew install lynkr\nlynkr --version\n```\nUpgrade later with `brew update && brew upgrade lynkr`. The formula tracks the latest [`lynkr` npm release](https://www.npmjs.com/package/lynkr) automatically.\n\n**Docker**\n```bash\ngit clone https://github.com/Fast-Editor/Lynkr.git\ncd Lynkr\ndocker-compose up -d\n```\n\n**From source**\n```bash\ngit clone https://github.com/Fast-Editor/Lynkr.git\ncd Lynkr\nnpm install\ncp .env.example .env\nnpm start\n```\n\n---\n\n## Documentation\n\n| Guide | Description |\n|-------|-------------|\n| [Installation](documentation/installation.md) | All installation methods |\n| [Provider Setup](documentation/providers.md) | Configuration for all 12+ providers |\n| [Claude Code](documentation/claude-code-cli.md) | Claude Code CLI integration |\n| [Cursor IDE](documentation/cursor-integration.md) | Cursor setup + troubleshooting |\n| [Codex CLI](documentation/codex-cli.md) | Codex configuration |\n| [Tier Routing](documentation/routing.md) | Smart model routing by complexity |\n| [Token Optimization](documentation/token-optimization.md) | 60-80% cost reduction |\n| [Troubleshooting](documentation/troubleshooting.md) | Common issues and solutions |\n| [API Reference](documentation/api.md) | REST API endpoints |\n| [Production](documentation/production.md) | Enterprise deployment |\n\n---\n\n## Benchmark Results\n\nHead-to-head against **LiteLLM** on the **same backends** (Ollama `minimax-m2.5`, Moonshot, Azure OpenAI), 9 scenarios across 4 feature categories. Apples-to-apples comparison is Lynkr vs LiteLLM **billed tokens on the same scenario**. Run with `node benchmark-tier-routing.js`.\n\n> _Runs: token benchmarks — June 5, 2026 (Lynkr v9.3.2 · LiteLLM v1.87.1). Tier routing head-to-head — **re-run July 19, 2026** (Lynkr working tree w/ Phase-6 classifier + config B · LiteLLM v1.94.0.dev1 Auto Router v2). macOS, Apple Silicon._\n\n### Token reduction (vs LiteLLM, same model & prompt)\n\n| Mechanism | Lynkr | LiteLLM | Result |\n|---|---|---|---|\n| TOON compression (60-item grep JSON) | **427** tokens · $0.009 | 3,458 tokens · $0.018 | **87.6% fewer tokens, 50% cheaper** |\n\nLynkr binary-compresses large JSON tool results (TOON) in-process, with no added latency.\n\n### Semantic cache\n\n| | Tokens billed | Response time |\n|---|---|---|\n| First call (cold) | 2,857 | 1,891ms |\n| **Second call — paraphrased, cache hit** | **0** (served from cache) | **171ms (11× faster)** |\n\nNear-identical prompts return cached responses in 171ms. Zero model tokens billed on a cache hit.\n\n### Tier routing — vs LiteLLM Auto Router v2 (re-run July 19, 2026)\n\nLiteLLM v1.94 shipped a native complexity router (`auto_router/complexity_router`) with the same four tier names Lynkr uses. Head-to-head on the **same backends** with identical prompts, both proxies live, both judged against the same acceptable-tier sets (11 routing scenarios, `MODE=routing node benchmark-tier-routing.js`, LiteLLM config in `litellm-autorouter-v2.yaml`):\n\n| Router | Routing-correct | Notes |\n|---|---|---|\n| **Lynkr (Phase-6 classifier + config B)** | **11/11 ✅** | anchor embedding + local LLM classifier reconcile + FORCE_REASONING patterns + risk-remap; ~500ms warm classifier call, cached |\n| LiteLLM v2 — heuristic (default) | **4/11** | every miss *under-routed* — banking security analysis, whole-pipeline refactor, prod auth-file fix, autonomous agentic loop all sent to a 7B local model |\n| LiteLLM v2 — LLM classifier | 6–8/11 (non-deterministic) | paid GPT-5.2 call + ~2–3s on **every** request; fails outright with local classifier models |\n\n**The 7 requests LiteLLM v2 misroutes to a 7B ollama model (should be COMPLEX or REASONING):**\n\n| What you typed | Lynkr sends to | LiteLLM sends to |\n|---|---|---|\n| \"Analyse security trade-offs of JWT vs httpOnly cookies for a banking app\" | Claude Opus (top) | **ollama 7B** ❌ |\n| \"Refactor the entire ingestion pipeline and give me the plan\" | z.ai GLM-5.2 (mid) | **ollama 7B** ❌ |\n| \"Fix the null-check bug in `src/auth/middleware.ts`\" | Claude Opus (risk-remap) | **ollama 7B** ❌ |\n| \"Figure out why this test is flaky. You have full autonomy — iterate until 10 runs pass\" | Claude Opus (autonomous) | **ollama 7B** ❌ |\n| \"please summarize the exports of this file quickly\" | ollama minimax (correct — MEDIUM) | ollama minimax — but for the wrong reason (LiteLLM under-routed to SIMPLE) |\n\nLynkr layers the following, in decreasing priority, to catch every miss LiteLLM leaks:\n\n- FORCE_REASONING regex (`ultrathink`, `prove`, `security audit`, `from first principles`) → deterministic top-tier\n- Risk classifier (auth/middleware/credentials paths) → REASONING under config B\n- Agentic detector (`AUTONOMOUS` workflows) → REASONING minimum\n- Anchor-embedding classifier over 4 difficulty classes + FRONTIER_MIN_SIM floor\n- Local LLM classifier (qwen2.5:3b) reconciles borderline anchor calls\n- Envelope invariance — scores cleaned user text only, ignoring tool schemas / history / system-reminders\n\nLiteLLM's router reads the raw last message with no envelope-stripping, no verify-then-escalate cascade, no risk classifier, no agentic detection — its fallbacks trigger only on HTTP errors, never on a bad answer.\n\n_Fairness notes: the 11 scenarios derive from Lynkr's own regression suite, so Lynkr has home-field advantage — the transferable finding is the **direction** of LiteLLM's failures (systematic under-routing to cheap on hard prompts), not the exact scores. Lynkr's top tiers used Claude Opus 4.8 / z.ai GLM-5.2; LiteLLM was given the identical tier targets._\n\n### Cost projection (100,000 requests/month, same backend)\n\n**Direct cost (raw meter):**\n\n| | Monthly cost | vs LiteLLM |\n|---|---|---|\n| LiteLLM (TOON tool-heavy scenario) | ~$818 | baseline |\n| **Lynkr (TOON tool-heavy)** | **~$409** | **~50% cheaper** via token optimization |\n\n**Effective cost per correct-tier answer** (July 19 head-to-head, all 11 routing scenarios):\n\n| | Direct $/mo | Effective $/mo if you re-issue misroutes at correct tier |\n|---|---|---|\n| **Lynkr** | ~$5.50 (spends where it should, doesn't where it shouldn't) | ~$5.50 |\n| LiteLLM v2 heuristic | $0 (under-routes everything to ollama) | ~$89 (7 misroutes need re-issue on Moonshot/COMPLEX) |\n\nThe story isn't \"Lynkr always spends less.\" It's **Lynkr spends where it should and doesn't where it shouldn't**. LiteLLM's zero-dollar cost on complex prompts is bought with wrong-tier answers to hard work — a 7B model answering \"prove this rate limiter is fair under concurrent refill\" is silent quality collapse, not a savings.\n\n→ [Full benchmark report with methodology](BENCHMARK_REPORT.md)\n\n---\n\n## Cost Comparison\n\n| Scenario | Direct Anthropic | Lynkr + Ollama | Lynkr + OpenRouter |\n|----------|-----------------|----------------|-------------------|\n| Daily coding (8h) | $10-30/day | **$0 (free)** | $2-8/day |\n| Monthly (heavy use) | $300-900 | **$0** | $60-240 |\n\nWith tier routing + token optimization: **additional 50-87% savings** on cloud providers depending on workload.\n\n---\n\n## Why Lynkr vs Alternatives\n\n| Feature | Lynkr | LiteLLM | OpenRouter | PortKey |\n|---------|-------|---------|-----------|---------|\n| **Setup** | `npm install -g lynkr` | Python + Docker + Postgres | Account signup | Docker stack |\n| **Claude Code native** | ✅ Drop-in | ⚠️ Requires config | ❌ | ⚠️ Partial |\n| **Cursor native** | ✅ Drop-in | ⚠️ Partial | ❌ | ⚠️ Partial |\n| **Local models** | Ollama, llama.cpp, LM Studio | Ollama only | ❌ | ❌ |\n| **Automatic tier routing** | ✅ embedding intent + 13-dimension scorer, verified cascade | ⚠️ Auto Router v2 (v1.94): heuristic under-routes, LLM classifier billed per request | ❌ | ❌ Manual metadata |\n| **TOON JSON compression** | ✅ up to 87.6% | ❌ | ❌ | ❌ |\n| **Upstream SSE streaming** | ✅ native passthrough + cross-format transform | ⚠️ passthrough only | ✅ | ⚠️ |\n| **Semantic cache** | ✅ 171ms hits, 0 tokens | ❌ | ❌ | ✅ Prompt cache only |\n| **Savings & routing dashboard** | ✅ spend, savings vs flagship, tier mix, routing accuracy, request logs, pivot explorer, session drill-down | ⚠️ spend UI only | ⚠️ usage page | ✅ observability suite (no routing accuracy) |\n| **Cost recommendations** | ✅ evidence-backed findings (dead tool schemas, side-traffic, cache weak spots, Wilson-proven downsizes) ranked by past overspend | ❌ | ❌ | ⚠️ alerts, no findings |\n| **Long-term memory** | ✅ SQLite, per-session | ❌ | ❌ | ❌ |\n| **MCP integration** | ✅ | ❌ | ❌ | ❌ |\n| **Self-hosted** | ✅ Node.js only | ✅ Python stack | ❌ SaaS | ✅ Docker |\n| **Dependencies** | Node.js 20+ | Python, Prisma, PostgreSQL | None | Docker, Python |\n\n**Lynkr's edge:** Purpose-built for AI coding tools. Compresses tokens before they reach the model — not just after. Zero-config for Claude Code, Cursor, and Codex. Installs in one command.\n\n---\n\n## Community\n\n- [GitHub Discussions](https://github.com/Fast-Editor/Lynkr/discussions) — Ask questions\n- [Report Issues](https://github.com/Fast-Editor/Lynkr/issues) — Bug reports\n- [NPM Package](https://www.npmjs.com/package/lynkr) — Official releases\n- [DeepWiki](https://deepwiki.com/Fast-Editor/Lynkr) — AI-powered docs\n\nThis project follows our [Code of Conduct](CODE_OF_CONDUCT.md) — it applies in\nall project spaces, and it tells you exactly how to report a problem.\n\n---\n\n## License\n\nApache 2.0 — See [LICENSE](LICENSE).\n\n---\n\n**Built by [Vishal Veera Reddy](https://github.com/vishalveerareddy123) for developers who want control over their AI tools.**\n","readmeFilename":"README.md"}