Chainlit / chainlit

Build Conversational AI in minutes ⚡️
https://docs.chainlit.io
Apache License 2.0
6.24k stars 799 forks source link

It consumes a significant amount of computer resources. #45

Closed wupengfei0904 closed 1 year ago

wupengfei0904 commented 1 year ago

I start Chainlit, the CPU usage reaches 50%, and the memory gradually increases by 5GB. My computer is equipped with an i7 12700 processor and 32GB of RAM. When I close the program, approximately 6GB of memory is released.

willydouhard commented 1 year ago

This is unexpected. Are you running a default example or a heavy task like running a local LLM?

wupengfei0904 commented 1 year ago

I just reproduced it again. My environment is Win11 + Python 3.11. I used the example from the documentation, and after running it, both the CPU and RAM suddenly spiked. 微信截图_2023060916432
![微信截图_20230609164333](https://github.com/Chainlit/chainlit/assets/125854485/26da6642-72df-49a4-800a-cce810d88595)
1 微信截图_20230609164441 微信截图_20230609164502

willydouhard commented 1 year ago

Okay, could you try with the wheel provided in this PR? https://github.com/Chainlit/chainlit/pull/40 you can just pip install it and run chainlit hello to see if you see the same resource consumption.

wupengfei0904 commented 1 year ago

Hello, author. I have resolved the issue using version 0.3.0 of Chainlit. Both the CPU and RAM are stable now, and there are no spikes.

willydouhard commented 1 year ago

Amazing! this version is not yet merged (soon hopefully) and the docs are not updated to reflect the changes. So be careful with that while we update everything

SurachaiJaisan commented 1 year ago

+

SurachaiJaisan commented 1 year ago

O

SurachaiJaisan commented 1 year ago

Pjv

SurachaiJaisan commented 1 year ago

ptc

wupengfei0904 commented 1 year ago

Hello, author. May I ask when the official release of FastAPI version will be available? Additionally, have you considered supporting the ChatGPT standard plugins, such as ChatGPT UI, which allows for installing and selecting the desired plugins for use?

willydouhard commented 1 year ago

I hope to merge it early next week if everything is ok. We thought about the plugins, our first try was with the LangChain integration: https://github.com/Chainlit/cookbook/tree/main/langchain-aiplugins but not every plugin is compatible. Plus not all the plugins are public.

willydouhard commented 1 year ago

Should be fixed in the latest version 0.3.0. Please note that it contains breaking changes. We prepared a migration guide to make it easy for everyone.