mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-06-29 15:31:05 +08:00
feat: Add Astraflow provider support (global + China endpoints) (#14270)
## Add Astraflow Provider Support This PR integrates [Astraflow](https://astraflow.ucloud.cn/) (by UCloud / 优刻得) as a new AI model provider in RAGFlow, with support for both global and China endpoints. ### About Astraflow Astraflow is an OpenAI-compatible AI model aggregation platform supporting 200+ models from major providers including DeepSeek, Qwen, GPT, Claude, Gemini, Llama, Mistral, and more. | Variant | Factory Name | Endpoint | Env Var | |---------|-------------|----------|---------| | Global | `Astraflow` | `https://api-us-ca.umodelverse.ai/v1` | `ASTRAFLOW_API_KEY` | | China | `Astraflow-CN` | `https://api.modelverse.cn/v1` | `ASTRAFLOW_CN_API_KEY` | - **API key signup**: https://astraflow.ucloud.cn/ --- ### Files Changed | File | Change | |------|--------| | `rag/llm/__init__.py` | Register `Astraflow` and `Astraflow-CN` in `SupportedLiteLLMProvider` enum, `FACTORY_DEFAULT_BASE_URL`, and `LITELLM_PROVIDER_PREFIX` | | `rag/llm/chat_model.py` | Add `AstraflowChat` and `AstraflowCNChat` (OpenAI-compatible `Base` subclass) | | `rag/llm/embedding_model.py` | Add `AstraflowEmbed` and `AstraflowCNEmbed` (subclasses of `OpenAIEmbed`) | | `rag/llm/rerank_model.py` | Add `AstraflowRerank` and `AstraflowCNRerank` (subclasses of `OpenAI_APIRerank`) | | `rag/llm/cv_model.py` | Add `AstraflowCV` and `AstraflowCNCV` (subclasses of `GptV4`) | | `rag/llm/tts_model.py` | Add `AstraflowTTS` and `AstraflowCNTTS` (subclasses of `OpenAITTS`) | | `rag/llm/sequence2txt_model.py` | Add `AstraflowSeq2txt` and `AstraflowCNSeq2txt` (subclasses of `GPTSeq2txt`) | | `conf/llm_factories.json` | Register `Astraflow` and `Astraflow-CN` factories with a curated list of popular models | --- ### Supported Model Types - ✅ **Chat / LLM** — DeepSeek-V3/R1, Qwen3, GPT-4o/4.1, Claude 3.5/3.7, Gemini 2.0/2.5 Flash, Llama 3.3/4, Mistral, and 200+ more - ✅ **Text Embedding** — text-embedding-3-small/large - ✅ **Image / Vision (IMAGE2TEXT)** — GPT-4o, GPT-4.1, Claude, Gemini, Llama-4, etc. - ✅ **Text Re-Rank** - ✅ **TTS** — tts-1 - ✅ **Speech-to-Text (SPEECH2TEXT)** — whisper-1 ### Implementation Notes - Uses the `openai/` LiteLLM prefix — consistent with other OpenAI-compatible aggregation platforms (SILICONFLOW, DeerAPI, CometAPI, OpenRouter, n1n, Avian, etc.) - `Astraflow` (global, rank 250) and `Astraflow-CN` (China, rank 249) are separate factory entries, allowing users to choose the optimal endpoint based on their region. - All model classes cleanly subclass existing base classes (`Base`, `OpenAIEmbed`, `OpenAI_APIRerank`, `GptV4`, `OpenAITTS`, `GPTSeq2txt`) with no custom logic needed — the provider is fully OpenAI-compatible. --------- Co-authored-by: user <user@xzaaaMacBook-Air.local>
This commit is contained in:
@@ -18,6 +18,8 @@ A complete list of models supported by RAGFlow, which will continue to expand.
|
||||
| Provider | LLM | Image2Text | Speech2text | TTS | Embedding | Rerank | OCR |
|
||||
| --------------------- | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ | ------------------ |
|
||||
| Anthropic | :heavy_check_mark: | | | | | | |
|
||||
| Astraflow | :heavy_check_mark: | | | | :heavy_check_mark: | | |
|
||||
| Astraflow-CN | :heavy_check_mark: | | | | :heavy_check_mark: | | |
|
||||
| Avian | :heavy_check_mark: | | | | | | |
|
||||
| Azure-OpenAI | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | :heavy_check_mark: | | |
|
||||
| BaiChuan | :heavy_check_mark: | | | | :heavy_check_mark: | | |
|
||||
|
||||
Reference in New Issue
Block a user