/** * Model routing for DshAgentRunner (dsh-runner.ts): which dsh provider route a * model option names, the curated model list (dsh has no listing command — * its picker is the web Models page), and the `llm-pi-ai` row that turns a * pi-ai route on for one run. Pure; no I/O. * * Model option: a bare id (`deepseek-v4-pro`) keeps the profile's provider; * `/` picks a route first (`openrouter/z-ai/glm-5.2:free`), the * way opencode's option reads. Only a known route counts as a prefix, since * pi-ai model ids contain slashes themselves (`z-ai/glm-5.2:free`). * * Free models (live-checked 2026-09-29, dsh 0.1.7-rc.2, pi-ai catalog in the * package): dsh's own routes are paid, but its bundled pi-ai adapter reaches * zero-cost catalog models on two routes, each needing only a free account key: * - openrouter (`:free` models, OPENROUTER_API_KEY) * - nvidia (NVIDIA's API catalog, NVIDIA_API_KEY) — incl. DeepSeek V4 * Flash/Pro, so a free key runs dsh on DeepSeek models. * OpenCode Zen's free models are in the catalog too but are not listed: Zen * answers `FreeTierError: OpenCode's free tier can only be used from within * OpenCode` to any other client (checked live). * * The llm-pi-ai adapter mounts dormant (no routes) until its config names a * provider. A `--patch` REPLACES a row's whole config (checked with * `--dump-config`), so the row is built from the dumped config with the * route added — the user's other Models-page routes stay — and left out * entirely when the route is already configured. `apiKeyEnv` makes a missing * key a named MISSING_CREDENTIAL (resolved from the env or dsh's credential * store) instead of pi-ai's bare "Provider is not configured". Checked against * a local OpenAI-compatible mock: dsh sent `model: z-ai/glm-5.2:free` with * `Bearer $OPENROUTER_API_KEY` and `reasoning.effort`. */ import type { AgentModel } from './agent-models.js'; import type { OrgEffortLevel } from './cost-tier.js'; /** dsh's own DeepSeek routes (dsh-llm-deepseek, dsh-llm-deepseek-account). */ export declare const DSH_NATIVE_ROUTES: readonly ['deepseek-official', 'deepseek-account']; export declare const isDshNativeRoute: (route: string) => boolean; /** Split a model option into route + model id; `provider` is undefined for * a bare id (the profile's current route applies). */ export declare function dshSplitModel(option: string): { provider?: string; model: string; }; export interface DshModel extends AgentModel { /** Zero-cost in the catalog: needs only a free account key (`key_env`). */ free?: boolean; /** The env var (or dsh credential-store entry) the route's key comes from. */ key_env: string; } /** Levels are pi-ai's getSupportedThinkingLevels over each catalog entry, * limited to monomind's `--effort` names (pi-ai's `minimal` has none). */ export declare const DSH_MODELS: DshModel[]; /** The curated entry for a route + model, if any. */ export declare function dshCuratedModel(provider: string, model: string): DshModel | undefined; /** A level the model supports: the requested one, else the nearest above, * else the nearest below (pi-ai's clampThinkingLevel). */ export declare function clampEffort(levels: readonly string[], effort: string): string; export declare function dshEffortFor(provider: string, model: string, effort: OrgEffortLevel): string; /** * The `llm-pi-ai` patch row that serves `route` for this run, or null when * none is needed (a native DeepSeek route, or a route the profile already * configures). Any other routes and fields in the dumped config are kept. */ export declare function dshPiAiRow(route: string, dump: string): string | null; //# sourceMappingURL=dsh-runner-models.d.ts.map