Provider setup
LLMSwap 5.7.0 implements 10 provider adapters. You need only one configured provider to start.
| Provider | Default model | Environment |
|---|---|---|
| Anthropic | claude-sonnet-5 |
ANTHROPIC_API_KEY |
| OpenAI | gpt-5.6 |
OPENAI_API_KEY |
| Gemini | gemini-3.6-flash |
GEMINI_API_KEY |
| Cohere | command-a-plus-05-2026 |
COHERE_API_KEY |
| Perplexity | sonar-pro |
PERPLEXITY_API_KEY |
| IBM watsonx | ibm/granite-4-h-small |
WATSONX_API_KEY, WATSONX_PROJECT_ID |
| Groq | openai/gpt-oss-120b |
GROQ_API_KEY |
| Ollama | qwen3.5:9b |
Local server and installed model |
| xAI | grok-4.5 |
XAI_API_KEY |
| Sarvam | sarvam-105b |
SARVAM_API_KEY |
Defaults were audited on August 3, 2026. Provider lifecycle, account access, regional availability, and pricing can change independently of LLMSwap.
Configure and verify
export OPENAI_API_KEY="your-key"
llmswap doctor --provider openai
llmswap providers
Make a real provider request only when appropriate:
llmswap providers --provider openai --verify
Choose a provider and model
Global CLI options appear before the command:
llmswap --provider anthropic ask "Review this proposal"
Set persistent defaults:
llmswap config set provider.default anthropic
llmswap config set provider.models.openai gpt-5.6
llmswap config show
Python:
from llmswap import LLMClient
client = LLMClient(provider="anthropic", model="claude-sonnet-5")
response = client.query("Review this proposal")
Explicit model IDs are passed through to the provider, but an ID can still fail when it is invalid, retired, regionally unavailable, or not enabled for the account.
Tool schemas
Tool schemas are implemented for Anthropic, OpenAI, Gemini, Groq, and xAI. Other provider adapters support text chat but not LLMSwap’s shared tool schema.
Ollama
Install Ollama separately, start its server, and pull the configured model:
ollama pull qwen3.5:9b
llmswap --provider ollama ask "Explain this locally"
llmswap doctor --provider ollama reports the exact pull command when the
configured model is missing.
IBM watsonx
Install the optional dependency and export both credential fields:
python -m pip install "llmswap[watsonx]"
export WATSONX_API_KEY="your-key"
export WATSONX_PROJECT_ID="your-project-id"
Privacy and fallback
Remote prompts are sent to the chosen provider. If fallback is enabled, a
failed request can move to another configured provider. Set fallback=False in
Python when a request must stay on its selected provider.
Best Answer stays on the primary provider by default. Cross-provider synthesis requires explicit consent because candidate response text is sent to the judge provider.
For retirement migrations and official provider-source links, see the audited provider catalog.