fix: preserve context_length and case-insensitive custom: provider strip on model switch#519
Open
yzxuyang wants to merge 1 commit intoEKKOLearnAI:mainfrom
Open
fix: preserve context_length and case-insensitive custom: provider strip on model switch#519yzxuyang wants to merge 1 commit intoEKKOLearnAI:mainfrom
yzxuyang wants to merge 1 commit intoEKKOLearnAI:mainfrom
Conversation
…rip on model switch
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.
PR: fix: preserve context_length and handle custom: prefix in setConfigModel
问题
PUT /api/hermes/config/model(setConfigModel) 有两个 bug:1. context_length 丢失
第 231 行
config.model = {}清空了整个 model 对象。context_length在切换模型后丢失。2. custom: 前缀未处理
从 Web UI 切换模型时,provider 字段传的是
custom:Ollama(或custom:ollama),但:config.model.provider = reqProvider,gateway 不识别custom:Ollama(大小写敏感)custom:前缀,大小写不敏感匹配config.providers的键名修复
文件:
packages/server/src/controllers/hermes/models.ts测试方法
~/.hermes/config.yaml中model.provider应为ollama(无custom:前缀)model.context_length在前一步手动设置的值是否保留相关 Issue
#204 修复了 stale base_url/api_key 问题,但未解决 context_length 丢失和 custom: 前缀处理。