-
Notifications
You must be signed in to change notification settings - Fork 228
docs: OpenAI-compatible multi-model gateway example (DaoXE) #561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -158,6 +158,35 @@ text = ( | |
| ) | ||
| asyncio.run(kg_builder.run_async(text=text)) | ||
| driver.close() | ||
|
|
||
| ### OpenAI-compatible multi-model gateways | ||
|
|
||
| `OpenAILLM` and `OpenAIEmbeddings` accept OpenAI Python client kwargs such as `base_url` and `api_key`. Point them at any OpenAI-compatible Chat Completions / embeddings host. Example with [DaoXE](https://daoxe.com) (`https://daoxe.com/v1`): | ||
|
|
||
| ```python | ||
| from neo4j_graphrag.embeddings import OpenAIEmbeddings | ||
| from neo4j_graphrag.llm import OpenAILLM | ||
|
|
||
| llm = OpenAILLM( | ||
| model_name="your-account-model-id", # exact ID from GET /v1/models or dashboard | ||
| api_key="your_daoxe_api_key", | ||
| base_url="https://daoxe.com/v1", | ||
| ) | ||
|
|
||
| embedder = OpenAIEmbeddings( | ||
| model="your-account-embedding-model-id", | ||
| api_key="your_daoxe_api_key", | ||
| base_url="https://daoxe.com/v1", | ||
| ) | ||
| ``` | ||
|
|
||
| Notes: | ||
|
|
||
| - Model IDs are account-scoped; do not hardcode a static public catalog. | ||
| - Chat Completions / embeddings paths only for this snippet. | ||
| - DaoXE is not available in mainland China. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a product-specific limitation note that has no place in generic library doc |
||
| - Contributor disclosure: this example was contributed by a DaoXE affiliate. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This reads as an advertisement. It's atypical for library documentation to include affiliate disclosures inline |
||
|
|
||
| ``` | ||
|
|
||
| > Warning: In order to run this code, the `openai` Python package needs to be installed: `pip install "neo4j_graphrag[openai]"` | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With your change, the README would promote a specific third-party service (DaoXE) with a direct URL. This is unusual for an open-source library README. A more neutral approach would use a generic placeholder like https://your-gateway.example.com/v1 and mention well-known alternatives (LiteLLM, vLLM, Ollama, Azure OpenAI, etc.) rather than one lesser-known commercial gateway.