infosave2007/cortiq-router--packages-dsh-llm-cortiq-router0

cortiq-dsh-llm-router

Умный маршрутизатор LLM-запросов для DeepSeek Harness (dsh). Классифицирует каждый промпт по типу задачи (code, math, translation и др.) и сложности (low/medium/high) через семантический роутер allaigate.com, затем делегирует вызов тому провайдеру, который обслуживает выбранную модель. Один ключ — правильная модель для каждой задачи; настраиваемые правила маршрутизации и пороги сложности.

包名
cortiq-dsh-llm-router
版本
0.1.4
许可证
MIT
最近更新
2026年8月21日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:infosave2007/cortiq-router#8df2a0575c58c43b3d0dca45ebc0da87e8620411&path:packages/dsh-llm-cortiq-router

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 pluginWith plugin
All requests go to expensive modelsSimple requests → cheap model
Overpay 10–50×Save up to 90%
Manual model selection every timeFully 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 pluginWith 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 pluginWith 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?

YouWhy you need it
AI agent developersYour agent picks the right model automatically, saving tokens
Freelancers / solo devsSave on API costs without sacrificing quality
Teams / startupsOne key, automatic routing, full transparency
EnthusiastsSmart 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:

EntryWhat it does
AutoRoutes using the profile configured in settings
Auto · cost saverPrefers the cheap end of every chain
Auto · balancedThe middle ground
Auto · quality firstEscalates 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

  1. Open allaigate.com
  2. Sign up — get a free 1-month key instantly
  3. Copy your key (cortiq_…)
  4. 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 echoRouting on (the default), every call prints task=… 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. 🚀