Expand description
Backend preset table: one entry per upstream provider/gateway.
Each preset maps the API-key env vars documented by
pi and the provider catalog used
by opencode (via models.dev)
to an OpenAI-compatible (or Anthropic-native) base URL plus a small
default model list. Presets activate when one of their key env vars is
set; everything else has a default so export FOO_API_KEY=... is enough.
Per-backend overrides (all optional):
<PREFIX>_BASE_URL— override the endpoint (also honors the well-known vars listed inbase_envs, e.g.OPENAI_BASE_URL).<PREFIX>_MODELS— comma-separated model ids to advertise instead of the built-ins.<PREFIX>_MODEL— single model id (same effect, one entry).
A fully custom OpenAI-compatible endpoint works without a preset:
INFINITY_OPENAI_BASE_URL+INFINITY_OPENAI_API_KEY(+ optionalINFINITY_OPENAI_MODELS).
Structs§
- Backend
Model - One model offered by a resolved backend.
- Preset
- One upstream provider/gateway.
- Preset
Model - A built-in model advertised for a backend.
- Resolved
Backend - A backend resolved from the environment and ready to serve.
Enums§
- Flavor
- Wire flavor of a backend.
Constants§
Functions§
- resolve_
backends - Scan the environment for every configured backend, in preset order.