Skip to content

investigate defaults for openai backend #141

Closed

Description

@jakelorocco

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.

Activity

  1. added
    bug
    good first issue
    on Sep 15, 2025
  2. jakelorocco commented on Sep 15, 2025

    @jakelorocco
    ContributorAuthor

    Marking as priority. This issue will impact anyone who tries to migrate from OpenAI sdk to ours.

  3. jakelorocco commented on Sep 15, 2025

    @jakelorocco
    ContributorAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions