tmf use — Switch Provider
Syntax
tmf use <provider> [options]Description
Switch the LLM provider and model for all detected AI apps (or a specific one with --app). Before making any changes, the current configuration file is automatically backed up, allowing you to restore it later with tmf rollback.
Apps are detected automatically. If an app's executable is not found in PATH, it is silently skipped even if its config directory exists (e.g. leftover from a previous uninstallation).
Options
-a, --app <app> | Target app: codex, claude-code (aliases: claude, cc), openclaw, opencode, hermes, pi |
|---|---|
-k, --key <api-key> | API key for the new provider |
-m, --model <model> | Single model name |
--models <models...> | Multiple models (see below) |
--env <env...> | Custom env vars to set (KEY=VALUE format) |
--effort <level> | Effort level: low, medium, high, xhigh |
Template Matching
tmf use <name> first checks for a saved template with that name. If found, the template is applied directly — no Provider API call is needed. Templates are created with tmf save or tmf set --save-as.
CLI options (--key, --model, --models, --env, --effort, --app) override template values at runtime.
Model Assignment (--models)
The --models option supports two formats for setting role-specific models in Claude Code:
Positional format (opus → sonnet → haiku):
tmf use deepseek --models deepseek-v4-pro[1m] deepseek-v4-pro deepseek-v4-flashThis sets:
ANTHROPIC_DEFAULT_OPUS_MODEL=deepseek-v4-pro[1m]ANTHROPIC_DEFAULT_SONNET_MODEL=deepseek-v4-proANTHROPIC_DEFAULT_HAIKU_MODEL=deepseek-v4-flashANTHROPIC_MODEL(primary) =deepseek-v4-pro[1m]
Key-value format (order-free):
tmf use deepseek --models opus=deepseek-v4-pro[1m],sonnet=deepseek-v4-pro,haiku=deepseek-v4-flashWith role-based models set, Claude Code automatically routes to the correct model when switching between haiku/sonnet/opus — no need to re-run tmf use each time.
Examples
# Switch all detected apps to DeepSeek
tmf use deepseek
# Switch only Claude Code, with role-based model assignment
tmf use deepseek --app claude-code --models opus=deepseek-v4-pro[1m],sonnet=deepseek-v4-pro,haiku=deepseek-v4-flash
# Switch with positional model format
tmf use deepseek --models deepseek-v4-pro[1m] deepseek-v4-pro deepseek-v4-flash
# Switch with a single model and custom env vars
tmf use siliconflow --model Qwen/Qwen2.5-7B-Instruct --env MAX_TOKENS=4096
# Switch with effort level
tmf use deepseek --effort max