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

memory 50mb per deployed bot #36

Open
seshubonam opened this issue Sep 12, 2023 · 6 comments
Open

memory 50mb per deployed bot #36

seshubonam opened this issue Sep 12, 2023 · 6 comments

Comments

@seshubonam
Copy link

Hi, i tried to use this bot for langchain through flowise.

each bot deployed uses approx 50mb RAM.

The way we deployed is to have seperate bots for each user. like there are multiple agents you can create in flowise.. so each user is able to create a new bot for a new agent they add in flowise.

however, this is not at all scalable as 100bots would consume 5gb ram.

is there a way to lower the memory if we are just using !lc command for flowise.

or would a serverless deploy option be ideal in this use case

alternative:
we could.i.plement one bot for flowise and the user selects the agent with !agent command.. but that would have to be done for everyroom everytime the user is accessing flowise related bots i guess.

what do you suggest. thanks

@hibobmaster
Copy link
Owner

hibobmaster commented Sep 12, 2023

I may add a sqlite db to manage users/rooms in matrix, so one instance is enough.

scope privileges
user/room can use command

And langchain command can bind a specific api endpoint or inherit from global configuration.

Besides, add an !agent command to allow user choose langchain models.

@seshubonam
Copy link
Author

yay looking forward. thanks

@hibobmaster
Copy link
Owner

I am refactoring the code and need some time.

@hibobmaster
Copy link
Owner

hibobmaster commented Sep 17, 2023

I will add some commands for langchain admin.
https://github.com/hibobmaster/matrix_chatgpt_bot/wiki/Langchain-(flowise)

"""
username: user_id or room_id
- user_id: @xxxxx:xxxxx.xxxxx
- room_id: !xxxxx:xxxxx.xxxxx

agent_name: the name of the agent
api_url: api_endpoint
api_key: api_key (Optional)
permission: integer (can: 1, cannot: 0)

{1} update api_url
{2} update api_key
{3} update permission
{4} update agent name

# add langchain endpoint
!lcadmin add {username} {agent_name} {api_url} {api_key *Optional} {permission}

# update api_url
!lcadmin update {1} {username} {agent} {api_url}
# update api_key
!lcadmin update {2} {username} {agent} {api_key}
# update permission
!lcadmin update {3} {username} {agent} {permission}
# update agent name
!lcadmin update {4} {username} {agent} {api_url}

# delete agent
!lcadmin delete {username} {agent}

# delete all agent
!lcadmin delete {username}

# list agent
!lcadmin list {username}

# list all agents
!lcadmin list
"""

@hibobmaster
Copy link
Owner

https://github.com/hibobmaster/matrix_chatgpt_bot/releases/tag/v1.3.0

@seshubonam
Copy link
Author

yup thanks. commands are useful and thanks for refactor
. exploring it.

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

2 participants