RAGFlow 1.0: adding an OpenAI-compatible gateway as an "OpenAI-API-Compatible" provider instance (custom model IDs, context length, tool calling, defaults) #21801
apigoto
started this conversation in
Show and tell
Replies: 1 comment 1 reply
|
Thanks for sharing this detailed guide with the RAGFlow community! We appreciate your contribution! |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I work on the APIGOTO team. APIGOTO is an independent OpenAI-compatible gateway, not affiliated with OpenAI, Anthropic, Google or InfiniFlow. Below is a step-by-step for the provider-instance UI in the 1.0 line (current
docs/guides/models/llm_api_key_setup.md). It works for any OpenAI-compatible endpoint, local or hosted.0. Check what the endpoint actually serves
curl https://api.china-aiapi.com/v1/models -H "Authorization: Bearer $API_KEY"Note the exact IDs of the chat model you want (
MODEL_ID). If the endpoint has one, also note the embedding model (EMBEDDING_MODEL_ID). RAGFlow needs a default LLM and a default embedding model.1. Create the instance
gateway-prod. Instances let you keep a test and a production gateway, or a gateway and a local server, side by side.https://api.china-aiapi.com/v1. The docs warn that with a compatible API you must check whether the path needs/v1. For this kind of endpoint it does.2. Add models
If the model isn't in the discovered list, use Add custom model:
MODEL_IDas returned by/models. The docs say a mismatch means RAGFlow "may not be able to identify the model correctly during calls".EMBEDDING_MODEL_ID, if you use one from the gateway).3. Verify, then set defaults
4. Embeddings: decide before you parse
The embedding model determines the vectors stored for each dataset. If your gateway doesn't serve embeddings, keep a local embedding model as default and use the gateway only for the LLM. Switching the embedding model after documents are parsed generally means re-parsing them, so choose first.
Troubleshooting
/v1missing or doubled.localhostinside the container isn't your host. Use a host-reachable address. A hosted gateway URL is unaffected.On the gateway side: one base URL for several model families, automatic failover on upstream errors (at most 3 retries per request on another route), a per-request log, pay-as-you-go, BYOK: www.china-aiapi.com
Has anyone run separate instances for chat and for agent workloads? I'm curious how you split defaults.
All reactions