DSH Dynamic Router Intelligent Routing & Cost Balancer

DSH Dynamic Router Intelligent Routing & Cost Balancer

@yjh051108/dsh-routing-suite·v1.2.0·providers

An adaptive task-complexity model router for DeepSeek Harness. Automatically routes lightweight tasks to fast small models while escalating deep logical reasoning to DeepSeek-R1, saving costs.

Model-Routing · Cost-Optimization · Adaptive-Router · Complexity-Gate

GitHubNPM
Installation & Integration
bash
manager:
$ pnpm add @yjh051108/dsh-routing-suite

Architecture

DSH Routing Suite resolves the critical dilemma between output quality and infrastructure cost. Sending every trivial greeting or simple regex request to a high-end reasoning model exhausts budgets and increases response latency. This plugin implements an intelligent complexity gatekeeper on Cordis. Incoming user turns undergo micro-second semantic categorization: lightweight classification tasks route to efficient local or small cloud models, while intricate algorithmic planning escalates smoothly to DeepSeek-R1. This hybrid strategy maintains top-tier benchmark quality while trimming cloud spend by up to 60%.

Core Features

01

Dual-Metric Complexity Scoring: Micro-second evaluation of semantic ambiguity and dependencies

02

Seamless Fallback Escalation: Auto-promotes turns to flagship models if small models fail validation

03

Fine-Grained Budget Caps: Set hard expenditure ceilings per session or billing cycle easily

04

Live Traffic Analytics Dashboard: Real-time visual tracking of token savings and tier distributions

Core Workflow

01

Complexity Scoring

Calculates complexity scores based on prompt tokens, ambiguity, and tool schemas.

02

Rule-Based Matching

Maps evaluated scores to configured model tiers (Tier-1, Tier-2, or Reasoning-Tier).

03

Payload Forwarding

Adjusts temperature and token parameters per target provider before dispatch.

04

Quality Gate Fallback

Transparently escalates to flagship models if small model outputs fail verification.

Configuration Parameters Reference (YAML / JSON)

ParameterTypeDefaultDescription
budgetModestringbalancedRouting strategy prioritization
complexityThresholdnumber0.65Threshold to escalate to DeepSeek-R1
lightweightModelstringdeepseek-chat-fastTarget lightweight model endpoint