fix(catalog): restore LiteLLM bundled metadata fallback#4701
Open
roboomp wants to merge 1 commit into
Open
Conversation
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
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Repro
With
models.devmocked as empty and LiteLLM/model_group/inforeturningglm-5.2,litellmModelManagerOptions({ baseUrl, fetch }).fetchDynamicModels()returned a LiteLLM model withreasoning: falseand nothinkingblock. The recorded repro used the catalog module directly with a mocked fetch implementation matchingomp models refresh litellm --jsonenrichment inputs.Cause
packages/catalog/src/provider-models/openai-compat.tsloadedmodels.devreferences inlitellmModelManagerOptionsand usedmodelsDevReferences.get(id)as the only reference resolver. Whenmodels.devlackedglm-5.2, bothmapLiteLLMRichEntryandmapLiteLLMOpenAICompatibleModelreceivedundefinedand fell back to default non-reasoning metadata instead of the bundled catalog entry.Fix
createReferenceResolver(modelsDevReferences), preservingmodels.devprecedence while adding bundled catalog fallback metadata./model_group/inforegression forglm-5.2proving LiteLLM transport fields remain while bundled reasoning/thinking metadata is inherited./v1/modelsfallback regression for the same bundled metadata path.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.tspassed with 15 tests;bun --cwd packages/catalog checkpassed.gh_push_branchalso completed its pre-publish gate before pushing. Fixes #4695