The if-logic above is incorrect, because self._validate_user_and_key() would not be execute while the first expression not deactivate_security is not True.
I fix the problem via assign initial value to self.user:
def proxy(self):
+ self.user = "unknown"
if not deactivate_security and not self._validate_user_and_key():
BTW, althought I didn't change any setting of my client open-webui, open-webui changed to chat mode instead of stream mode after I launched ollama_proxy_server.
config.ini
commend
Error Log
My Research
https://github.com/ParisNeo/ollama_proxy_server/blob/c6aee7e67139d6ad04ff164f286335377dd9fbdc/ollama_proxy_server/main.py#L108
The if-logic above is incorrect, because
self._validate_user_and_key()
would not be execute while the first expressionnot deactivate_security
is notTrue
.I fix the problem via assign initial value to
self.user
: