Skip to content
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 可以添加,检查通过,但是chat 中报错 #2187

Closed
miracletiger opened this issue Apr 25, 2024 · 12 comments
Closed

[Bug] ollama 可以添加,检查通过,但是chat 中报错 #2187

miracletiger opened this issue Apr 25, 2024 · 12 comments
Labels
🤔 Need Reproduce Further information is requested | 需要更多信息复现

Comments

@miracletiger
Copy link

💻 Operating System

Ubuntu

📦 Environment

Official Preview

🌐 Browser

Chrome

🐛 Bug Description

可以添加ollama 模型,检查通过 选择ollama模型 chat 后报错, 使用的最新版本LobeChat v0.149.2 , ollama version is 0.1.32
{
"error": {
"message": "fetch failed",
"name": "TypeError"
},
"provider": "ollama"
}

🚦 Expected Behavior

No response

📷 Recurrence Steps

No response

📝 Additional Information

No response

@miracletiger miracletiger added the 🐛 Bug Something isn't working | 缺陷 label Apr 25, 2024
@lobehubbot
Copy link
Member

👀 @miracletiger

Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible.
Please make sure you have given us as much context as possible.
非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

@miracletiger
Copy link
Author

我使用了lobe 相同ip的ollama 可以访问了,其他服务器的ollama 访问会报错让检查扩域什么的,
sudo bash -c 'cat <<'EOF' > /etc/systemd/system/ollama.service
[Unit]
Description=Ollama Service
After=network-online.target

[Service]
ExecStart=/usr/bin/ollama serve
User=ollama
Group=ollama
Restart=always
RestartSec=3
Environment="OLLAMA_HOST=0.0.0.0"
Environment="OLLAMA_MODELS=/data/model/ollama_cache"
Environment="OLLAMA_ORIGINS=*"
[Install]
WantedBy=default.target
EOF'
我的ollama 其他服务器上配置是这样的, telnet 可以联通 其他ip 11434 但是 lobe无法访问,只能访问lobe 所在ip的11434

@arvinxx
Copy link
Contributor

arvinxx commented Apr 25, 2024

@miracletiger 没太看明白,能讲清楚一些吗?

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@miracletiger I don’t quite understand, can you explain it more clearly?

@heavenwing
Copy link

我的也报错。一开始检查报错,配置了OLLAMA_ORIGINS后正常。但是聊天出错。报奇怪的 https:///api/chat/ollama 401错误。
我是lobechat以容器的方式跑在Azure App Service里面(启用了用户验证),ollama跑到本地的localhost。
版本为:v0.148.9

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


Mine also reported an error. I checked the error at the beginning and it was normal after configuring OLLAMA_ORIGINS. But an error occurred in the chat. A strange https:///api/chat/ollama 401 error was reported.
I have lobechat running in Azure App Service as a container (user authentication is enabled), and ollama running on the local localhost.
The version is: v0.148.9

@heavenwing
Copy link

刚刚升级到了:v0.149.2,其支持了浏览器请求模式后,我的问题解决了。

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


I just upgraded to: v0.149.2, which supports browser request mode, and my problem is solved.

@arvinxx arvinxx added 🤔 Need Reproduce Further information is requested | 需要更多信息复现 and removed 🐛 Bug Something isn't working | 缺陷 labels Apr 25, 2024
@zivenyang
Copy link

是ollama跨域的问题,参考https://lobehub.com/zh/docs/self-hosting/examples/ollama#%E9%9D%9E%E6%9C%AC%E5%9C%B0%E8%AE%BF%E9%97%AE-ollama
添加
OLLAMA_HOST=0.0.0.0
OLLAMA_ORIGINS=*
然后lobechat中ollama的url改成ipv4地址即可

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


It is a cross-domain problem with ollama. Please refer to https://lobehub.com/zh/docs/self-hosting/examples/ollama#%E9%9D%9E%E6%9C%AC%E5%9C%B0%E8%AE %BF%E9%97%AE-ollama
Add to
OLLAMA_HOST=0.0.0.0
OLLAMA_ORIGINS=*
Then change the url of ollama in lobechat to the ipv4 address

@lobehubbot
Copy link
Member

👋 @{{ author }}


Since the issue was labeled with 🤔 Need Reproduce, but no response in 3 days. This issue will be closed. If you have any questions, you can comment and reply.
由于该 issue 被标记为需要更多信息,却 3 天未收到回应。现关闭 issue,若有任何问题,可评论回复。

@lobehubbot lobehubbot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 29, 2024
@lobehubbot
Copy link
Member

@miracletiger

This issue is closed, If you have any questions, you can comment and reply.
此问题已经关闭。如果您有任何问题,可以留言并回复。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤔 Need Reproduce Further information is requested | 需要更多信息复现
Projects
Status: Done
Development

No branches or pull requests

5 participants