Repository navigation
server: inherit model_info when creating from a remote model - #16972
Open
tenderdeve wants to merge 1 commit into
Open
tenderdeve wants to merge 1 commit into
tenderdeve wants to merge 1 commit into
Conversation
Deriving a model from a remote parent (e.g. FROM glm-5.2:cloud) only copied RemoteModel and RemoteHost into the new config, dropping the parent's architecture, context length, and embedding length. /api/show and /api/tags then returned an empty model_info for the derived model, so integrations that read the context window from model_info fell back to a short default. Load the parent's stored config in the remote branch and inherit those fields, mirroring the existing inheritance for local parents.
This branch has not been deployed
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.
Fixes #16891
Creating a model from a remote parent (e.g.
FROM glm-5.2:cloud) only carriedRemoteModelandRemoteHostinto the new config. The parent's architecture, context length and embedding length were dropped, so/api/showand/api/tagsreturned an emptymodel_infofor the derived model.Integrations that read the context window from
model_info(e.g. VSCode Copilot) then fall back to a short default (~32K), which breaks long-context use of any model created this way. Sinceollama createis the only config path for those integrations, there's no workaround.The remote branch in
CreateHandlernow loads the parent's stored config and inheritsmodel_family,context_lengthandembedding_length, mirroring the inheritance already done for local parents. ExplicitInfooverrides still win.Added
TestCreateFromRemoteModelInheritsModelInfo, which fails onmain(emptymodel_info) and passes with the change.