Skip to main content

Module provider

Module provider 

Source
Expand description

LLM provider abstraction.

Two wire formats cover the entire ecosystem:

  • Anthropic Messages API (Claude models)
  • OpenAI Chat Completions (GPT, plus Groq, Together, Ollama, DeepSeek, etc.)

Each provider translates between our unified message types and the provider-specific JSON format for requests and SSE streams.

Structs§

ProviderRequest
A provider-agnostic request.

Enums§

ProviderError
Provider-level errors.
ProviderKind
Provider kinds.
ToolChoice
Tool choice mode for controlling tool usage.

Traits§

Provider
Unified provider trait. Both Anthropic and OpenAI-compatible endpoints implement this.

Functions§

detect_provider
Detect the right provider from a model name or base URL.