fix: make model_info optional in ShowResponse for cloud models#624
Open
abdelhadi703 wants to merge 1 commit intoollama:mainfrom
Open
fix: make model_info optional in ShowResponse for cloud models#624abdelhadi703 wants to merge 1 commit intoollama:mainfrom
abdelhadi703 wants to merge 1 commit intoollama:mainfrom
Conversation
The `model_info` field in `ShowResponse` was missing a default value of `None` in its `Field()` declaration. Despite being typed as `Optional`, Pydantic requires an explicit default to treat the field as optional. This caused a `ValidationError` when `/api/show` responses from cloud models omitted the `model_info` key. Fixes ollama#607 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
Make
model_infofield optional inShowResponseto handle cloud models that don't return this field from/api/show.Fixes #607
Changes
Nonedefault value to themodel_infofield'sField()declaration inShowResponseOptionaltype annotation, causing aValidationErrorwhen cloud models omitmodel_infofrom their/api/showresponseTest plan
ShowResponsecan be instantiated withoutmodel_info(cloud model scenario)ShowResponsestill works correctly withmodel_infoprovided (local model scenario)🤖 Generated with Claude Code