Skip to main content

Module catalog

Module catalog 

Source
Expand description

Normalized model catalog types and provider-specific parsers.

This module is intentionally parser-first: unit tests exercise static JSON fixtures only. Live network fetches are thin wrappers around these parsers.

§Provider research notes (spec appendix)

OpenRouter GET https://openrouter.ai/api/v1/models — no auth required. Metadata: id, name, context_length, supported_parameters, pricing, top_provider, architecture.input_modalities. Reasoning detected from supported_parameters:

  • “reasoning”/“include_reasoning” => OpenRouter reasoning request
  • “reasoning_effort” => effort-style (o-series via OR)
  • “verbosity” => Anthropic-style through OR
  • pricing.internal_reasoning => Gemini thinking-token pricing

Groq GET https://api.groq.com/openai/v1/models — Bearer auth. Fields: id, active, context_window, owned_by. No reasoning in wire.

NVIDIA NIM GET https://integrate.api.nvidia.com/v1/models — no auth for list. Minimal: id, object, created, owned_by. Thinking via system-prompt injection.

Anthropic GET https://api.anthropic.com/v1/models — paginated, Bearer/x-api-key. Optional capabilities.thinking / capabilities.effort.

Structs§

AnthropicCatalogPage
AnthropicCatalogProvider
CatalogModel
Normalized model catalog entry. Every provider handler produces these.
CodexCatalogProvider
GenericCatalogProvider
GroqCatalogProvider
NvidiaCatalogProvider
OpenRouterCatalogProvider
PricingSummary
Pricing metadata. Stored as decimal-string USD/token as returned by OpenRouter.

Enums§

CatalogProviderKind
CatalogSource
Modality
Input/output modality.
ReasoningSupport
Normalized reasoning/thinking capability for a model.

Constants§

CATALOG_REQUEST_TIMEOUT

Traits§

ModelCatalogProvider

Functions§

anthropic_models_url
catalog_provider_for
codex_static_catalog_models
fetch_catalog_models
Fetch catalog models for any registered provider. OpenRouter uses its rich parser; all others use the generic parser. Compatible shim: callers that previously used registry::fetch_provider_models and then mapped to ExpandedModelEntry can switch to this.
fetch_generic_catalog_models
Fetch a generic provider’s /models endpoint.
fetch_openrouter_catalog_models
Fetch the OpenRouter live model list. Auth not required.
from_static_seed
Build a static-fallback CatalogModel from a (id, label) pair.
infer_groq_reasoning
infer_nvidia_reasoning
merge_catalog_pages
parse_anthropic_catalog_models
parse_anthropic_catalog_page
parse_generic_catalog_models
Parse a {data:[{id,name?}]} response. Identical filtering behaviour to registry::parse_provider_models_response.
parse_groq_catalog_models
parse_nvidia_catalog_models
parse_openrouter_catalog_models
Parse an OpenRouter /models JSON body into CatalogModel entries. Pure function — no network I/O — safe to unit-test with fixtures.
static_seeds_from_spec
Convert all static seeds in a ProviderSpec to CatalogModel entries.