RAGFlow chat को एक OpenAI-API-Compatible base URL पर चलाएं।
Updated 2026-07-29
RAGFlow बिल्कुल इसी के लिए एक OpenAI-API-Compatible provider ship करता है: हर model को उसकी id के साथ add करें, base url के तौर पर https://api.apisrouter.com/v1, और एक key। Claude, GPT, DeepSeek, GLM, Kimi, और Qwen ids फिर एक single endpoint से आपके datasets, chats, और agents serve करती हैं।
Quick answer: Model providers page पर model add करें।
RAGFlow में login करें, ऊपर दाईं ओर अपना logo क्लिक करें, और Model providers खोलें। Models to be added के तहत, OpenAI-API-Compatible card ढूंढें और Add the model क्लिक करें। Add LLM dialog में, Model type को chat set करें, exact catalog id को Model name के तौर पर enter करें, Base url में https://api.apisrouter.com/v1 डालें, अपनी key को API-Key में paste करें, और Max tokens को model की असली context size पर set करें। OK क्लिक करें। फिर इसे कुछ करने दें: same page पर Set default models खोलें और अपना नया model default LLM के तौर पर चुनें। Chat assistants, dataset question answering, और agent nodes सब उस default पर resolve होते हैं जब तक override न करें। पहली run से पहले जानने लायक एक sharp edge: RAGFlow का Max tokens field default 512 पर है और इसका अपना tooltip warn करता है कि एक invalid value errors cause करती है, तो model की documented window enter करना optimization नहीं, setup का हिस्सा है।
Model type: chat
Model name: deepseek-v4-pro
Base url: https://api.apisrouter.com/v1
API-Key: sk-YOUR-APISROUTER-KEY
Max tokens: 128000
then: Set default models → LLM → deepseek-v4-proRAGFlow models को काम से कैसे bind करता है।
RAGFlow (GitHub पर infiniflow, लगभग 85K stars) एक deep-document RAG engine है: PDFs और tables की layout-aware parsing, grounded citations वाली chunking, datasets, chat assistants, और उनके ऊपर agent workflows। उस pipeline के अलग-अलग हिस्से अलग-अलग model slots से bind होते हैं, और binding explicit है। Chat models answers generate करते हैं। Embedding models retrieval के लिए chunks को vectorize करते हैं। Rerank models candidates को reorder करते हैं, और parsing के दौरान img2txt models figures describe करते हैं। OpenAI-API-Compatible provider इन types के लिए individually models register कर सकता है, हर Add LLM dialog type, id, base url, और key का एक binding बनाता है। हर registered chat model base url से Model name को wire string के तौर पर लिए हुए standard chat completions बोलता है, तो gateway जो भी id serve करता है वह valid है, vendor की परवाह किए बिना। वह separation operationally matter करती है: अपने answer model को gpt-5.5 से claude-sonnet-4-6 पर switch करना किसी भी दिन safe है, लेकिन embedding model आपके indexed vectors से welded है। RAGFlow इसे एक compatibility check से enforce करता है जब आप किसी ऐसे dataset पर embedding models switch करते हैं जिसमें पहले से chunks हैं, और practical rule सीधा है: embedding setup एक बार pick करें, और chat models को उस layer की तरह treat करें जिसे आप freely tune करते हैं।
Chinese और Western models के लिए एक key साथ में।
RAGFlow deployments bilingual की तरफ skew करते हैं: Chinese-origin teams mixed-language document bases process करती हैं, और international teams खासतौर पर Chinese documents के लिए Chinese models चाहती हैं। Directly serve किए जाने पर, यह mix painful है, क्योंकि DeepSeek, Zhipu, Moonshot, और Alibaba हर एक अलग bill करते हैं और कुछ को विदेश से pay करना अजीब है, जबकि Anthropic और OpenAI दूसरी direction से अजीब हैं। एक OpenAI-API-Compatible base url के through, mix बस ज़्यादा Add LLM dialogs है: Chinese-heavy corpora के लिए deepseek-v4-pro और glm-5.2, strong regional alternates के तौर पर qwen3.7-max और kimi-k2.6, जहां answer polish सबसे ज़्यादा matter करे वहां claude-sonnet-4-6। Same base url, same key, catalog से सीधे ids। Asia की teams के लिए same route उल्टा भी काम करता है: Claude और GPT ids एक prepaid balance पर बिना Western card के reachable बन जाती हैं, जो कई RAGFlow shops के लिए एक model evaluate करने और सिर्फ उसके बारे में पढ़ने के बीच का फर्क है। एक boot-time path भी जानने लायक है: service_conf.yaml.template एक user_default_llm block (factory, api_key, base_url) accept करता है ताकि fresh installs pre-wired आएं। RAGFlow के docs explicit हैं कि login के बाद, configuration सिर्फ Model providers page पर होता है, तो YAML को live config की बजाय first-boot provisioning मानें।
user_default_llm:
factory: OpenAI-API-Compatible
api_key: sk-YOUR-APISROUTER-KEY
base_url: https://api.apisrouter.com/v1Document pipeline के लिए models चुनना।
Retrieval quality ceiling set करती है और answer model तय करता है कि आप उसके कितने करीब पहुंचते हैं, तो अपने असली corpus पर answer models A/B करें: same dataset, same questions, दो ids पर pinned दो assistants, और APIsRouter console में per-model spend answers पर अपने judgment के साथ।
- Retrieved chunks पर grounded answering input-heavy work है जहां mid-tier models चमकते हैं: deepseek-v4-pro और glm-5.2 bilingual corpora पर citation-following answers को अच्छे से carry करते हैं।
- qwen3.7-max और kimi-k2.6 regional heavyweights हैं जो test करने लायक हैं जब answers natively Chinese में पढ़ने चाहिए; Chinese models में quality differences retrieval से ज़्यादा generation में दिखते हैं।
- claude-sonnet-4-6 answer slot का हक कमाता है जहां synthesis quality product है, executive summaries, contract analysis, कुछ भी जो एक इंसान बिना edit किए आगे भेजे।
- Tools call करने वाले agent workflows को भरोसेमंद function calling चाहिए; agent path पहले claude-sonnet-4-6 पर test करें, फिर देखें आपके flows पर कौन-सी regional id इससे match करती है।
- Max tokens per-registration है, तो अगर एक assistant को लंबे answers चाहिए और दूसरे को tight, same id को अलग limits के साथ दो बार register करें।
जितना उपयोग उतना भुगतान · आधिकारिक मूल्य से कम
Selected models are priced below official list prices. Exact input, output, cache, and per-request prices are shown for each model.
| मॉडल | आधिकारिक मूल्य | हमारा मूल्य |
|---|---|---|
| DeepSeek V4 Pro | $0.43 / $0.87 per M | $0.40 / $0.90 per M |
| GLM-5.2 | $1.14 / $4.00 per M | $1.10 / $4.00 per M |
| Qwen 3.7 Max | $2.50 / $7.50 per M | $2.50 / $7.50 per M |
| Kimi K2.6 | $0.95 / $4.00 per M | $1.00 / $4.00 per M |
| Claude Sonnet 4.6 | $3.00 / $15.00 per M | $2.40 / $12.00 per M |
RAGFlow के लिए specific failure modes।
Max tokens default classic है। 512 पर छोड़ा गया, लंबे answers ऐसे तरीकों से truncate या error होते हैं जो model problems जैसे दिखते हैं; register करते समय documented context size set करें, जैसा tooltip खुद warn करता है। एक registered model जो तुरंत error देता है आमतौर पर Model name की spelling है (यह /v1/models listing से exactly match होनी चाहिए) या एक Base url जिसमें /v1 suffix missing है, क्योंकि RAGFlow आपके enter किए में route paths append करता है। Registration के बाद कुछ न होना defaults problem है: एक model register करना उसे select नहीं करता। Set default models check करें, और per-assistant model settings check करें, जो workspace default को override करती हैं। Embedding confusion list पूरी करता है। अगर आप compatible provider के through एक embedding id bind करते हैं, index करने से पहले confirm करें कि endpoint actually इसे serve करता है; और एक बार dataset में chunks हो जाने पर, इसका embedding model बदलना एक similarity check से gated है और zero से re-indexing की ज़रूरत पड़ सकती है। Chat model changes पर कोई ऐसी cost नहीं है, यही exactly वजह है कि chat layer वह जगह है जहां experiment करना चाहिए।
कौन RAGFlow को एक gateway के through route करता है।
- Bilingual document teams जो एक base url और एक key के पीछे DeepSeek, GLM, Qwen, और Kimi को Claude और GPT ids के साथ mix करती हैं।
- Asia की teams जो बिना Western card के prepaid balance पर Claude-quality answers चाहती हैं, और Western teams जो बिना regional billing के Chinese models चाहती हैं।
- Self-hosters जो internal knowledge bases के लिए RAGFlow चलाती हैं और पूरे deployment का cloud spend एक usage log पर चाहती हैं।
- Builders जो एक fixed corpus पर answer models compare करते हैं, जहां हर candidate एक vendor account नहीं बल्कि एक Add LLM dialog है।
- Ops teams जो service_conf.yaml.template से fresh installs को endpoint pre-wired के साथ provision करती हैं।
Endpoint verify करें और पहली chat को debug करें।
पहले models listing curl करें; Model name field free text है, और listing से ids copy करना सबसे common failure को होने से पहले ही eliminate कर देता है। फिर register करने की योजना वाले id के against एक chat completion चलाएं। RAGFlow के अंदर, model register करें, इसे default LLM set करें, और datasets involve करने से पहले एक plain chat assistant में test करें। Authentication errors API-Key की तरफ इशारा करते हैं; not-found Model name की तरफ; connection errors Base url या container egress की तरफ, क्योंकि endpoint तक आपके browser को नहीं बल्कि RAGFlow server को पहुंचना है। Truncated या fail होने वाले लंबे answers वापस Max tokens की तरफ इशारा करते हैं। जब chats चलने लगें, APIsRouter console per-request model, token counts, और spend दिखाता है। RAG traffic input-dominated है, और usage log वह जगह है जहां आप देखते हैं कि आपका corpus actually per model, per day query करने में कितना खर्च करता है, Chinese और Western ids के लिए एक ही page।
curl -s https://api.apisrouter.com/v1/models \
-H "Authorization: Bearer $APISROUTER_API_KEY" | head -50
curl -s https://api.apisrouter.com/v1/chat/completions \
-H "Authorization: Bearer $APISROUTER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"deepseek-v4-pro",
"messages":[{"role":"user","content":"ping"}]}'अक्सर पूछे जाने वाले प्रश्न
मैं RAGFlow में OpenAI-API-Compatible model कैसे add करूं?
अपने avatar पर क्लिक करें, Model providers खोलें, Models to be added के तहत OpenAI-API-Compatible ढूंढें, और Add the model क्लिक करें। Model type (chat), Model name (exact catalog id), Base url https://api.apisrouter.com/v1, API-Key, और एक real Max tokens value भरें, फिर OK से confirm करें।
Model add करने के बाद मेरे answers truncate या error क्यों होते हैं?
लगभग हमेशा Max tokens: RAGFlow इसे default 512 पर set करता है और इसका tooltip warn करता है कि incorrect values errors cause करती हैं। Model registration edit करें और model की documented context size enter करें।
क्या RAGFlow एक provider के through Chinese और Western models mix कर सकता है?
हां। हर registration अपनी Model name string same base url को भेजती है, तो deepseek-v4-pro, glm-5.2, qwen3.7-max, kimi-k2.6, और claude-sonnet-4-6 सब side by side register और per assistant select हो सकते हैं, एक key से billed।
क्या chat और embedding models अलग-अलग bind होते हैं?
हां। हर Add LLM dialog एक type के एक model को register करता है, और Set default models default LLM और embedding slots independently assign करता है। Chat models freely swap हो सकते हैं; embedding models indexed vectors से tied हैं और एक बार dataset में chunks होने पर एक compatibility check से gated हैं।
क्या मैं पहली boot से पहले endpoint pre-configure कर सकता हूं?
हां, docker/service_conf.yaml.template में user_default_llm block के through: factory OpenAI-API-Compatible, आपकी api_key, और base_url। RAGFlow इसे पहली startup पर पढ़ता है; login के बाद, configuration सिर्फ Model providers page पर move करता है।
मेरा registered model इस्तेमाल क्यों नहीं होता?
Registration और selection अलग steps हैं। Set default models के तहत model को default LLM set करें, और per-assistant model settings check करें, जो default को override करती हैं। अगर फिर भी fail हो, Model name को /v1/models listing की spelling से compare करें।