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
In our openai backend, we set defaults if values are None:
if base_url is None:
self._base_url = "http://localhost:11434/v1" # ollama
else:
self._base_url = base_url
if api_key is None:
self._api_key = "ollama"
else:
self._api_key = api_key
This is counterintuitive because the openai sdk will grab environment variables as the default if they are not set. For example:
if api_key is None:
api_key = os.environ.get("OPENAI_API_KEY")
...
if base_url is None:
base_url = os.environ.get("OPENAI_BASE_URL")
if base_url is None:
base_url = f"https://api.openai.com/v1"
I think we should either remove our defaults (and maybe provide an error message explaining how to use ollama if something goes wrong) or explicitly look for those env variables before setting our own defaults. Even in that case, our defaults would differ from the openai defaults which would probably cause some friction.
Another default issue, if let the default be ollama, the backend doesn't select the correct model_id from the model_id.MODEL object. It will still select the huggingface id instead of ollama id which is the correct one.
Activity
jakelorocco commentedon Sep 15, 2025
Marking as priority. This issue will impact anyone who tries to migrate from OpenAI sdk to ours.
jakelorocco commentedon Sep 15, 2025
Another default issue, if let the default be
ollama, the backend doesn't select the correct model_id from the model_id.MODEL object. It will still select the huggingface id instead of ollama id which is the correct one.