Skip to main content

Overview

Provider prefixes enable explicit routing to specific AI providers. Use the format provider:model to control which backend handles your request.

Syntax

Examples:
  • geminicli:gemini-2.5-pro - Routes to Gemini CLI
  • ollama:llama3.2 - Routes to Ollama
  • claudecli:claude-sonnet-4 - Routes to Claude CLI

Available Providers

CLI Providers

Use your paid CLI subscriptions:
Prefix: geminicli:Routes to Google Gemini CLI tool. Requires gemini CLI installed and authenticated.
Available Models:
  • geminicli:gemini-2.5-pro
  • geminicli:gemini-2.5-flash
  • geminicli:gemini-3-pro-preview
Features:
  • ✅ File attachments via extra_body.cli
  • ✅ Folder attachments
  • ✅ Session management
  • ✅ Sandbox mode

Local Providers

Run models on your machine:
Prefix: ollama:Routes to local Ollama server. Requires Ollama running on localhost:11434.
Available Models: Any model you’ve pulled with ollama pullFeatures:
  • ✅ Fully local (no internet required)
  • ✅ Privacy-preserving
  • ✅ Custom models
  • ✅ Embeddings support

Cloud API Providers

Use cloud APIs directly:
Prefix: switchai:Routes to Traylinx switchAI unified gateway. Requires switchai.api-key configured.
Special Models:
  • switchai:auto - Intelligent model selection
  • switchai:deepseek-reasoner - Reasoning model
  • switchai:openai/gpt-oss-120b - OSS models
Features:
  • ✅ Access to 40+ models
  • ✅ Automatic best model selection
  • ✅ Built-in failover

List Available Providers

Returns all active providers with their status and model count:

Response Format

Filter Providers

Auto-Routing vs Explicit Routing

Auto-Routing (No Prefix)

Omit the prefix to let switchAILocal choose the best available provider:
Routing Logic:
  1. Checks if model is available from any provider
  2. Prefers CLI providers (use your subscriptions)
  3. Falls back to API providers
  4. Uses intelligent routing based on provider health

Explicit Routing (With Prefix)

Specify the exact provider:
When to Use:
  • You need a specific provider feature (e.g., CLI attachments)
  • Testing a particular provider
  • Provider-specific behavior required
  • Cost optimization (prefer local/CLI)

Provider Configuration

CLI Provider Setup

CLI providers work automatically if the CLI tool is installed and authenticated:
No additional configuration needed in config.yaml.

API Provider Setup

Configure API keys in config.yaml:
config.yaml

Local Provider Setup

Ollama

Ollama is auto-detected when running. No config needed.

LM Studio

  1. Download and install LM Studio
  2. Load a model
  3. Start local server in LM Studio
  4. Configure endpoint in config.yaml:
config.yaml

Advanced Features

Load Balancing

Configure multiple accounts for round-robin load balancing:
config.yaml
switchAILocal automatically rotates between accounts.

Failover

Automatic failover to backup providers:
config.yaml

Provider Priorities

Set priority order for auto-routing:
config.yaml

Provider Comparison

Examples

Prefer CLI Providers

Route by Capability

Troubleshooting

Provider Not Found

Error: Provider 'geminicli' not available Solutions:
  1. Verify CLI tool is installed: which gemini
  2. Check authentication: gemini auth status
  3. Test CLI directly: gemini chat "hello"
  4. Check server logs for errors

Model Not Found

Error: Model 'geminicli:invalid-model' not found Solutions:
  1. List available models: GET /v1/models
  2. Check model name spelling
  3. Verify provider supports the model
  4. Try without prefix for auto-routing

Provider Timeout

Error: Provider 'ollama' timed out Solutions:
  1. Verify provider is running: curl http://localhost:11434
  2. Increase timeout in config.yaml:
  3. Check provider logs

Next Steps

Auto-Routing

Learn about intelligent provider selection

CLI Attachments

Pass files and folders to CLI providers

Models

Discover all available models

Configuration

Configure provider settings