Expand description
Upstream provider clients, normalized to the OpenAI chat/completions
wire shape in both directions. Provider is the single seam: proxy code
never branches on provider kind.
Re-exports§
pub use registry::ProviderRegistry;
Modules§
- anthropic
- Anthropic Messages API client. Translates OpenAI-shaped requests/responses at the wire boundary so the rest of the gateway stays OpenAI-canonical.
- ollama
- Ollama client — uses the OpenAI-compatible endpoint Ollama exposes on
/v1/chat/completions, so this is essentially the OpenAI client with no auth header and a localhost base URL. - openai
- OpenAI client (also covers DeepSeek, Cerebras, DeepInfra — anything that
speaks OpenAI’s
/v1/chat/completionswire shape). - registry
- Resolves a model name to a concrete
Provider, in order: configured alias,provider:modelprefix, model-family heuristic, then the opt-inrouting.default_provider.
Structs§
- Chat
Choice - Chat
Message - Chat
Request - Canonical OpenAI-shaped chat completion request.
- Chat
Response - Canonical OpenAI-shaped chat completion response.
- Usage
Enums§
- Provider
Error - Stream
Chunk - A single SSE event from an upstream provider, passed to the client as-is.
Traits§
Functions§
- response_
visible_ content_ empty - True when the visible
message.contentis empty or whitespace. Reasoning-mode models can emit every token into areasoningfield and leave content blank, which is a broken response to the caller.