Expand description
Multi-backend model provider for Infinity, configured through the same API-key env vars that pi and opencode understand.
Each configured upstream backend contributes its models under
<backend>/<model> ids (e.g. groq/llama-3.3-70b-versatile,
anthropic/claude-sonnet-4-6). The provider speaks OpenAI Chat
Completions streaming for OpenAI-compatible backends and Anthropic
Messages streaming for Anthropic, and translates both into the infinity
ModelProvider protocol — the same shape as
infinity-provider-bedrock, but for every non-Amazon provider.
export GROQ_API_KEY=...
export OPENROUTER_API_KEY=...
infinity-provider-models-dev # prints a unix socket path, serves the provider~/.infinity/providers.json:
{ "models_dev": { "command": ["infinity-provider-models-dev"] } }Modules§
- anthropic
- Anthropic Messages backend with SSE streaming.
- catalog_
generated - Model catalog generated from anomalyco/models.dev.
DO NOT EDIT — regenerate with
rust-script scripts/sync-models-dev.rs. Source revision: anomalyco/models.dev@6d51383f3. - convert
- Shared conversion helpers between the infinity protocol
Messagetypes and theOpenAI/Anthropicwire formats. - oauth
- Claude Pro/Max subscription auth (
OAuth) for theAnthropicbackend. - openai
OpenAIChat Completions backend with SSE streaming.- preset
- Backend preset table: one entry per upstream provider/gateway.
Structs§
- Multi
Provider ModelProviderthat fans out to every env-configured backend.
Constants§
- DEFAULT_
MODEL_ ENV - Env var pinning the global default: when set to a full
model_id(<backend>/<upstream-id>), that model is advertised first fromlist_modelsso infinity picks it as the default. - USER_
AGENT - Crate user agent sent on every upstream request.