Repository navigation
Conversation
The OpenAI LLM factory now: 1. Passes base_url from config to CoreLLMConfig (fixes getzep#1116) 2. Auto-detects custom (non-OpenAI) endpoints and uses OpenAIGenericClient instead of OpenAIClient This is needed because OpenAIClient uses the /responses API for structured outputs, which is only supported by api.openai.com. OpenAI-compatible endpoints like Gemini, Ollama, and vLLM only support /chat/completions. OpenAIGenericClient uses /chat/completions with response_format, which works everywhere.
|
All contributors have signed the CLA ✍️ ✅ |
|
Update: Tested PR #1339 changes locally with Ollama — confirmed working. Applied the exact diff from this PR to
Environment:
|
|
@loading1031 Thank you so much for taking the time to test this! 🙏 Really appreciate you applying the diff locally and running a full end-to-end verification with Ollama — that's exactly the kind of real-world validation that gives confidence the fix works across different setups. Great to see it working smoothly with Hopefully this gets merged soon so everyone hitting #1116 can benefit. 🚀 |
|
I have read the CLA Document and I hereby sign the CLA |
|
recheck |
themavik
left a comment
There was a problem hiding this comment.
the auto-detect logic makes sense. two things: (1) the string check 'api.openai.com' not in custom_url would also match azure endpoints (openai.azure.com) — those don't support /responses either, so that's actually correct behavior. but explicit Azure handling exists in the factory already, so this might cause a double-match. (2) when HAS_OPENAI_GENERIC is False (import fails), custom endpoint users silently get the OpenAI /responses client which will 404. might want a warning log in that case.
themavik
left a comment
There was a problem hiding this comment.
If OpenAIGenericClient is not importable, custom URLs still fall through to OpenAIClient and hit /responses again. Worth a one-line log when the URL is non-OpenAI and the generic client is missing.
feafc422 Bump the uv group across 2 directories with 2 updates (#1363) c4e6923b Upstream Zep internal improvements (#1361) e88c09ca @VictorECDSA has signed the CLA in getzep/graphiti#1356 91fe7e0e @majiayu000 has signed the CLA in getzep/graphiti#1351 c52786d2 @dudo has signed the CLA in getzep/graphiti#1350 d631437d @Ker102 has signed the CLA in getzep/graphiti#1339 73cff2cb @chengjon has signed the CLA in getzep/graphiti#1340 8c617639 @rhlsthrm has signed the CLA in getzep/graphiti#1335 e6424bae @pratyush618 has signed the CLA in getzep/graphiti#1332 6f05647c @bsolomon1124 has signed the CLA in getzep/graphiti#1330 10d91394 @spencer2211 has signed the CLA in getzep/graphiti#1326 1ca14686 Add hiring promotion section to README (#1323) 19e44a97 Bump mcp-server to 1.0.2 and require graphiti-core>=0.28.2 (#1317) 77b16096 Bump graphiti-core version to 0.28.2 (#1315) 7d65d5e7 Harden search filters against Cypher injection (#1312) b10b4889 Restore README title and subtitle (#1314) a9065fa9 Refresh README content and fix image refs (#1313) 5a334ec5 @lvca has signed the CLA in getzep/graphiti#1310 45c8040e @jawherkh has signed the CLA in getzep/graphiti#1309 9eb2c9e8 @kraft87 has signed the CLA in getzep/graphiti#1305 334c8faa @adsharma has signed the CLA in getzep/graphiti#1296 b6f9d874 @StephenBadger has signed the CLA in getzep/graphiti#1295 4b91076a feat: Add GLiNER2 hybrid LLM client (#1284) db54ce09 chore: update Docker images to graphiti-core 0.28.1 (#1292) edc71e8e @devmao has signed the CLA in getzep/graphiti#1289 b4ddc55a @carlos-alm has signed the CLA in getzep/graphiti#1288 aa8e81e3 @giulio-leone has signed the CLA in getzep/graphiti#1280 6fdb352f @aelhajj has signed the CLA in getzep/graphiti#1281 2099603d @avianion has signed the CLA in getzep/graphiti#1278 9eb59f7f @themavik has signed the CLA in getzep/graphiti#1214 98f5b5ff fix: replace edge name with uuid in debug log (#1261) 510bd50d @hanxiao has signed the CLA in getzep/graphiti#1257 17a8ea9e @sprotasovitsky has signed the CLA in getzep/graphiti#1254 9d509a2a @Yifan-233-max has signed the CLA in getzep/graphiti#1245 ef52a2ad chore: regenerate lockfiles to drop diskcache (#1244) 76053036 chore: bump version to 0.28.1 (#1243) bde2f797 fix: replace diskcache with sqlite-based cache to resolve CVE (#1238) git-subtree-dir: graphiti git-subtree-split: feafc422c739f0da166241d4804a9830a294d366
|
hi any update on this please? |
Im wondering the same. Seems like it hasn't been reviewed yet. |
|
I just checked the official documentation and they’ve added the support already. I tried configuring with my local ollama and it worked ! I guess this ain’t needed anymore |
|
Thanks for this. The non-OpenAI endpoint routing landed on main: |
Problem
When configuring the MCP server's
openaiLLM provider with a customapi_urlpointing to a non-OpenAI endpoint (like Google Gemini's OpenAI-compatible API, Ollama, vLLM, etc.), the LLM client fails with HTTP 404 errors even after fixing thebase_urlpass-through (#1116).Root cause:
OpenAIClientuses the OpenAI Responses API (/responses) for structured outputs viaself.client.responses.parse(). This endpoint is OpenAI-specific — no other provider supports it. OpenAI-compatible endpoints only implement the standard/chat/completionsendpoint.What this PR does
This PR makes two changes to
LLMClientFactory.create():Passes
base_urlfrom config toCoreLLMConfig— This is the same fix as fix: pass base_url to OpenAI LLM client for custom endpoint support #1338, included here because the two changes work together.Auto-detects custom endpoints and uses
OpenAIGenericClient— Whenapi_urlis set to a non-OpenAI domain (doesn't containapi.openai.com), the factory returnsOpenAIGenericClientinstead ofOpenAIClient. The generic client uses/chat/completionswithresponse_formatfor structured outputs, which all OpenAI-compatible endpoints support.The detection is simple and conservative:
If
OpenAIGenericClientis not available in the installed version ofgraphiti-core, it falls back to the standardOpenAIClientbehavior (guarded by a try/except import).How I found this
While working through issue #1116, I fixed the missing
base_urland confirmed requests were correctly routed to Gemini. But I was still getting 404 errors. The container logs showed:After tracing through
openai_client.py, I found that_create_structured_completion(line 99) callsself.client.responses.parse()— the Responses API that Gemini doesn't implement. Meanwhile,OpenAIGenericClient._generate_responseusesself.client.chat.completions.create()withresponse_format, which Gemini supports fine.After applying both fixes:
Testing
Tested with the following configuration:
openaiwithapi_urlpointing tohttps://generativelanguage.googleapis.com/v1beta/openaigemini-2.5-flashopenaiwithgemini-embedding-001Full write/read cycle verified — episodes are stored and facts are retrievable from the knowledge graph.
Related
base_urlfix)