Back to Goose

goose-providers

crates/goose-providers/README.md

1.48.01.9 KB
Original Source

goose-providers

Provider implementations for goose. The trait they implement and the conversation types they exchange live in goose-provider-types, which this crate re-exports — depend on this crate when you want working providers, and on the types crate when you only need the contract.

Native providers

ModuleProvider
anthropicAnthropic
openaiOpenAI
openai_compatibleAny OpenAI-compatible endpoint
googleGoogle Gemini
databricks, databricks_v2, databricks_authDatabricks, including OAuth
azure_foundryAzure AI Foundry
snowflakeSnowflake Cortex
ollamaOllama
local_inferenceOn-device models (requires local-inference)

Declarative providers

Most OpenAI-compatible services don't need Rust code — they're a JSON file in src/declarative/definitions/ (Groq, Mistral, Together, Cerebras, DeepSeek, Perplexity, LM Studio, Vercel AI Gateway, and ~30 more). Each definition declares its engine, base URL, env vars, and models.

declarative exposes the same shape at runtime:

  • deserialize_provider_config / from_json — build a DeclarativeProviderConfig from JSON.
  • load_custom_providers(dir) — load user-supplied definitions from disk.
  • fixed_provider_configs — the bundled set.
bash
cargo run -p goose-providers --example declarative
cargo run -p goose-providers --example streaming

Features

Default is [].

  • TLS (pick one): rustls-tls or native-tls.
  • local-inference — pulls in goose-local-inference; cuda, vulkan, mlx select an accelerator and imply it.

Shared plumbing

api_client (HTTP with auth and retries), http_status (mapping responses to ProviderError), and the re-exported retry, cache_semantics, thinking, and formats modules are what the provider implementations are built from — start there when adding a new one.