Skip to main content

Module catalog

Module catalog 

Source
Expand description

Catalog - Workers AI model records and OpenRouter-format payload normalization.

This module owns the typed catalog contract consumed by the CLI (auth-cloudflare catalog get --format json), the Hermes plugin, and the conformance harness. The three-state CapabilityState deliberately distinguishes unknown from unsupported: the OpenRouter-format catalog omits supported_parameters for models whose docs confirm function calling, and incomplete metadata must never be encoded as Unsupported.

Structs§

CapabilityProvenance
Where each capability/field fact came from (provenance).
CatalogFilters
Filters applied when the snapshot was produced.
CatalogSnapshot
Versioned snapshot of the whole catalog - the JSON contract envelope.
ModelCapabilities
Capability matrix for a model - the picker’s tool/vision/reasoning view.
ModelLimits
Context/output limits.
ModelProtocol
Protocol facts for one model.
ModelRecord
Normalized Workers AI model record - one source of truth for the picker, the fallback list, and generated YAML.
PricingPerMillion
Per-million-token pricing (normalized to USD).

Enums§

Availability
Availability of a model for this account.
CapabilityState
Capability verdict for one model feature.
CatalogSource
Where the snapshot data came from.
ModelRole
Role of a Workers AI model in the provider catalog.
Visibility
Picker visibility policy for a model.

Constants§

EXPERIMENTAL_MODELS
Models currently marked experimental by project policy. Delivery conformance below threshold - selectable, never the default.
FALLBACK_MODELS
Curated fallback catalog - the account-verified 27 Cloudflare-hosted Workers AI chat models, filtered to a practical coding/tool set (minus llama-guard-3-8b).
HIDDEN_MODELS
Models hidden from the primary agent picker (safety/classification).
MODEL_FAMILIES_BY_ID
Hermes model_family values for the plugin’s primary models (mirrors the plugin’s PRIMARY_AGENT_MODELS / FALLBACK_MODELS sets). Unknown models yield no family (the sync record omits the field).
REASONING_EFFORTS_BY_MODEL
Reasoning-confirmed models and the reasoning_effort enum each accepts.
VISION_CONFIRMED
Vision-capable Cloudflare models (llama-3.2-11b-vision accepts image input). The models sync records carry supports_vision so Hermes’ per-model catalog knows which Cloudflare models take images; the plugin’s default_vision_model() returns this id for auxiliary vision calls.

Functions§

model_family_for
Hermes model_family for id, or None.
picker_models_from_openrouter
Normalize a full OpenRouter-format payload → picker model list.
reasoning_efforts_for
Reasoning effort vocabulary for id, or an empty slice when the model is not a documented reasoning model (the sync record then omits reasoning and reasoning_efforts entirely).
vision_confirmed_for
True when id is a vision-capable Cloudflare model.