Skip to main content

Crate infinity_provider_models_dev

Crate infinity_provider_models_dev 

Source
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@a276c37.
convert
Shared conversion helpers between the infinity protocol Message types and the OpenAI / Anthropic wire formats.
oauth
Claude Pro/Max subscription auth (OAuth) for the Anthropic backend.
openai
OpenAI Chat Completions backend with SSE streaming.
preset
Backend preset table: one entry per upstream provider/gateway.

Structs§

MultiProvider
ModelProvider that fans out to every env-configured backend.

Constants§

USER_AGENT
Crate user agent sent on every upstream request.