Skip to main content

Overview

switchAILocal supports multiple AI providers, each with its own configuration format. Providers are organized into:
  • Cloud Providers: OpenAI, Anthropic, Google Gemini, Traylinx SwitchAI
  • Local Providers: Ollama, LM Studio, OpenCode
  • Compatible Providers: OpenRouter, Groq, Together AI, and others via OpenAI compatibility

Traylinx SwitchAI Cloud

Unified access to 100+ cloud models through a single API.
config.yaml
string
required
Your SwitchAI API key. Get one at switchai.traylinx.com
string
default:"https://switchai.traylinx.com/v1"
SwitchAI API endpoint
string
Optional prefix to namespace models (e.g., "teamA/deepseek")
array
Model name mappings and aliases
string
Override global proxy for this credential
object
Additional HTTP headers for requests

Google Gemini API

Configure Google Gemini API access:
config.yaml
string
required
Google Gemini API key from Google AI Studio
string
Namespace models (e.g., "google/gemini-pro")
string
Override Gemini API endpoint (optional)
array
Model aliases for custom routing
Example with model exclusions:

Anthropic Claude API

Configure Claude API credentials:
config.yaml
string
required
Anthropic API key from Anthropic Console
string
Override Claude API endpoint (for Claude-compatible services)
array
Model name mappings and aliases
string
Namespace models for this credential

OpenAI / Codex API

Configure OpenAI and compatible services:
config.yaml
string
required
OpenAI API key from OpenAI Platform
string
required
OpenAI API endpoint
array
Model aliases (optional)
The codex-api-key name is historical. This provider works with all OpenAI models, not just Codex.

Ollama (Local)

Configure local Ollama server integration:
config.yaml
boolean
default:"false"
Enable Ollama provider registration
string
default:"http://localhost:11434"
Ollama API endpoint
boolean
default:"true"
Automatically fetch available models from Ollama on startup
array
Model IDs to exclude from discovery
array
Manual model alias definitions
Example with custom models:

OpenCode (Local)

Integrate with local OpenCode server:
config.yaml
boolean
default:"false"
Enable OpenCode provider integration
string
default:"http://localhost:4096"
OpenCode API endpoint
string
default:"build"
Default agent to use when no specific model is requested

LM Studio (Local)

Configure LM Studio integration:
config.yaml
boolean
default:"false"
Enable LM Studio provider registration
string
default:"http://localhost:1234/v1"
LM Studio API endpoint
boolean
default:"true"
Automatically fetch models from LM Studio on startup

OpenAI Compatibility

Configure third-party providers that support OpenAI API format:
config.yaml
string
required
Provider identifier (used in logs and metrics)
string
required
Provider’s OpenAI-compatible API endpoint
string
Namespace models (e.g., "groq/llama-3.1-70b")
array
List of API keys for this provider
array
Model name mappings and aliases
Supported providers:
  • Groq: https://api.groq.com/openai/v1
  • OpenRouter: https://openrouter.ai/api/v1
  • Together AI: https://api.together.xyz/v1
  • Fireworks AI: https://api.fireworks.ai/inference/v1
  • DeepSeek: https://api.deepseek.com/v1
  • Any OpenAI-compatible service

Vertex AI Compatibility

For third-party services using Vertex AI-style protocols with API key auth:
config.yaml
string
required
API key for Vertex-compatible service
string
required
Base URL for Vertex-compatible endpoint
array
Model configurations with aliases
Vertex compatibility is for third-party services that mimic Google’s Vertex AI endpoint structure but use simple API key authentication instead of OAuth.

Global Model Exclusions

Exclude models globally for OAuth/file-backed auth entries:
config.yaml
object
Map of provider names to excluded model patterns (supports wildcards)

Per-Provider Settings

All cloud providers support these common settings:
  • prefix: Namespace models (e.g., team-a/model-name)
  • proxy-url: Override global proxy for this provider
  • models-url: Override model discovery endpoint
  • headers: Add custom HTTP headers
  • excluded-models: List of model patterns to exclude
  • models: Manual model name/alias mappings

Model Aliases

Create friendly aliases for model names:
Now requests for flash route to gemini-2.0-flash-exp.

Multiple Credentials

Configure multiple API keys for load balancing and failover:
With routing.strategy: "round-robin", requests are distributed evenly.

Complete Example

config.yaml

Next Steps

Security Configuration

Configure API authentication and management access

Intelligent Routing

Enable automatic model selection with Cortex Router