Skip to content

[BUG]添加自定义Ollama大模型时报错。 #10

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

Closed
beijingtl opened this issue Mar 23, 2024 · 4 comments
Closed

[BUG]添加自定义Ollama大模型时报错。 #10

beijingtl opened this issue Mar 23, 2024 · 4 comments
Assignees

Comments

@beijingtl
Copy link

beijingtl commented Mar 23, 2024

联系方式

517699029@qq.com

MaxKB 版本

版本号:v0.9.0 (build at 2024-03-21T18:39, commit: 96a0e4b)

问题描述

我按照 使用手册 的方法添加自定义的Ollama ,在保存时报错,提示:校验失败,请检查 api_key secret_key 是否正确。

重现步骤

点击【添加模型】,选择供应商【 Ollama 】,直接进入下一步填写 Ollama 供应商的大模型表单。

  • 模型名称: qwen:1.8b。
  • 模型类型: 大语言模型。
  • 基础模型: qwen:1.8b。
  • API 域名:http://172.16.10.10:11434
  • API Key: 由于没有设置,我随便填写的值。

点击【添加】后 校验不通过。

期待的正确结果

添加大模型到列表中。但是报错。

相关日志输出

No response

附加信息

经过测试,自定义域名是可正常访问。具体如下:

(base) root@ai-server:/var/lib/docker# curl http://172.16.10.10:11434/api/chat -d '{
  "model": "qwen:1.8b",
  "messages": [
    { "role": "user", "content": "1+1=?" }
  ]
}'
{"model":"qwen:1.8b","created_at":"2024-03-23T15:42:52.022455615Z","message":{"role":"assistant","content":"1"},"done":false}
{"model":"qwen:1.8b","created_at":"2024-03-23T15:42:52.05084234Z","message":{"role":"assistant","content":" +"},"done":false}
{"model":"qwen:1.8b","created_at":"2024-03-23T15:42:52.07471859Z","message":{"role":"assistant","content":" "},"done":false}
{"model":"qwen:1.8b","created_at":"2024-03-23T15:42:52.098813239Z","message":{"role":"assistant","content":"1"},"done":false}
{"model":"qwen:1.8b","created_at":"2024-03-23T15:42:52.122560097Z","message":{"role":"assistant","content":" ="},"done":false}
{"model":"qwen:1.8b","created_at":"2024-03-23T15:42:52.146415467Z","message":{"role":"assistant","content":" "},"done":false}
{"model":"qwen:1.8b","created_at":"2024-03-23T15:42:52.173886424Z","message":{"role":"assistant","content":"2"},"done":false}
{"model":"qwen:1.8b","created_at":"2024-03-23T15:42:52.226332598Z","message":{"role":"assistant","content":"\n"},"done":false}
{"model":"qwen:1.8b","created_at":"2024-03-23T15:42:52.250628975Z","message":{"role":"assistant","content":""},"done":true,"total_duration":331796019,"load_duration":124841,"prompt_eval_count":9,"prompt_eval_duration":103090000,"eval_count":10,"eval_duration":228125000}
@beijingtl
Copy link
Author

beijingtl commented Mar 24, 2024

http://172.16.10.10:11434/v1

增加v1后可以通过校验了。谢谢。

@beijingtl
Copy link
Author

感谢!

@wanghe-fit2cloud
Copy link
Member

#6

honestAnt pushed a commit to honestAnt/MaxKB that referenced this issue Apr 2, 2025
…elop)

Merge Request: feat:调整模型缓存配置

Created By: @王凤宝
Accepted By: @王凤宝
URL: https://megarobo-biolauto.coding.net/p/github/d/maxkb/git/merge/10?initial=true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@beijingtl @wanghe-fit2cloud @baixin513 and others