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.
Re-exports§
pub use kimi::apply_kimi_reasoning_params;pub use kimi::kimi_code_capability;pub use kimi::kimi_code_model;pub use kimi::kimi_code_static_catalog_models;pub use kimi::kimi_static_capability;pub use kimi::KimiCodeModelDescriptor;pub use kimi::KimiReasoningCapability;pub use kimi::KIMI_CODE_TEXT_MODELS;
Modules§
- capability_
cache - Process-local capability cache keyed by provider-qualified model id. Populated when a live Codex catalog is parsed; consulted by validation before falling back to the static table. No credentials stored.
- kimi
- Exact-id reasoning capability for the Kimi (Moonshot AI) static provider.
- validation
- Shared mutation-time reasoning validation and dynamic option derivation.
Structs§
- Anthropic
Catalog Page - Anthropic
Catalog Provider - Anthropic
Execution Plan - Anthropic
Plan Error - Anthropic
Plan Prerequisites - Catalog
Model - Normalized model catalog entry. Every provider handler produces these.
- Codex
Catalog Provider - Codex
Execution Plan - Codex
Plan Error - Copilot
Catalog Entry - Rich, evidence-preserving row from an experimental Copilot
/modelsbody. - Copilot
Model Descriptor - Typed static descriptor for curated fallback models.
- Generic
Catalog Provider - GitHub
Copilot Catalog Provider - Google
Gemini Catalog Provider - Google
Gemini Model Descriptor - Groq
Catalog Provider - Nvidia
Catalog Provider - Open
Router Catalog Provider - Pricing
Summary - Pricing metadata. Stored as decimal-string USD/token as returned by OpenRouter.
- XaiCatalog
Provider - XaiModel
Descriptor
Enums§
- Anthropic
Execution Mode - Anthropic
Plan Error Code - Anthropic
Wire Effort - Anthropic
Workflow Plan - Catalog
Broker Error - Typed broker catalog failure (fix1 I2a): the static-fallback decision is made on TYPED broker variants, never by probing Display strings after the fact — so the outcome is deterministic for every credential state.
- Catalog
Provider Kind - Catalog
Source - Codex
Capability Source - Codex
Execution Mode - Codex
Multi Agent Mode - Codex
Multi Agent Version - Multi-agent protocol version advertised by the exact OpenAI Codex model.
- Codex
Plan Error Code - Codex
Wire Effort - Reasoning values accepted by the Codex Responses request wire. Logical Ultra is deliberately absent and must be lowered by the planner.
- Copilot
Endpoint - Wire endpoint literals advertised on Copilot catalog rows.
- Copilot
Policy State - Copilot per-model policy
state— reflects account entitlement. - Copilot
Wire - Statically-selected wire endpoint for a curated fallback descriptor.
- Execution
Role - Modality
- Input/output modality.
- Reasoning
Support - Normalized reasoning/thinking capability for a model.
- XaiReasoning
Capability - Documented reasoning capability for an exact xAI model id.
Constants§
- CATALOG_
REQUEST_ TIMEOUT - CODEX_
CLIENT_ VERSION - Codex client protocol version advertised on catalog discovery.
- CODEX_
PROVIDER_ KEY - Canonical provider key (matches OAuth storage / broker id).
- CODEX_
PROVIDER_ NAME - User-facing provider name.
- COPILOT_
API_ VERSION - Live-verified API version header for
api.githubcopilot.comcatalog GETs. - COPILOT_
FALLBACK_ MODELS - Curated fallback — every entry is proven by
selectable_copilot_entrieson the reviewed fixture:type == chat,model_picker_enabled == true, and at least one reviewed endpoint. Policy/picker flags are opt-in metadata. Ordered for UI presentation. - COPILOT_
PROVIDER_ KEY - Canonical provider key (matches OAuth storage / broker id).
- COPILOT_
PROVIDER_ NAME - User-facing provider name.
- GOOGLE_
GEMINI_ PROVIDER_ KEY - GOOGLE_
GEMINI_ PROVIDER_ NAME - GOOGLE_
GEMINI_ TEXT_ MODELS - Text/tool-capable wire IDs exposed by the official Gemini CLI. Preview and rollout models are intentionally visible; upstream account policy remains authoritative and may reject models not enabled for a particular user.
- MAX_
MODELS_ BODY_ BYTES - Maximum response body accepted from the models endpoint (256 KiB).
- MODELS_
BASE_ URL - Pinned experimental models host for personal Copilot catalog discovery. Community-observed; not a GitHub-documented stable third-party API.
- MODELS_
PATH - Relative path allowlisted on the broker for this slice (catalog only).
- MODELS_
URL - Full pinned models URL (host + path, no query).
- XAI_
TEXT_ MODELS
Traits§
Functions§
- anthropic_
mode_ capabilities - Look up exact qualified identities only. The complete manifest is validated before each decision; malformed source authority therefore fails closed.
- anthropic_
models_ proxy_ path - Relative Anthropic models path for the broker allowlist (no host).
- anthropic_
models_ url - anthropic_
static_ capability - Conservative exact static fallback descriptors for the source-controlled
known-model list (
agent_core::models::KNOWN_MODELS). Exact ids only — never substring-based. Evidence: adaptive-thinking notes incrates/agent-core/src/core/models.rs(Opus 4.7+ / Fable 5 adaptive+effort; Sonnet 4.6, Opus 4.6, Haiku 4.5 fixed-budget thinking). - catalog_
provider_ for - codex_
models_ path - Build the broker-relative path for the ChatGPT backend Codex catalog
endpoint, including the required
client_versionquery (matches official Codex). An emptyclient_versionfalls back to the pinnedCODEX_CLIENT_VERSION— never SynapsCLI’s own crate version, which the backend would reject with an empty catalog. - codex_
models_ url - Full pinned models URL (host + path + client_version query).
- codex_
static_ capability - Static per-model capability for the known Codex catalog, keyed by model id. Used when live catalog data is unavailable.
- codex_
static_ catalog_ models - Build the static catalog models with static capability data attached.
- copilot_
model - Look up a curated fallback descriptor by wire id.
- copilot_
static_ catalog_ models - Static fallback catalog for offline / seed UI paths. Every entry here is
selectable by construction (see
COPILOT_FALLBACK_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_modelsand then mapped toExpandedModelEntrycan switch to this. - 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.
- github_
copilot_ runtime_ model - Select the wire protocol from endpoints established by the captured live catalog. This is descriptor-driven: only IDs whose reviewed endpoint has been established by the fixture route. Unknown account models fail closed.
- google_
gemini_ model - google_
gemini_ static_ catalog_ models - infer_
groq_ reasoning - infer_
nvidia_ reasoning - is_
missing_ credential_ catalog_ error - True when a broker catalog error means “no credential / not logged in”, so static seeds are an acceptable offline fallback.
- merge_
catalog_ pages - models_
request_ headers - Headers attached to the experimental Copilot models GET. Session bearer is applied by the broker — never pass the GitHub user token.
- parse_
anthropic_ catalog_ models - parse_
anthropic_ catalog_ page - parse_
codex_ catalog_ models - Parse the ChatGPT backend-api models response into normalized catalog rows.
- parse_
copilot_ catalog_ entries - Parse an experimental Copilot
/modelsbody into rich descriptor entries. - parse_
copilot_ catalog_ models - Parse an experimental Copilot
/modelsbody into normalized catalog rows. - parse_
generic_ catalog_ models - Parse a
{data:[{id,name?}]}response. Identical filtering behaviour toregistry::parse_provider_models_response. - parse_
groq_ catalog_ models - parse_
nvidia_ catalog_ models - parse_
openrouter_ catalog_ models - Parse an OpenRouter
/modelsJSON body into CatalogModel entries. Pure function — no network I/O — safe to unit-test with fixtures. - plan_
anthropic_ execution - plan_
codex_ execution - Derive the exact Codex request contract from provider-qualified identity, logical selection, authoritative capability metadata, and runtime role.
- plan_
standard_ anthropic_ transport - preferred_
wire_ protocol_ from_ endpoints - Choose a broker wire protocol from a fixture row’s
vendorandsupported_endpoints. ReturnsNonewhen no reviewed endpoint is advertised (fail closed). - selectable_
copilot_ entries - Selectable-only view — helper for pickers and expanded-fallback checks.
- static_
seeds_ from_ spec - Convert all static seeds in a ProviderSpec to CatalogModel entries.
- validate_
codex_ level - Validate that the given
levelis supported by the Codex model identified bymodel_id. Uses the provided catalog when available, else falls back to the static table. - validate_
models_ endpoint - Validate the pinned models URL (fail closed on host/path drift).
- xai_
model - xai_
static_ capability - Exact-id capability lookup — never substring-based. Unknown ids return
Noneand fail closed at validation time. - xai_
static_ catalog_ models
Type Aliases§
- Codex
Request Role - Backward-compatible name; request role semantics are provider-neutral.