Skip to main content

Configuration Files

AI Runner uses a configuration directory at ~/.ai-runner/ (or legacy ~/.claude-switcher/):
Key files:
  • secrets.sh: User-edited file for API keys and model overrides (never overwritten)
  • models.sh: System defaults (updated by setup.sh when defaults change)
  • defaults.sh: Persistent provider/model preferences saved with --set-default

Model Overrides in secrets.sh

Override default model identifiers for any provider by adding exports to ~/.ai-runner/secrets.sh:

AWS Bedrock

Pin a specific model revision (dated variants are published by Anthropic when available):

Google Vertex AI

Anthropic API

Microsoft Azure

Model names are deployment names from your Azure portal:

Vercel AI Gateway

Use provider/model format (dots not dashes in version numbers):
Non-Anthropic models:

Ollama (Local + Cloud)

By default, AI Runner auto-detects available models. Override with:

LM Studio (Local)

By default, AI Runner uses the first loaded model for all tiers. Override:

Codex CLI

Override default Codex model tiers in ~/.ai-runner/secrets.sh:
For custom providers (Azure OpenAI, OpenRouter), configure ~/.codex/config.toml directly. See Runtimes.

Pinning Opus to a specific version

AI Runner’s defaults track Anthropic’s current Opus release (Opus 5 as of 2026-07-24). You may prefer to pin to an older version — common reasons include personal preference for a model’s behavior, a known regression in your workload (e.g. a prompt or harness tuned against the previous release), or a transient provider-side bug with the newest release. Pinning is a per-user choice and doesn’t affect anyone else. To pin Opus to 4.6 across every provider, add this to ~/.ai-runner/secrets.sh:
Two knobs are needed:
  • CLAUDE_MODEL_OPUS_* sets the active session’s model (ANTHROPIC_MODEL) for the relevant provider.
  • ANTHROPIC_DEFAULT_OPUS_MODEL is a separate Claude Code variable that controls which model the in-session /model picker resolves the “Default” alias to. Without it, picking “Default” inside an interactive session jumps back to whatever Claude Code itself considers the current Opus.
Substitute any other published Opus version ID for 4.6 if you want to pin to something else (e.g. a dated revision). Remove the lines to return to the shipped defaults.

Dual Model System

Claude Code uses two models for optimal performance and cost:

1. Primary Model (ANTHROPIC_MODEL)

The main model you interact with. Set by your tier flags:
Used for:
  • Main conversation
  • Complex reasoning
  • User-facing responses

2. Small/Fast Model (ANTHROPIC_SMALL_FAST_MODEL)

The background/auxiliary model for lightweight operations. Automatically set based on provider:
Used for:
  • Sub-agents and teammates (with --team)
  • File operations and analysis
  • Quick auxiliary tasks
  • Background work that doesn’t need the full model
Cost savings: Using Haiku for background operations while running Opus for main work reduces costs without sacrificing quality for complex reasoning.

How It’s Applied

When you run ai --aws --opus, the scripts set:
Claude Code automatically uses the appropriate model for each operation.

Overriding the Small/Fast Model

Customize in ~/.ai-runner/secrets.sh:
When to override:
  • Agent teams: Higher-quality teammates with --team
  • Complex file operations: Better analysis with Sonnet background model
  • Consistency: Same model for all operations (disable two-model system)

Persistent Defaults

Save your preferred provider and model combination:
What gets saved (~/.ai-runner/defaults.sh):
Precedence (highest to lowest):
  1. CLI flags: ai --vertex task.md
  2. Shebang flags: #!/usr/bin/env -S ai --aws
  3. Saved defaults: --set-default
  4. Auto-detection: Current Claude subscription

Model Configuration Files

config/models.sh (System Defaults)

Shipped with AI Runner, defines default model IDs for each provider:
These ship with AI Runner and are updated when new model versions are released.

~/.ai-runner/models.sh (User Copy)

Copied from config/models.sh during setup.sh. Updated when system defaults change:
When to update:
  • After git pull if model defaults changed
  • To get new model versions (e.g., Opus 5 → a newer Opus release)
  • If your models aren’t working (outdated IDs)
When to keep:
  • You have custom overrides in secrets.sh (they take precedence)
  • You want to pin specific versions

Override Hierarchy

Example:

Version File and Update Checking

AI Runner includes automatic update checking with smart caching.

Version File (VERSION)

Shipped with AI Runner, defines the current version:
References:
  • Installed to: /usr/local/share/ai-runner/VERSION
  • Used by: ai --version, ai-status, update checker

Update Checking

AI Runner checks for updates once every 24 hours (non-blocking):
How it works:
  1. Cache-only check (runs in background on startup):
    • Queries GitHub API for latest release
    • Compares with installed version
    • Caches result for 24 hours
    • Never blocks startup
  2. Notice display (if update available):
  3. Manual update:

Disabling Update Checks

Add to your shell profile:
Reload:

Update Cache Location

Update check results are cached at:
Cache format:
Cache expires after 24 hours (86400 seconds).

Manual Update (Without ai update)

If you prefer manual updates:
This preserves your secrets.sh and prompts about updating models.sh.

Environment Variables Reference

Runtime Variables (Set by AI Runner)

User Configuration Variables (Set in secrets.sh)

Troubleshooting Configuration

Check Current Configuration

Shows:
  • Active provider
  • Authentication method
  • Primary model
  • Small/fast model
  • Agent teams status
  • Update availability

View Effective Model IDs

Reset to System Defaults

Verify Override Hierarchy