infosave2007/cortiq-router--packages-dsh-llm-cortiq-router ↗★ 0
cortiq-dsh-llm-router
Умный маршрутизатор LLM-запросов для DeepSeek Harness (dsh). Классифицирует каждый промпт по типу задачи (code, math, translation и др.) и сложности (low/medium/high) через семантический роутер allaigate.com, затем делегирует вызов тому провайдеру, который обслуживает выбранную модель. Один ключ — правильная модель для каждой задачи; настраиваемые правила маршрутизации и пороги сложности.
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:infosave2007/cortiq-router#8df2a0575c58c43b3d0dca45ebc0da87e8620411&path:packages/dsh-llm-cortiq-router说明文档
阅读完整 README ↗cortiq-dsh-llm-router 🧠✨
Your LLMs on autopilot. One key — every prompt is automatically dispatched to the best model.
Stop guessing which model to pick. Just type — the plugin figures out where to send each request.
🚀 Quick Start (1 minute)
dsh plugin add cortiq-dsh-llm-router
# Go to Settings → Models → Cortiq Router, paste your key
# Then pick "Cortiq Router · Auto" in the chat model selector
Done. The plugin handles everything from here.
One prerequisite: the router picks among the models your other provider plugins already serve (e.g.
llm-deepseek). Keep at least one of them configured — the router never talks to a model vendor itself.
🎁 Free Trial
Get a free key for 1 month — no payment required.
👉 allaigate.com — sign up and get a cortiq_… key instantly.
No promo code needed. After the trial, plans start at just $1/month.
💰 What does it cost?
| Without plugin | With plugin |
|---|---|
| All requests go to expensive models | Simple requests → cheap model |
| Overpay 10–50× | Save up to 90% |
| Manual model selection every time | Fully automatic |
🎯 What it does
The plugin is a smart dispatcher for your LLMs. It reads every prompt, understands what you're asking, and routes it to the right model.
Live example
You type: "Write a Python function to reverse a linked list"
| Without plugin | With plugin |
|---|---|
| 🤷♂️ Have to pick a model yourself | 🔍 Router: "This is code, low complexity (0.29)" |
| 🎲 Guess: DeepSeek V4 Pro ($) | 🧠 Rule: code @ low → fast model |
| Response in 3s, paid $0.01 | ⚡ Response in 0.5s, free |
But: "Implement a distributed consensus algorithm"
| Without plugin | With plugin |
|---|---|
| 🤷♂️ Guess again | 🔍 Router: "This is code, high complexity (0.78)" |
| Maybe Flash is enough? | 🚀 Escalation: hard request → powerful model |
| Response might be bad | ✅ Strong model handles it well |
⚙️ What can you configure?
Complexity thresholds
complexityBands:
low: 0.35 # score ≤ 0.35 → simple task
medium: 0.65 # ≤ 0.65 → medium, > 0.65 → hard
Which models at which complexity
globalTiers:
low: [deepseek-v4-flash] # simple → fast & cheap
medium: [deepseek-v4-pro] # medium → more powerful
high: [deepseek-v4-pro] # hard → strongest
Per-task rules
taskRules:
code:
low: [deepseek-v3-chat] # simple code → fast model
high: [deepseek-v4-pro] # complex code → powerful model
translation: [deepseek-v3-chat] # simple form: same model at all tiers
creative-writing:
low: [deepseek-v4-flash]
high: [deepseek-v4-pro]
🎮 Who is this for?
| You | Why you need it |
|---|---|
| AI agent developers | Your agent picks the right model automatically, saving tokens |
| Freelancers / solo devs | Save on API costs without sacrificing quality |
| Teams / startups | One key, automatic routing, full transparency |
| Enthusiasts | Smart routing for $1/month — no headache |
📊 Real-world accuracy
We ran 8 different prompt types through the live allaigate router:
Prompt Task Conf → Routed To
─────────────────────────────────────────────────────────────────────────────────────────────
Write a Python function to reverse a linked list code 0.991 fast model ✓
Solve quadratic equation x² - 5x + 6 = 0 math 0.980 medium model
Translate to French: Hello world translation 0.988 fast model ✓
Write a poem about AI consciousness creative-writing 0.950 fast model ✓
What is the capital of France? qa 0.998 medium model
Summarize: The quick brown fox... summarization 0.980 medium model
Extract date and price from invoice extraction 0.997 medium model
How are you doing today? chitchat 1.000 medium model
8/8 — all task types correctly identified.
✓ = task rule applied → model chosen intentionally
🔄 How it works
You: "write code to reverse a list"
│
▼
┌─────────────────────────────┐
│ 1. Text extraction │ ← only last_user (PII stays local)
└──────────┬──────────────────┘
│ POST /v1/route
▼
┌─────────────────────────────┐
│ 2. Semantic router │ ← allaigate.com (~1ms)
│ task=code, complexity=low │
└──────────┬──────────────────┘
│
▼
┌─────────────────────────────┐
│ 3. Routing table │ ← your configuration
│ code @ low → flash │
│ ↳ fallback → flash/pro │
└──────────┬──────────────────┘
│ invoke
▼
┌─────────────────────────────┐
│ 4. Delegated to the provider │
│ plugin that serves it │
└─────────────────────────────┘
🎛 Picking a policy per chat
The model picker lists four entries. All of them route; the last three pin the policy profile for that conversation, so you don't have to open settings:
| Entry | What it does |
|---|---|
| Auto | Routes using the profile configured in settings |
| Auto · cost saver | Prefers the cheap end of every chain |
| Auto · balanced | The middle ground |
| Auto · quality first | Escalates sooner to the strong models |
📦 Installation
# From DSH plugin store
dsh plugin add cortiq-dsh-llm-router
# Or via npm
npm install cortiq-dsh-llm-router
Or add to your cordis.patch.yml:
- insert:
- id: llm-cortiq-router
name: 'cortiq-dsh-llm-router'
🔑 Get Your Key
- Open allaigate.com
- Sign up — get a free 1-month key instantly
- Copy your key (
cortiq_…) - In DSH: Settings → Models → Cortiq Router → paste your key
Or set the environment variable:
export CORTIQ_ROUTER_KEY=cortiq_your_key_here
💡 Tips
- Start with defaults — they're sensible and work out of the box
- Add per-task rules for tasks that matter most to you
- Tweak complexityBands to fine-tune when a request is considered "hard"
- Watch the log — with
echoRoutingon (the default), every call printstask=… tier=… score=… → provider/model, so you can see what it chose - Name a route explicitly — a candidate written as
provider:model(e.g.deepseek-official:deepseek-v4-pro) skips catalog lookup entirely
📄 License
MIT — do whatever you want.
One key. No guessing. Every request goes to the best model. 🚀