lobehub / lobe-chat

🤯 Lobe Chat - an open-source, modern-design AI chat framework. Supports Multi AI Providers( OpenAI / Claude 3 / Gemini / Ollama / Azure / DeepSeek), Knowledge Base (file upload / knowledge management / RAG ), Multi-Modals (Vision/TTS) and plugin system. One-click FREE deployment of your private ChatGPT/ Claude application.
https://chat-preview.lobehub.com
Other
40.88k stars 9.32k forks source link

[Bug] 在流输出过程中,页面会变得异常卡顿,特别是在多模型得情况下 出现明显掉帖 且输出界面卡顿 #4037

Closed Caoxiongk closed 2 hours ago

Caoxiongk commented 3 hours ago

📦 部署环境

Docker

📌 软件版本

0.1.0

💻 系统环境

Windows

🌐 浏览器

Chrome

🐛 问题描述

流输出过程中,页面会变得异常卡顿,特别是在多模型得情况下 出现明显掉帖 且输出界面卡顿 因为项目是基于以前老版本二开 请问如何解决这个问题呢

📷 复现步骤

流输出过程中,页面会变得异常卡顿,特别是在多模型得情况下 出现明显掉帖 且输出界面卡顿 因为项目是基于以前老版本二开 请问如何解决这个问题呢

🚦 期望结果

不卡顿

📝 补充信息

No response

lobehubbot commented 3 hours ago

👀 @Caoxiongk

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。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

lobehubbot commented 3 hours ago

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


📦 Deployment environment

Docker

📌 Software version

0.1.0

💻 System environment

Windows

🌐 Browser

Chrome

🐛 Problem description

During the stream output process, the page will become abnormally stuck, especially in the case of multiple models. Posts will be dropped obviously and the output interface will be stuck. Because the project is based on the previous old version, how can I solve this problem?

📷 Steps to reproduce

During the stream output process, the page will become abnormally stuck, especially in the case of multiple models. Posts will be dropped obviously and the output interface will be stuck. Because the project is based on the previous old version, how can I solve this problem?

🚦 Expected results

No lag

📝 Supplementary information

No response

Caoxiongk commented 3 hours ago

Uploading 飞书20240920-103828.mp4…

lobehubbot commented 3 hours ago

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


Uploading Feishu20240920-103828.mp4…

dosubot[bot] commented 3 hours ago

@Caoxiongk Hello! I'm here to assist you with any bugs, questions, and contributions. Let's squash those bugs together! 🤖

要解决在流输出过程中页面异常卡顿的问题,特别是在多模型的情况下,使用Docker部署环境,软件版本0.1.0,系统环境Windows,浏览器Chrome,可以尝试以下方法:

  1. 优化Docker配置:确保Docker容器有足够的资源(CPU和内存)分配,以处理多模型的并发请求。可以通过调整Docker运行命令中的资源限制来实现。

    docker run -d -p 3210:3210 \
      -e OPENAI_API_KEY=sk-xxxx \
      -e ACCESS_CODE=lobe66 \
      --name lobe-chat \
      --cpus="2" --memory="4g" \
      lobehub/lobe-chat
  2. 使用代理:如果网络请求速度较慢,可以配置OpenAI的代理地址来加速请求。

    docker run -d -p 3210:3210 \
      -e OPENAI_API_KEY=sk-xxxx \
      -e OPENAI_PROXY_URL=https://api-proxy.com/v1 \
      -e ACCESS_CODE=lobe66 \
      --name lobe-chat \
      lobehub/lobe-chat
  3. 优化前端性能:确保前端代码在处理流输出时进行了适当的优化,例如使用Web Workers来处理复杂计算,避免阻塞主线程。

  4. 使用本地数据库:如果数据同步是瓶颈,可以考虑使用本地数据库来减少网络延迟。

    LobeChat 支持同时使用服务端数据库和本地数据库。根据您的需求,您可以选择合适的部署方案:
    - 本地数据库:适合希望对数据有更多掌控感和隐私保护的用户。LobeChat 采用了 CRDT (Conflict-Free Replicated Data Type) 技术,实现了多端同步功能。

通过以上方法,可以有效缓解在流输出过程中页面异常卡顿的问题[1].

To continue talking to Dosu, mention @dosu.

dosubot[bot] commented 3 hours ago

要解决在流输出过程中页面异常卡顿的问题,特别是在多模型的情况下,使用Docker部署环境,软件版本0.1.0,系统环境Windows,浏览器Chrome,可以尝试以下方法:

  1. 优化Docker配置:确保Docker容器有足够的资源(CPU和内存)分配,以处理多模型的并发请求。可以通过调整Docker运行命令中的资源限制来实现。

    docker run -d -p 3210:3210 \
      -e OPENAI_API_KEY=sk-xxxx \
      -e ACCESS_CODE=lobe66 \
      --name lobe-chat \
      --cpus="2" --memory="4g" \
      lobehub/lobe-chat
  2. 使用代理:如果网络请求速度较慢,可以配置OpenAI的代理地址来加速请求。

    docker run -d -p 3210:3210 \
      -e OPENAI_API_KEY=sk-xxxx \
      -e OPENAI_PROXY_URL=https://api-proxy.com/v1 \
      -e ACCESS_CODE=lobe66 \
      --name lobe-chat \
      lobehub/lobe-chat
  3. 优化前端性能:确保前端代码在处理流输出时进行了适当的优化,例如使用Web Workers来处理复杂计算,避免阻塞主线程。

  4. 使用本地数据库:如果数据同步是瓶颈,可以考虑使用本地数据库来减少网络延迟。

    LobeChat 支持同时使用服务端数据库和本地数据库。根据您的需求,您可以选择合适的部署方案:
    - 本地数据库:适合希望对数据有更多掌控感和隐私保护的用户。LobeChat 采用了 CRDT (Conflict-Free Replicated Data Type) 技术,实现了多端同步功能。

通过以上方法,可以有效缓解在流输出过程中页面异常卡顿的问题[1].

To continue talking to Dosu, mention @dosu.

Caoxiongk commented 3 hours ago

https://github.com/user-attachments/assets/6a87c381-b1bc-4853-a4e8-5b1c0f651c9f

https://zanbang.obs.cn-south-1.myhuaweicloud.com/brainyai/2024-09-20/852bac4570874e65a819af326b0ee1cc/飞书20240920103828.mp4

lobehubbot commented 3 hours ago

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


https://github.com/user-attachments/assets/6a87c381-b1bc-4853-a4e8-5b1c0f651c9f

https://zanbang.obs.cn-south-1.myhuaweicloud.com/brainyai/2024-09-20/852bac4570874e65a819af326b0ee1cc/Feishu20240920103828.mp4

arvinxx commented 2 hours ago

二开问题不在免费答疑范围内,自行想办法解决吧。

lobehubbot commented 2 hours ago

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


The second question is not within the scope of Q&A for free. Please find a solution on your own.

lobehubbot commented 2 hours ago

✅ @Caoxiongk

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

lobehubbot commented 2 hours ago

✅ @Caoxiongk

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