What is a Provider?
A provider in Goose is a component that:- Connects to an AI model service (cloud or local)
- Translates Goose’s conversation format to the model’s API format
- Handles authentication and API keys
- Streams responses back to the agent
- Manages tool calling protocols
- Tracks token usage and costs
Built-in Providers
Goose includes native support for many popular AI providers:Cloud Providers
Anthropic
Claude models (Sonnet, Opus, Haiku)
- Native tool calling
- Prompt caching
- Extended context windows
OpenAI
GPT models (GPT-4o, GPT-4, GPT-3.5)
- Function calling
- Vision support
- Structured outputs
Gemini models via Vertex AI
- Multi-modal support
- Large context windows
- OAuth authentication
AWS Bedrock
Multiple model families
- Anthropic Claude
- Meta Llama
- AWS credentials
Local & Open Source
Ollama
Local model execution
- Privacy-first
- No API keys required
- Qwen, Llama, Mistral, etc.
LiteLLM
Unified gateway to 100+ models
- Consistent API across providers
- Load balancing
- Fallback handling
OpenAI Compatible
Custom OpenAI-compatible servers
- vLLM, LocalAI, etc.
- Self-hosted models
- Custom endpoints
Local Inference
Direct local model execution
- llama.cpp integration
- GGUF model support
- CPU/GPU acceleration
Enterprise Providers
- Azure OpenAI: Enterprise OpenAI deployment
- Databricks: Databricks model serving
- Snowflake Cortex: Snowflake’s AI models
- GitHub Copilot: GitHub’s code models
- OpenRouter: Multi-provider routing
- Venice.ai: Privacy-focused inference
Provider Architecture
Configuration
Via Environment Variables
The simplest way to configure a provider:Via Configuration File
Via Recipe
Provider Implementation
Example: Anthropic Provider
Tool Calling Translation
Different providers have different tool calling formats. Goose translates between them:Model Capabilities
Providers expose model capabilities throughModelInfo:
- Manage context windows
- Estimate costs
- Enable/disable features (like prompt caching)
- Choose appropriate models for subagents
Custom Providers
You can add custom providers without modifying Goose’s code:1. Declarative Provider (JSON)
For OpenAI-compatible APIs:openai: OpenAI-compatible APIanthropic: Anthropic-compatible APIollama: Ollama-compatible API
2. Code-Based Provider (Rust)
For custom protocols:Provider Selection
Goose determines which provider to use via configuration precedence:-
Subagent settings (highest priority)
-
Recipe settings
-
Environment variables
-
Config file
- Default (Anthropic Claude)
Streaming
All providers support streaming responses:Token Usage Tracking
Providers report token usage for cost estimation:Error Handling
Providers return standardized errors:Multi-Provider Workflows
You can use different providers for different tasks:Provider Comparison
| Provider | Tool Calling | Streaming | Vision | Local | Cost |
|---|---|---|---|---|---|
| Anthropic | Native | Yes | Yes (Claude 3.5+) | No | $$$ |
| OpenAI | Function calling | Yes | Yes (GPT-4V) | No | $$$ |
| Ollama | Via toolshim | Yes | Some models | Yes | Free |
| Google Gemini | Native | Yes | Yes | No | $$ |
| AWS Bedrock | Model-dependent | Yes | Model-dependent | No | $$ |
| LiteLLM | Pass-through | Yes | Model-dependent | No | Varies |
| Local Inference | Via toolshim | Yes | No | Yes | Free |
Tool Calling Approaches
Native: Provider API has built-in tool calling support- Anthropic, OpenAI, Google Gemini
- Best accuracy and performance
- Ollama, local models
- Works but less reliable
- Good for experimentation
Best Practices
Choose models appropriate to the task
Choose models appropriate to the task
- Simple tasks: Use cheaper/faster models (GPT-4o-mini, Claude Haiku)
- Complex reasoning: Use powerful models (Claude Sonnet, GPT-4o)
- Code generation: Use code-specialized models (Qwen Coder, Claude)
- Privacy-sensitive: Use local models (Ollama)
Set appropriate context limits
Set appropriate context limits
Handle rate limits gracefully
Handle rate limits gracefully
Use prompt caching when available
Use prompt caching when available
Anthropic and some other providers support caching system prompts:
Troubleshooting
Common Issues
“Authentication failed”- Wait and retry (automatic)
- Upgrade API tier
- Use multiple API keys with load balancing (via LiteLLM)
Next Steps
Extensions
Learn about the tools providers can use
Recipes
Configure providers in recipes
Configuration
Advanced provider configuration
Custom Distributions
Bundle custom providers