dsh-routing-forensics

Forensic analysis of past model-routing decisions. Replays each session, classifies every turn's task complexity from its request shape (deterministic, no LLM), and reports two kinds of waste: an expensive model on cheap work (the difference is measurable), and a cheap model on expensive work that failed on its own merits — where every retry re-sends the whole context, so the downgrade cost more than the upgrade. Distinguishes provider-capacity retries (RATE_LIMIT/TIMEOUT/TRANSPORT) from model failures so it does not cry wolf. Derives routing rules from the evidence, priced against a built-in per-million table.

Overview

Forensic analysis of past model-routing decisions. Replays each session, classifies every turn's task complexity from its request shape (deterministic, no LLM), and reports two kinds of waste: an expensive model on cheap work (the difference is measurable), and a cheap model on expensive work that failed on its own merits — where every retry re-sends the whole context, so the downgrade cost more than the upgrade. Distinguishes provider-capacity retries (RATE_LIMIT/TIMEOUT/TRANSPORT) from model failures so it does not cry wolf. Derives routing rules from the evidence, priced against a built-in per-million table.

Installation

Install from npm

dsh plugin --profile web add @bushizhanghan/dsh-routing-forensics

Resolves a published tarball rather than cloning the repository, and installs without any extra setup. Swap `web` for your profile name if you run another one.

Install from GitHub

dsh plugin --profile web add github:bushizhanghan/dsh-routing-forensics

Installing from GitHub runs the project's build script, which pnpm blocks until you allowlist it — run the command once and pnpm prints the exact key to add under `allowBuilds` in ~/.dsh/profiles/web/pnpm-workspace.yaml.

Version compatibility

Compatibility is unconfirmed. Check the project documentation for supported versions.