Installation & Setup Guide
Prerequisites
- Python 3.8 or higher
- pip package manager
- Claude Code (CLI)
Step 1: Install llm CLI
The skill requires the llm CLI tool by Simon Willison.
pip install llm
Verify installation:
llm --version
Step 2: Set Up API Keys (Choose Your Providers)
Option A: OpenAI (GPT Models)
- Get API key from https://platform.openai.com/api-keys
- Add to your shell configuration (
~/.zshrc,~/.bashrc, etc.):
export OPENAI_API_KEY='sk-proj-...'
- Reload shell:
source ~/.zshrc # or ~/.bashrc
Option B: Anthropic (Claude Models)
- Get API key from https://console.anthropic.com/account/keys
- Add to your shell configuration:
export ANTHROPIC_API_KEY='sk-ant-...'
- Reload shell:
source ~/.zshrc # or ~/.bashrc
Option C: Google Gemini
- Get API key from https://aistudio.google.com/app/apikey
- Add to your shell configuration:
export GOOGLE_API_KEY='your-api-key'
- Reload shell:
source ~/.zshrc # or ~/.bashrc
Option D: Ollama (Free, Local)
- Install Ollama from https://ollama.ai
- Pull a model:
ollama pull llama2
# or other models: mistral, neural-chat, etc.
- Start Ollama service (keeps running in background):
ollama serve
No API key needed for Ollama!
Step 3: Verify Installation
Test that the skill can detect your providers:
/llm --setup
You should see output like:
🔍 Scanning for available LLM providers...
✅ Available LLM Providers:
• openai
• anthropic
• google
You can also set up: ollama
✅ Configuration saved to ~/.claude/llm-skill-config.json
Step 4: Optional - Install Support Libraries
For enhanced features:
# PDF support
pip install PyPDF2
# Better output formatting (recommended)
pip install rich
Step 5: Configure Default Model (Optional)
Edit ~/.claude/llm-skill-config.json:
{
"last_model": "gpt-4o",
"last_provider": "openai",
"available_providers": ["openai", "anthropic", "google", "ollama"],
"auto_detect": true
}
Or just use the skill and it will remember your last choice!
Testing
Test with OpenAI
/llm --model gpt-4o "Say hello"
Test with Anthropic
/llm --model claude-sonnet-4.5 "Say hello"
Test with Google
/llm --model gemini-2.5-flash "Say hello"
Test with Ollama
/llm --model ollama "Say hello"
Test Interactive Mode
/llm --interactive
Troubleshooting Installation
llm CLI not found
# Verify installation
which llm
# Reinstall if needed
pip install --upgrade llm
API key not recognized
# Check if environment variable is set
echo $OPENAI_API_KEY
echo $ANTHROPIC_API_KEY
echo $GOOGLE_API_KEY
# If empty, check shell configuration file
cat ~/.zshrc | grep "OPENAI_API_KEY"
# Make sure to source after editing
source ~/.zshrc
No models available
# Run setup to detect providers
/llm --setup
# Check which providers you set up
cat ~/.claude/llm-skill-config.json
Ollama connection error
# Make sure Ollama is running
ollama serve
# In another terminal, test:
curl http://localhost:11434/api/tags
# Pull a model if needed
ollama pull llama2
Python version issue
# Check Python version
python --version
python3 --version
# Ensure it's 3.8 or higher
# If not, install from python.org
Upgrading
To upgrade the llm CLI to the latest version:
pip install --upgrade llm
To check for updates:
pip list | grep llm
Uninstalling
If you need to remove the skill:
# Remove the skill directory
rm -rf ~/.claude/skills/llm-cli
# Optionally remove config
rm ~/.claude/llm-skill-config.json
# Optionally uninstall llm CLI
pip uninstall llm
Next Steps
- Read the README.md for usage examples
- Check out the SKILL.md for detailed feature documentation
- Try the interactive mode:
/llm --interactive - Explore different models:
/llm --setupthen experiment
Getting Help
If you encounter issues:
- Provider not detected: Run
/llm --setup - API key error: Check
echo $PROVIDER_API_KEY - llm not installed: Run
pip install llm - Model not found: List models for provider:
/llm --model openai "test" - Timeout issues: Check internet connection or use local Ollama