OpenWebUI based chatbot assistant
I'm currently experimenting with setting up a chatbot assistant on a webpage, I got something working with OpenWebUI but i'm not convinced my approach is the right one, so I wanted to see how you have/would approach it.
At the moment the way it's setup is:
- OpenWebUI contains a custom model (based on 5.6 luna), with a knowledge base, a system prompt and some native python tools to do API calls to the backend. Access to OpenWebUI is done using an API key.
- A nodejs backend proxy the calls to openwebui, holding privately the openwebui api key, and adding to the metadata variables some information like the remote endpoint for the API calls and passing the user JWT token to be used by the python tools for the API calls.
- The frontend uses assistant-ui connected to the nodejs backend
All of this works reasonably well but
- it's quite slow (probably need to check my tool calls, and kb use)
- token streaming doesn't work, I get the entire response in one go with no thought or tool calls info (maybe not a deal breaker but because it's slow it feels like the wait is long). (codex is telling me that's because openwebui provide this over socket.io but socket.io auth only works with JWT not api token?)
- The user JWT passing to openwebui for tool call isn't ideal
So I wanted to check what you thought of this approach? The benefits is that it's relatively easy to setup, I can use openwebui to manage most things and I don't have to reinvent the wheel. AFAIK the other approach is to manually code the kb + tools in a dedicated backend; I would probably get more flexibility and performance but with significantly more overhead.
Any advice? How have you approached it?
Thanks!