Skip to main content
Provider flags let you switch between different AI providers and models on the fly. Use your Claude subscription, cloud platforms, or local models without changing configuration files.
Most provider flags work with both Claude Code and Codex CLI. Each flag entry notes which runtimes support it. See Runtimes for the full compatibility matrix.

Available Providers

Local Providers (Free)

flag
Ollama - Run models locally or on Ollama’s cloud
Short form: --olRuntimes: Claude Code, Codex CLISetup:
Requirements:
  • Ollama installed and running at http://localhost:11434
  • 24GB+ VRAM for local coding models (cloud models work on any hardware)
See Local Providers for details.
flag
LM Studio - Local models with MLX support (fast on Apple Silicon)
Short form: --lmRuntimes: Claude Code, Codex CLISetup:
  1. Download LM Studio from lmstudio.ai
  2. Load a model in the UI
  3. Start server: lms server start --port 1234
Requirements:
  • LM Studio running at http://localhost:1234
  • 24GB+ unified memory for coding models
See Local Providers for details.

Cloud Providers

flag
AWS Bedrock - Claude models on Amazon Web Services
Runtimes: Claude Code onlySetup in ~/.ai-runner/secrets.sh:
Authentication:
  • AWS credentials file (~/.aws/credentials)
  • Or IAM role (for EC2/ECS)
See Cloud Providers for details.
flag
Google Vertex AI - Claude models on Google Cloud Platform
Runtimes: Claude Code onlySetup in ~/.ai-runner/secrets.sh:
Authentication:
  • Application default credentials (gcloud auth application-default login)
  • Or service account key file
See Cloud Providers for details.
flag
Anthropic API - Direct access to Anthropic’s API
Runtimes: Claude Code (Anthropic API), Codex CLI (forces OpenAI API key auth)Setup in ~/.ai-runner/secrets.sh:
Authentication:See Cloud Providers for details.
flag
Microsoft Azure — Claude Code: Azure Foundry (Anthropic models) / Codex CLI: Azure OpenAI (GPT models)Runtimes: Claude Code, Codex CLI (different services)
Setup in ~/.ai-runner/secrets.sh:
Authentication:
  • Azure Foundry API key
See Cloud Providers for details.
flag
Vercel AI Gateway - Access 100+ models (OpenAI, xAI, Google, Meta, and more)
Runtimes: Claude Code onlySetup in ~/.ai-runner/secrets.sh:
Authentication:Supported models:
  • OpenAI (GPT-4, GPT-5, etc.)
  • xAI (Grok models)
  • Google (Gemini models)
  • Meta (Llama models)
  • Anthropic (Claude models)
  • And many more
See Cloud Providers for details.
flag
Claude Pro/Max - Your regular Claude subscription
Runtimes: Claude Code onlyAuthentication:
  • Claude subscription (log in with claude)
Note: This is the default if you’re logged in and don’t specify another provider.

Provider Precedence

When no provider is specified, AI Runner auto-detects in this order:
  1. Saved default from --set-default
  2. Claude subscription (if logged in with claude)
  3. Ollama (if running locally)
  4. Anthropic API (if ANTHROPIC_API_KEY is configured)
  5. Cloud providers (AWS, Vertex, Vercel, Azure — if configured)
CLI flags always override saved defaults and auto-detection.

Examples

Basic Usage

Combining Providers and Models

Interactive Sessions

Resume Conversations

Shebang Scripts

Set Default Provider

Provider Status

Check which providers are configured:
See ai-status reference for details.

Multiple Providers Workflow

Switch between providers based on your needs:

Provider-Gated Flags

Some passthrough flags only work with specific providers:
--chrome requires a direct Anthropic plan (Pro, Max, Teams, Enterprise). It does not work through Bedrock, Vertex, Azure Foundry, Ollama, or LM Studio. AI Runner warns when --chrome is used with incompatible providers.

Model Flags

Select model tiers and specific model IDs

Provider Guides

Detailed setup for each provider