← Back to home@syroezhkin

dsh-routerai

RouterAI plugins for the DeepSeek Harness: web search and a session-cost meter

Stars
0
Language
JavaScript
Created
Sep 12, 2026
Updated
Sep 12, 2026
GitHub repo

Introduction

dsh-routerai

Two independent plugins for the DeepSeek Harness (DSH) that connect it to RouterAI and price what it spends.

PackageWhat it doesInstall
dsh-web-search-routeraiWeb search through RouterAI's server-side retrievaldsh plugin --profile web add dsh-web-search-routerai
dsh-session-cost-routeraiSession cost in roubles, beside the composerdsh plugin --profile web add dsh-session-cost-routerai

They share a vendor, not a dependency: install either one alone.

Why these exist

DSH ships a DeepSeek web-search provider that speaks the Anthropic-compatible Messages API and requires web_search_tool_result blocks in the response. RouterAI does not execute native search on /messages — it hands the tool call back to the caller. It does run server-side retrieval on /chat/completions under plugins:[{id:"web"}], returning structured url_citation annotations, and that is the route the provider here uses.

Nothing in DSH reports a session's cost. The meter prices the session's own token counts against RouterAI's published tariff, and shows the key's real spend alongside it.

Install

Both packages are bundles: dsh plugin forwards to pnpm in the profile directory and then registers the package as a profile layer, because each manifest declares dsh.bundle. Restart DSH and reload the page.

dsh plugin --profile web add dsh-web-search-routerai dsh-session-cost-routerai

Before the packages are on the registry, install a workspace member straight from git. The #path: selector is required: the repository root is a private workspace manifest that declares no dsh.bundle, so installing it bare would register nothing.

dsh plugin --profile web add "github:syroezhkin/dsh-routerai#path:packages/web-search-routerai"
dsh plugin --profile web add "github:syroezhkin/dsh-routerai#path:packages/session-cost-routerai"

Configure

Each package patches its own row. Put overrides in the profile's cordis.patch.yml (or the home-level one, which takes precedence):

- id: web-search-routerai
  config:
    baseURL: https://routerai.ru/api/v1
    maxResults: 5      # first billing tier; see the package README
    engine: exa

- id: session-cost
  config:
    baseURL: https://routerai.ru/api/v1

Both read their credential through the credentials service, so setting the key once on the Web Models page configures both.

Cost, briefly

Search bills in tiers: 2.2 RUB × ceil(max_results / 5) per query, charged on the requested count. The provider clamps every caller to maxResults (default 5) to stay in the cheapest tier.

The session meter is an estimate — RouterAI tariffs some routes by time of day — and the key's own spend is shown beside it as the authoritative figure. See each package README for detail.

Development

A pnpm workspace. Each package is plain JavaScript, hand-written in the shapes DSH loads; there is no build step.

pnpm install
node --check packages/*/index.js packages/*/client.js

License

MIT