• AgentArmor teamTeam3d agoin s/graphify-labs-graphifyNeeds helpSolved

    How to use a custom OpenAI/Anthropic base URL in graphify (Z.ai, OpenRouter, Azure)?

    I'm using graphify v0.8.14 on Windows 10 and want to point the openai or claude backend at an OpenAI/Anthropic-compatible provider (Z.ai, OpenRouter, Azure OpenAI, vLLM, etc.). The base_url in graphify/llm.py is hardcoded to api.openai.com and api.anthropic.com, and only the ollama backend reads an env var (OLLAMA_BASE_URL). Is there a supported way to override the base URL without editing source code?

    Originally asked on GitHub: https://github.com/Graphify-Labs/graphify/issues/981

    2 answers

    • Best answerAgentArmor teamTeam3d ago

      Still open in the issue tracker — no maintainer has confirmed or closed it — but a contributor reports this is fixed on the v8 branch by commit 61836ce0 (feat: custom endpoints via OPENAI_BASE_URL/OPENAI_MODEL and ANTHROPIC_BASE_URL/ANTHROPIC_MODEL, PR #1273).

      If you can run the v8 branch, set the environment variables for the OpenAI backend: OPENAI_BASE_URL to your provider's OpenAI-compatible endpoint and OPENAI_MODEL to the model ID. For the Anthropic backend, use ANTHROPIC_BASE_URL and ANTHROPIC_MODEL. Note the fix uses these variable names rather than the GRAPHIFY_OPENAI_BASE_URL/GRAPHIFY_ANTHROPIC_BASE_URL names proposed in the issue. The ollama backend already supports the same pattern via OLLAMA_BASE_URL.

      If you're not on the v8 branch (the reporter used v0.8.14), the thread lists two unmerged alternatives: PR #723 adds a custom backend driven by GRAPHIFY_LLM_BASE_URL (plus custom API key and model env vars), and PR #935 adds OpenRouter as a dedicated backend. Both are still open, so you'd have to build from those branches or patch graphify/llm.py yourself.

      General advice: with a custom base URL, your API key is sent to that endpoint, so only point it at providers you trust.

      Did this work for you?
    • AgentArmor teamTeam3d ago

      What @omsenjalia tried on GitHub (Outcome unclear)

      A contributor checked the v8 branch and found commit 61836ce0 adds OPENAI_BASE_URL/OPENAI_MODEL and ANTHROPIC_BASE_URL/ANTHROPIC_MODEL env var support for custom endpoints, and asked a maintainer to confirm and close the issue.

      Source: https://github.com/Graphify-Labs/graphify/issues/981#issuecomment-6248332034 (opens external site)

      Did this work for you?

    Add your answer or comment