Skip to content

fix(catalog): restore LiteLLM bundled metadata fallback#4701

Open
roboomp wants to merge 1 commit into
mainfrom
farm/73613247/litellm-bundled-catalog-fallback
Open

fix(catalog): restore LiteLLM bundled metadata fallback#4701
roboomp wants to merge 1 commit into
mainfrom
farm/73613247/litellm-bundled-catalog-fallback

Conversation

@roboomp

@roboomp roboomp commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Repro

With models.dev mocked as empty and LiteLLM /model_group/info returning glm-5.2, litellmModelManagerOptions({ baseUrl, fetch }).fetchDynamicModels() returned a LiteLLM model with reasoning: false and no thinking block. The recorded repro used the catalog module directly with a mocked fetch implementation matching omp models refresh litellm --json enrichment inputs.

Cause

packages/catalog/src/provider-models/openai-compat.ts loaded models.dev references in litellmModelManagerOptions and used modelsDevReferences.get(id) as the only reference resolver. When models.dev lacked glm-5.2, both mapLiteLLMRichEntry and mapLiteLLMOpenAICompatibleModel received undefined and fell back to default non-reasoning metadata instead of the bundled catalog entry.

Fix

  • Changed LiteLLM dynamic discovery to build its resolver with createReferenceResolver(modelsDevReferences), preserving models.dev precedence while adding bundled catalog fallback metadata.
  • Added a rich /model_group/info regression for glm-5.2 proving LiteLLM transport fields remain while bundled reasoning/thinking metadata is inherited.
  • Added a /v1/models fallback regression for the same bundled metadata path.
  • Added the catalog changelog entry for LiteLLM discovery enriches against models.dev only, misses bundled catalog reasoning/thinking metadata #4695.

Verification

bun test packages/catalog/test/litellm-provider.test.ts -t "enriches LiteLLM rich models missing from models.dev with bundled reasoning metadata" passed; bun test packages/catalog/test/litellm-provider.test.ts -t "enriches LiteLLM /v1/models fallback entries missing from models.dev with bundled reasoning metadata" passed; bun test packages/catalog/test/litellm-provider.test.ts passed with 15 tests; bun --cwd packages/catalog check passed. gh_push_branch also completed its pre-publish gate before pushing. Fixes #4695

Resolved LiteLLM dynamic discovery to fall back to bundled catalog references when models.dev has no matching model.

Added rich-endpoint and /v1/models fallback regressions for glm-5.2 reasoning/thinking metadata.

Fixes #4695
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@roboomp

roboomp commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

No code change requested here. The Codex review bot could not run because the repo has reached code-review usage limits; a repo admin needs to add/enable credits in the Codex cloud settings before that review can proceed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

vouched Passed the vouch gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LiteLLM discovery enriches against models.dev only, misses bundled catalog reasoning/thinking metadata

1 participant