Skip to main content
Providers are the bridge between Goose and AI models. They abstract different LLM APIs behind a common interface, enabling Goose to work with 25+ AI services from Anthropic, OpenAI, local models, and more.

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

Google

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

API keys stored separately in keyring or secrets file:

Via Recipe

Provider Implementation

Example: Anthropic Provider

Tool Calling Translation

Different providers have different tool calling formats. Goose translates between them:
Goose providers handle these translations automatically.

Model Capabilities

Providers expose model capabilities through ModelInfo:
Goose uses this information to:
  • 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:
Supported engines:
  • openai: OpenAI-compatible API
  • anthropic: Anthropic-compatible API
  • ollama: Ollama-compatible API

2. Code-Based Provider (Rust)

For custom protocols:

Provider Selection

Goose determines which provider to use via configuration precedence:
  1. Subagent settings (highest priority)
  2. Recipe settings
  3. Environment variables
  4. Config file
  5. 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:
The agent’s retry manager handles transient errors automatically:

Multi-Provider Workflows

You can use different providers for different tasks:

Provider Comparison

Tool Calling Approaches

Native: Provider API has built-in tool calling support
  • Anthropic, OpenAI, Google Gemini
  • Best accuracy and performance
Toolshim: Goose adds tool calling via system prompts
  • Ollama, local models
  • Works but less reliable
  • Good for experimentation

Best Practices

  • 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)
Anthropic and some other providers support caching system prompts:

Troubleshooting

Common Issues

“Authentication failed”
“Model not found”
“Rate limit exceeded”
  • Wait and retry (automatic)
  • Upgrade API tier
  • Use multiple API keys with load balancing (via LiteLLM)
“Context length exceeded”

Next Steps

Extensions

Learn about the tools providers can use

Recipes

Configure providers in recipes

Configuration

Advanced provider configuration

Custom Distributions

Bundle custom providers