Skip to content

Env var OLLAMA_BASE_URL is inconsistent with actual Ollama-held env var name #1940

Closed

Description

@sealad886

Graphfy uses OLLAMA_BASE_URL to configure a custom API target here:

"base_url": os.environ.get("OLLAMA_BASE_URL", "http://localhost:11434/v1"),

However, Ollama defines the OLLAMA_HOST env var and doesn't actually have a OLLAMA_BASE_URL concept at all:

Ollama Documentation How Do I Configure Ollama Server


Expected behavior:
Graphify should re-use the Ollama env vars so that custom configuration is automatically picked up.

Activity

  1. SinghAman21 commented on Jul 16, 2026

    @SinghAman21
    Contributor

    OLLAMA_HOST is the real variable and graphify doesn't read it.

    I'd suggest adding it as a fallback rather than renaming: OLLAMA_BASE_URL still wins if set (it matches our other *_BASE_URL vars, and renaming would break existing users), and we fall back to OLLAMA_HOST when it's unset.

    Two gotchas for to pick this up:

    1. It's not a drop-in. OLLAMA_HOST is a bare host:port (0.0.0.0:11434), but we need a full OpenAI-compat URL — our default is http://localhost:11434/v1. So it needs a scheme added and /v1 appended.
    2. 0.0.0.0 is a bind address, not a destination. That's the value the docs tell people to set, and connecting to http://0.0.0.0:11434 is flaky outside Linux. Should map to 127.0.0.1.

    Also worth deciding: should a bare OLLAMA_HOST auto-select the ollama backend the way OLLAMA_BASE_URL does today? It's a lot more likely to just be lying around in someone's env, so I'd keep it config-only for now and leave detection alone.

    Small related thing: README says the default is http://localhost:11434, but the code says http://localhost:11434/v1. Worth fixing too.

    Happy to PR this if the fallback approach sounds good.

    @safishamsi

  2. added 3 commits that reference this issue on Aug 13, 2026
    75108a7
    6eb9252
    3b07550
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions