Skip to content

feat(provider)!: sync catalog from models.dev + fix discovery schema#41

Merged
epicsagas merged 1 commit into
mainfrom
feat/catalog-sync
Jun 15, 2026
Merged

feat(provider)!: sync catalog from models.dev + fix discovery schema#41
epicsagas merged 1 commit into
mainfrom
feat/catalog-sync

Conversation

@epicsagas

Copy link
Copy Markdown
Owner

Summary

  • catalog-sync toolchain: new catalog-sync feature + llm-kernel-sync-catalog binary that refreshes the embedded catalog.json from the live models.dev API (--check drift detection, atomic write, field-precedence merge).
  • catalog↔discovery merge (issue feat: v0.1.0 quality hardening — R1-R20 #1): ProviderIndex::with_discovered() overlays runtime-discovered models so estimate_cost/find_model see them.
  • discovery parser fix (issue docs(i18n): add 10-language README translations #3 / latent bug): the models.dev parser was rewritten to the real provider-keyed schema — the previous { models: [...] } shape never parsed the live https://models.dev/api.json. ModelEntry enriched with cost/modalities/capabilities.
  • catalog refreshed: 20 providers, 351 models (was ~57), pricing/limits now track models.dev.

Field precedence (sync)

  • Provider service fields (auth, base URL, tiers, setup): catalog wins.
  • Model fields (cost, limits, modalities, capabilities): models.dev wins.
  • Empty api_base_url/npm_package/doc_url: filled from models.dev.
  • glm-5, ZAI_API_KEY, all existing tests preserved.

Verification (local)

  • cargo test --all-features → 502 passed, 0 failed
  • cargo clippy --all-features -- -D warnings → clean
  • cargo fmt --all -- --check → clean
  • RUSTDOCFLAGS=-D warnings cargo doc --all-features --no-deps → clean
  • cargo run --bin llm-kernel-sync-catalog --features catalog-sync -- --check after write → in sync (idempotent)
  • isolated --features catalog-sync and --no-default-features builds clean

BREAKING CHANGE

ModelsDevPayload is now a provider-keyed map mirroring the real models.dev API (HashMap<provider_id, provider>). The previous { models: Vec<ModelEntry> } shape could not parse the live endpoint. ModelEntry gained optional fields (additive for serde reads). → argues for a minor bump (0.10.0) rather than patch.

Docs

README + 10 i18n READMEs updated (discovery API + new "Keeping the catalog fresh" runtime-merge section + catalog-sync feature row + counts).

Add a catalog-sync toolchain that refreshes the embedded catalog.json from
the live models.dev API, and fix the discovery parser which never matched
the real models.dev schema.

- catalog-sync feature + llm-kernel-sync-catalog binary: fetch models.dev,
  merge with field precedence, --check drift detection, atomic write
- provider/mapping: catalog->models.dev provider-id mapping (8 exact,
  7 aliased, 5 manual)
- provider/sync: pure merge_catalog + CatalogDiff/PriceDelta; provider
  service fields catalog-wins, model data models.dev-wins, empty
  api_base_url/npm_package/doc_url filled from upstream
- ProviderIndex::from_providers + with_discovered (discovery-gated):
  overlay runtime-discovered models so find_model/estimate_cost see them
- discovery: rewrite models.dev parser to the REAL provider-keyed map
  schema; enrich ModelEntry with cost/modalities/capabilities + Default;
  add fetch/fetch_from; From<ModelEntry> for ModelDescriptor
- catalog value types now derive Serialize + PartialEq
- catalog.json refreshed from models.dev: 20 providers, 351 models
- docs: README + 10 i18n READMEs updated for the new discovery API and
  the runtime with_discovered path; AGENTS.md + CHANGELOG updated

BREAKING CHANGE: ModelsDevPayload is now a provider-keyed map mirroring
the real models.dev API (HashMap<provider_id, provider>). The previous
{ models: Vec<ModelEntry> } shape could not parse the live endpoint.
ModelEntry gained optional cost/modalities/capabilities/family/
release_date/knowledge fields (additive for serde reads).
@epicsagas epicsagas merged commit 1f0b96c into main Jun 15, 2026
22 checks passed
@epicsagas epicsagas deleted the feat/catalog-sync branch June 15, 2026 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant