OpenProgram Docs

Model catalog

Browse official list + models.dev memory only enable config.json full spec rows with provider.json fields ENABLED_MODELS get_model, chat picker, agents, failover
  1. Browse: official list and models.dev, memory only
  2. enable
  3. config.json: full spec rows with provider.json fields
  4. ENABLED_MODELS: get_model, chat picker, agents, failover

Selectable in chat equals enabled equals resolvable: there is one list. No big files, nothing stale, and the package directory stays read-only.

Who writes what

AuthorLocationContent
Humans, in gitproviders/adapters/<p>/provider.json, plus <p>.py for dedicated protocolsendpoints, thinking, cache, overrides
The programconfig.json → providers.<p>.modelsenabled specs, keys, user state
Networkmodels.dev, official /v1/modelsbrowsing only

Providers with no directory work through models.dev. catalog/enabled_models.py is the registry, settings/storage.py persists config, settings/thinking_spec.py holds thinking, models/listing/ is what interfaces read. Nothing else is named a catalog.

provider.json

Every field optional. If a machine can obtain a field, a human does not write it, so there is no model list.

FieldPurposeDefault
endpointsnamed api and base_url groupsmodels.dev base_url, OpenAI-compatible
thinkingwire_format, effort maps, per-model levels: Thinking effortlow, medium, high
cacheprompt cachingnone
model_overridesper-model headers, compat, endpoint, key_prefix; folded into the spec at enable timenone

Directories use underscores (amazon_bedrock/); id keeps hyphens. One service with two protocols is two endpoints of one provider.

Browse

ListHow
Provider listprovider.json providers plus the models.dev index, names and status only
Model listQueried for one provider (_browse_models_with_error): the official source when credentialed, models.dev filling gaps or standing in, else empty. A short memory cache keeps the result
Model only the official list namesTakes what it accepts (images, files, tools) from the listed model its id extends, grok-4.7-build-fast from grok-4.7, since a row with no word on it is text only. Price, context and name are never carried over
models.dev catalogueIn memory and on disk, fresh for an hour. The disk copy's age is its file's, since every command is a new process
Source shapeFetcher
Standard /v1/modelslisting/fetchers/openai_compat.py
Anthropic, per-model capabilitiesadapters/anthropic/list_models.py
Vendor-specificgoogle (query key), amazon_bedrock (SigV4), deepseek (ids only, enriched)

A provider that departs from standard ships list_models.py exposing fetch(provider_id, timeout); _load_fetcher imports it by directory, no central edit. Success: list[dict] with id and name. Failure: {"error": …}. fetch_and_normalize is the one normalisation point.

Enable, disable, refresh

ActionEffect
Enable (toggle_model)Browse row, overrides, endpoint api and base_url, derived thinking levels go in providers.<p>.models; the registry reloads
DisableDeletes the row; a manual row stays with enabled: false.
RefreshRe-browses enabled models and overwrites their specs
Manual modelSame list, source: "manual"

Use

ReaderSource
BackendENABLED_MODELS, key <prefix>/<id>, through get_model, get_providers, get_models; aliases on a miss
GET /api/providers/listProvider list
GET /api/providers/{name}/modelsThat provider's cached browse and enabled flags; POST …/fetch-models queries now
GET /api/models/enabledChat picker: ENABLED_MODELS as is
runtime/harnesses/thinking_effort.pyLevels from enabled rows

A failover or agent reference to a non-enabled model is a configuration error pointing at Settings. Old sessions keep their history but cannot continue on a deleted model.

An unknown id is refused with the nearest ones (catalog/suggestions.py): "Unknown model 'openai':'gpt6 sol'; did you mean openai:gpt-6.1-sol, …?". Names compare by words: display-name word 4, id word 3; a version or provider id counts only beside those. Follows magpie (yetone/magpie, MIT).

Invariants

  1. The only persisted model data is enabled specs in config.
  2. Ordinary browsing is never written to a file.
  3. Human data in git, program data in user config.
  4. provider.json has only what machines cannot obtain.
  5. openprogram.models.providers never imports openprogram.interfaces.server; the listing imports providers, never the reverse.
  6. <prefix>/<id>, alias fallback and key_prefix are preserved; the registry stays one mutable dict.
  7. One each: fetch_and_normalize (row shape), _upsert_spec_row with _normalize_spec_row (into config), _build_model_from_row (into Model).
What a change must preserve
  • A config row resolves through get_model to the same Model for every provider.
  • cost, multimodal input, headers and compat travel in the spec.
  • Multi-wire providers need one exec per (api, base_url, headers, compat).
  • test_provider_wire_invariants.py and test_model_fetch_routing.py stay green.

Fast tier

Last updated · 2026-11-30