AI Providers
SmartTools works with any AI provider that has a CLI interface. Configure providers in
~/.smarttools/providers.yaml.
Provider Configuration
Create or edit ~/.smarttools/providers.yaml:
providers:
- name: claude
command: "claude -p"
- name: openai
command: "openai-cli"
- name: ollama
command: "ollama run llama2"
- name: mock
command: "echo '[MOCK RESPONSE]'"
Using Providers in Tools
Specify the provider in your step:
steps:
- type: prompt
provider: claude # Uses the "claude" provider from config
prompt: "..."
output_var: response
Popular Providers
Claude (Anthropic)
# Install
pip install claude-cli
# Configure with your API key
export ANTHROPIC_API_KEY="sk-ant-..."
# providers.yaml
providers:
- name: claude
command: "claude -p"
OpenAI
# Install
pip install openai-cli
# Configure
export OPENAI_API_KEY="sk-..."
Ollama (Local)
# Install Ollama from ollama.ai
# Pull a model
ollama pull llama2
# providers.yaml
providers:
- name: ollama
command: "ollama run llama2"
Testing with Mock Provider
Use the mock provider to test tools without API calls:
providers:
- name: mock
command: "echo 'This is a mock response for testing'"
Choosing a Provider
| Provider | Best For | Cost |
|---|---|---|
| Claude | Complex reasoning, long context | Pay per token |
| OpenAI | General purpose, fast | Pay per token |
| Ollama | Privacy, offline use | Free (local) |