Overview
switchAILocal supports multiple AI providers through three authentication methods. Choose the method that works best for your use case.Authentication Methods
Most users should start with CLI Wrappers (Option A) for the fastest setup with zero configuration.
Option A: CLI Wrappers (Recommended)
If you already havegemini, claude, codex, or vibe CLI tools installed and authenticated, switchAILocal uses them automatically.
1
Verify CLI Installation
Check that your CLI tools are installed and working:
2
Use CLI Prefix
Reference the CLI provider using the
cli suffix in your model name:3
Supported Providers
Available CLI providers:
Option B: API Keys (Standard)
For cloud API providers, add API keys directly to yourconfig.yaml.
1
Copy Example Config
2
Add Provider Credentials
Edit
config.yaml and add your API keys:3
Use Without CLI Suffix
Option C: OAuth Login (Advanced)
For users who want switchAILocal to manage OAuth tokens directly without CLI tools.This method requires
GEMINI_CLIENT_ID and GEMINI_CLIENT_SECRET environment variables. Most users should use Option A or Option B instead.1
Set Environment Variables
2
Run OAuth Login
3
Complete Browser Authentication
A browser window will open for you to authorize switchAILocal. After approval, tokens are stored in
~/.switchailocal/.Local Model Providers
Ollama
Connect to locally running Ollama models.1
Enable Ollama in Config
config.yaml
2
Start Ollama
3
Pull Models
4
Use Ollama Models
LM Studio
Connect to LM Studio for local model hosting.config.yaml
OpenCode
Integrate with OpenCode for specialized development tasks.config.yaml
OpenAI-Compatible Providers
Connect any OpenAI-compatible API endpoint.config.yaml
Load Balancing
Configure multiple credentials per provider for automatic load balancing.config.yaml
Routing Strategies
Routing Strategies
- round-robin: Distributes requests evenly across all credentials
- fill-first: Uses the first credential until quota is exhausted, then moves to the next
Model Aliasing
Create friendly aliases for frequently used models.config.yaml
Verification
List all available models to verify provider setup:Next Steps
Docker Deployment
Deploy switchAILocal with Docker for production use
Management Dashboard
Use the web UI to configure providers visually