chatbox icon indicating copy to clipboard operation
chatbox copied to clipboard

[Feature]I hope to add configuration parameters for the ollama model.

Open ugaxm opened this issue 1 year ago • 2 comments

Problem Description I am using ollama to call qwen2.5:7b and found that in the case of long texts, the context tokens seem to be limited to 2000-4000 tokens. Even setting the maximum conversation count to "unlimited" does not work. After consulting the official ollama documentation, I discovered that by passing the option ctx_num: 32000, the context length of qwen2.5:7b can be increased.

Proposed Solution In the model configuration of ollama, a new field ctx_num has been added to facilitate users in modifying the context length.


问题描述 我在使用ollama调用qwen2.5:7b,发现长文本的情况下,上下文token似乎只有2000-4000token。即使把最大对话数量设为“无限制”也不起作用。查阅ollama官方文档,发现可以通过传入ctx_num: 32000 这个options,把qwen2.5:7b的上下文长度加大。

解决思路 在ollama的模型配置中,新增ctx_num字段,方便用户修改。

ugaxm avatar Dec 12 '24 09:12 ugaxm

I've experienced the same issue.

I previously used open webui and LM Studio, then switched to Chatbox for a while because it's a fantastic cross-platform application @Bin-Huang .

However, I ran into trouble summarizing long conversations, and I didn't understand why at first. It turns out, open webui and LM Studio have a "Context Length" setting that allows you to expand the context window (though it increases RAM usage, it's worthwhile).

I found the API documentation for this at https://github.com/ollama/ollama/blob/main/docs/api.md.

For example, this command shows model context length:

curl http://localhost:11434/api/show -d '{
  "model": "deepseek-r1:70b-llama-distill-q8_0"
}'

"llama.context_length":13107

shows the context length.

I'm just not sure how to apply this setting within Chatbox.


我也遇到了同样的问题。

我之前用过 open webui 和 LM Studio,之后因为 Chatbox 是个很棒的跨平台应用,所以转用了一段时间。 但是,我遇到了总结长对话的麻烦,而且一开始不明白为什么。 后来我发现 open webui 和 LM Studio 有一个 “Context Length”(上下文长度)的设置,可以扩展上下文窗口(虽然会增加内存消耗,但很值得)。

我在这里找到了相关的 API 文档:https://github.com/ollama/ollama/blob/main/docs/api.md。 比如,这个命令:

curl http://localhost:11434/api/show -d '{
  "model": "deepseek-r1:70b-llama-distill-q8_0"
}'

"llama.context_length":13107

显示了模型的上下文长度。 我只是不确定如何在 Chatbox 中应用这个设置。

LeiHao0 avatar Jan 29 '25 10:01 LeiHao0

I've tested this on my M2 Ultra, and it handles long contexts well.

Image

The Community Edition seems to be behaving strangely, though. I've created a pull request https://github.com/Bin-Huang/chatbox/pull/1805 in the hopes of helping the community.

Image

LeiHao0 avatar Jan 29 '25 13:01 LeiHao0