cyberine
UsageRun recipes

Per-task model variant selection (T60)

Loop workers that expose a variants map in their WorkerProfile run a different model id depending on task tier — the router picks the cheapest capable variant so you don't pay for deep reasoning on a trivial fix:

TierVariant chosenExample (loop-deepseek-build)
complexvariants.reasoningdeepseek-v4-pro (full Think mode)
standard / trivialvariants.flashdeepseek-v4-flash (no deep reasoning)
eithermodel (fallback)profile default when no variant defined

Workers with variants currently: loop-deepseek-build (deepseek-v4-pro / deepseek-v4-flash), loop-kimi-build (kimi-k2-thinking / kimi-k2-turbo-preview), loop-openrouter-build (deepseek/deepseek-v4-pro-0813 / deepseek/deepseek-v4-flash-0731 — dated because OpenRouter's undated DeepSeek ids are frozen legacy aliases, unlike DeepSeek-direct's; see Switch the OpenRouter loop model).

Env override always wins: if DEEPSEEK_MODEL (or the worker's modelEnvKey) is explicitly set in your environment, that value is used as-is — the variant pick is skipped entirely. This applies per-worker and is transparent: cyberine route --json shows variantKind=default with the env value.

The resolved model is injected as an env override into the background child process (DEEPSEEK_MODEL=deepseek-v4-flash etc.), so the worker's provider label in run.json reflects the actual variant used (e.g. deepseek:deepseek-v4-flash).

# Dry-run: see which model each worker would use
cyberine route --json "fix the typo in line 5"          # standard -> flash variants
cyberine route --json "refactor the auth module"         # complex -> reasoning variants

# Human-readable route output also shows resolved model per worker
cyberine route "refactor the entire auth module"

# Override: pin a specific model regardless of variant pick
DEEPSEEK_MODEL=deepseek-v4-custom cyberine run --bg "fix the typo"  # env wins, no variant

Add variants to a worker profile in src/core/workerProfiles.ts:

'loop-my-worker': {
  // ...existing fields...
  variants: { reasoning: 'my-model-think', flash: 'my-model-fast' },
  modelEnvKey: 'MY_MODEL',  // env key that overrides the variant pick
}