Concepts
Routing and costs
How Duscode picks a fast, standard or frontier model for each task, when it escalates or falls back, how to pin a model, and how cost and savings are measured.
Duscode routes each task to the cheapest model that can do it: it starts cheap and moves up only when the work fails. You see which model answered, why, what it cost, and what the top model would have cost.
The three tiers
| Tier | Suited to | Default models |
|---|---|---|
| fast | Mechanical edits, renames, formatting, docs and comments, quick lookups, version bumps. Also titles, commit messages and summaries. | claude-haiku (Claude Haiku 5.5), gpt-luna (gpt-6-luna) |
| standard | General coding work | claude-sonnet (Claude Sonnet 5.5), gpt-sol (gpt-6.1-sol) |
| frontier | Architecture, subtle or concurrency bugs, security, migrations, large refactors, performance work, repeated failures | claude-opus (Claude Opus 5.5), gpt-astra (gpt-6-astra) |
Only models whose provider has a key are used. If a tier has no available model, Duscode uses the nearest tier above it, then the one below. See Providers and models for prices and other providers.
How a tier is chosen
- Cheapest first. In Auto, a task starts on the fast tier.
- What worked here before. Duscode remembers how each task went on this computer, per project: the kind of work (bug fix, feature, refactor, docs, UI, migration, security, performance, tests), the model it started on, whether it finished without help, and what it cost. When a model has passed at least 5 recent tasks of this kind, at least 8 times in 10, Auto starts on whichever of those models had the lowest cost per finished task: what all its tasks of this kind cost, failed tries included, divided by the ones that passed. Recent tasks count more; a result loses half its weight every two weeks, so old results fade and models get a fresh chance.
- With too few results, Auto keeps starting cheap.
- It only starts a kind of work on a pricier model when the cheap models have been measured failing at it. In Economy it never does.
- Maximum always starts on the standard tier.
- A failed check moves it up. If the work fails, escalation moves it up a tier. If you say the problem is still failing ("still fails", "still broken", "tried everything"), the task starts one tier up, on standard.
- Never down mid-session. Once a session has moved up, later tasks stay on that tier. Duscode doesn't move down, because switching models throws away the prompt cache, and cache reads cost about a tenth of normal input.
The route line in the chat shows the model, the tier and the reason, for example claude-haiku fast tier · cheapest first; a failed check moves up a tier. When past results picked the model, the reason says so in one line, for example gpt-luna: 14 of 15 recent bug fixes passed at about $0.03 each.
Work where the worst mistakes still pass the checks (merges, migrations, sign-in and permissions, payments, deleting data, production) also starts cheap, and a stronger model reviews the change before it counts as done.
Escalation
Within a task, Dus moves one tier up when:
- three tool rounds in a row fail
- the project's checks still fail after a fix attempt
- the model refuses the request
The chat shows a line such as ▲ Switched to claude-opus because …, with the reason.
Provider fallback
If a provider is overloaded or unreachable, Duscode moves to the same tier on another provider you have a key for, then to one tier up. That covers rate limits (429), overloaded (529), server errors and timeouts, after the provider SDK's own retries. Duscode stays on the fallback model for the rest of the task and goes back to the routed model at the next one.
Errors that you need to fix aren't hidden by a fallback. Those include missing permission, an unknown model or a bad request. Duscode shows them with a hint.
Out of credit
When a provider says your account is out of credit or quota, or that the key is not valid, Duscode:
- Moves the work to the same tier on another provider you have a key for (or one tier up), as for an outage. The chat says why, for example claude-sonnet unavailable (Anthropic is out of credit since 14:02, checking every 15 min); continued on gpt-sol.
- Skips that provider in every session, so no other task spends a failed call finding out again.
- Checks it again in the background every 15 minutes, and at once when you add or replace its key in Settings → Models & keys. The check is the smallest request the provider accepts: one word in, one token out (16 for OpenAI) on its cheapest model, about a millionth of a dollar, on your own key.
- Comes back as soon as a check gets an answer: from the next step of the task that is running, not only the next task. The route line says Anthropic has credit again (checked 14:17), so back on Sonnet 5.5.
Settings → Models & keys shows it next to the key, for example Out of credit since 14:02 · …abcd · checking every 15 min, with a Top up link to the provider's billing page. If every provider you have is out, Duscode tries anyway and tells you what the provider said.
Duscode credits (your plan's usage) work differently: when they run out, Dus pauses and asks what to do (see Pricing and plans).
Pinning a model
- Click Model on the right of the top bar.
- Choose a model.
That model then answers every task in this session; choose Auto to go back to routing. The model picker page has the details (Alt+M opens it). Auto is the default. In the terminal, use /model <id> and /model auto.
A pinned model is never escalated or swapped for a fallback. If you attach an image and the pinned model can't read images, Duscode tells you instead of quietly dropping the image.
Images and vision
When a task includes images or PDFs, Duscode makes sure the model can read them. If the routed model can't, it uses the cheapest model that can, at the same tier or above. It says so in the route reason.
Cost and savings
Every model call is metered at the provider's published prices. That covers input, cached input, output, images and web searches. You see:
- The task's cost so far, live while it runs, next to the session's status in the top bar, against its budget: Working · $1.75 of $2. Click it to give the task more.
- Task cost at the end of each task
- Cost so far, Estimated savings and Model usage for the session, in Project details (click the project's name in the top bar)
- Today's spend across all your projects in the spend chip on the right of the top bar (with your credits balance when you use Duscode credits). Click it for today, yesterday, this week and this month, and today by project; its Open Usage opens Settings → Usage: today's and this month's spend, spend by model and the savings by routing. Usage is also in the sidebar and the profile menu.
Savings compare what the task cost with what the same tokens would have cost on the top model (the baseline: the best frontier model available, or baselineModel in your config). That's an estimate of what routing saved, not a bill. Your provider bills you directly.
Note
On the Free plan, Dus uses one model you choose (by default the standard tier), with no automatic routing or escalation. During early access every feature is on. See Pricing and plans.