-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: ollama 模型中的“保持活跃时间“选项无效 #1938
Comments
抓一下包, 软件应该是成功的把 keep_alive 参数发出了, 你在你电脑上运行下面的命令, 如果 ollama 活跃时间没有变成 15分钟, 那可能是 ollama 的问题
|
命令行跑了一下发现确实变了,但是在cherrystudio中,改了时间然后点击API密钥-检查,还是没有改变,打开控制台发现http://localhost:11434/v1/chat/completions 的payload是 {
"model": "deepseek-r1:14b",
"messages": [
{
"role": "user",
"content": "hi"
}
],
"stream": false
} 即在点击检查按钮时这里并没有带上keepalive参数。同时我发现在聊天时也使用这个api,带上了keepalive参数同样没有用,于是我查了一下ollama的api文档,似乎里面并没有/chat/completions 这个api,而如果用其官方的 api/chat 带keepalive参数的话就可以正确设置存活时间了。 当然我对ollama和大语言模型不是很熟悉,我感觉是不是可以从两方面改正:
|
感谢反馈 |
我看了一下ollama的源码,chat/completions (https://github.com/ollama/ollama/blob/d2eb226c914aa86f2a371c340997d6e26e2aecef/server/routes.go#L1161)这个api应该是兼容openai的api的,而原版的[openai的api](https://platform.openai.com/docs/api-reference/chat/create) 中确实没有keep alive参数,所以导致使用 completions这个api时无法实现模型存活时间的修改。 |
那可以改一下 cherrystudio 用的 api, 调试一下用api/generate有没有其他兼容问题 |
不过 ollama 服务器端应该支持 OLLAMA_KEEP_ALIVE 环境变量吧, 你至少可以设置这个值为 15m |
将会去掉这个参数的设置选项 |
Issue Checklist
Platform
Windows
Version
v0.9.24
Bug Description
在模型服务-ollama中,保持活跃时间的选项不起作用,如图所示,
在我设置其活跃时间为15分钟后,进行对话之后,由命令行执行
ollama ps
后显示的时间还是五分钟:Steps To Reproduce
在模型服务-ollama中,调整保持活跃时间的选项,然后执行问答/检查api密钥以刷新模型存活时间
命令行执行
ollama ps
,观察其UNTIL栏目Expected Behavior
Until应该随保持活跃时间变动而变动
Relevant Log Output
Additional Context
No response
The text was updated successfully, but these errors were encountered: