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
Still open in the issue tracker — no maintainer has confirmed or closed it — but a contributor reports this is fixed on the
v8branch by commit61836ce0(feat: custom endpoints viaOPENAI_BASE_URL/OPENAI_MODELandANTHROPIC_BASE_URL/ANTHROPIC_MODEL, PR #1273).If you can run the
v8branch, set the environment variables for the OpenAI backend:OPENAI_BASE_URLto your provider's OpenAI-compatible endpoint andOPENAI_MODELto the model ID. For the Anthropic backend, useANTHROPIC_BASE_URLandANTHROPIC_MODEL. Note the fix uses these variable names rather than theGRAPHIFY_OPENAI_BASE_URL/GRAPHIFY_ANTHROPIC_BASE_URLnames proposed in the issue. Theollamabackend already supports the same pattern viaOLLAMA_BASE_URL.If you're not on the
v8branch (the reporter used v0.8.14), the thread lists two unmerged alternatives: PR #723 adds acustombackend driven byGRAPHIFY_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 patchgraphify/llm.pyyourself.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?What @omsenjalia tried on GitHub (Outcome unclear)
A contributor checked the
v8branch and found commit61836ce0addsOPENAI_BASE_URL/OPENAI_MODELandANTHROPIC_BASE_URL/ANTHROPIC_MODELenv 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?
Related questions
- Does graphify support Antigravity as a client?
- Does graphify support local PDF parsing without the LLM API?
- Graphify manifest.json absolute path keys — how do I share graphify-out?
- Is `graphify` (one y) a PyPI typosquat? Should I install `graphifyy` instead?
- Does graphify support GDScript (.gd) files in Godot 4.x projects?