You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I'm working on deploying chatbot-ui on kubernetes. I want to inject the connection settings (endpoint, deployment-name, api-key) via env vars set in the pod from kubernetes secrets, but encountered an issue (bug or at least unintuitive behaviour) here. I want to implement a fix for that but need some input first:
Theserver-chat-helpers.ts correctly picks up the settings and i can chat right away. But the model selector uses the /api/keys endpoint to get the available models. This code does not pick up the env vars set in the pod because it is build as static document during build time (see image).
One solution could be to prevent the optimization during build time (if possible) but I'm also thinking about why there are two different functions to read these settings from env vars in the first place? Is there a valid reason for this? I couldn't find another usage of /api/keys in the code and both are executed on server side.
So if there is no good reason, I would try to refactor this so that both functionalities (/api/keys endpoint and getServerProfile() in server-chat-helpers.ts) use the same underlying code to read the model configs from env vars.
With this my issue would be fixed and the code would be a bit cleaner. Any thoughts on that? Anything that I missed and should know before I start working on this?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm working on deploying chatbot-ui on kubernetes. I want to inject the connection settings (endpoint, deployment-name, api-key) via env vars set in the pod from kubernetes secrets, but encountered an issue (bug or at least unintuitive behaviour) here. I want to implement a fix for that but need some input first:
The
server-chat-helpers.ts
correctly picks up the settings and i can chat right away. But the model selector uses the/api/keys
endpoint to get the available models. This code does not pick up the env vars set in the pod because it is build as static document during build time (see image).One solution could be to prevent the optimization during build time (if possible) but I'm also thinking about why there are two different functions to read these settings from env vars in the first place? Is there a valid reason for this? I couldn't find another usage of
/api/keys
in the code and both are executed on server side.So if there is no good reason, I would try to refactor this so that both functionalities (
/api/keys
endpoint andgetServerProfile()
inserver-chat-helpers.ts
) use the same underlying code to read the model configs from env vars.With this my issue would be fixed and the code would be a bit cleaner. Any thoughts on that? Anything that I missed and should know before I start working on this?
Beta Was this translation helpful? Give feedback.
All reactions