AI Providers
CLIAI supports multiple AI providers for maximum flexibility.
Ollama (Local)
Recommended for privacy and offline use
# Install Ollama
curl -fsSL https://ollama.ai/install.sh | sh
# Pull models
ollama pull mistral
ollama pull llama2
ollama pull codellama
# Configure CLIAI
cliai select mistral
Advantages:
- Complete privacy
- No API costs
- Works offline
- Fast responses
OpenAI
# Set API key
cliai set-key openai sk-your-key-here
# Select model
cliai select gpt-4
cliai select gpt-3.5-turbo
Available Models:
- gpt-4
- gpt-4-turbo
- gpt-3.5-turbo
Anthropic
# Set API key
cliai set-key anthropic your-key-here
# Select model
cliai select claude-3-sonnet
cliai select claude-3-haiku
cliai select claude-3-opus
Available Models:
- claude-3-opus
- claude-3-sonnet
- claude-3-haiku
Provider Fallback
CLIAI automatically falls back to alternative providers if the primary one fails:
- Try local Ollama first (if configured)
- Fall back to cloud provider (if API key set)
- Circuit breaker prevents repeated failures