diff --git a/conf/llm_factories.json b/conf/llm_factories.json index 14715cb48..daa00baf5 100644 --- a/conf/llm_factories.json +++ b/conf/llm_factories.json @@ -160,7 +160,6 @@ "max_tokens": 131072, "model_type": "chat", "is_tools": true - }, { "llm_name": "grok-3-fast", @@ -168,7 +167,6 @@ "max_tokens": 131072, "model_type": "chat", "is_tools": true - }, { "llm_name": "grok-3-mini", @@ -176,7 +174,6 @@ "max_tokens": 131072, "model_type": "chat", "is_tools": true - }, { "llm_name": "grok-3-mini-mini-fast", @@ -184,7 +181,6 @@ "max_tokens": 131072, "model_type": "chat", "is_tools": true - }, { "llm_name": "grok-2-vision", @@ -192,7 +188,6 @@ "max_tokens": 32768, "model_type": "image2text", "is_tools": true - } ] }, @@ -851,7 +846,7 @@ { "name": "BAAI", "logo": "", - "tags": "TEXT EMBEDDING", + "tags": "TEXT EMBEDDING", "status": "1", "llm": [ { @@ -4130,6 +4125,175 @@ "model_type": "embedding" } ] + }, + { + "name": "302.AI", + "logo": "", + "tags": "LLM,TEXT EMBEDDING,TEXT RE-RANK,IMAGE2TEXT", + "status": "1", + "llm": [ + { + "llm_name": "deepseek-chat", + "tags": "LLM,CHAT", + "max_tokens": 32000, + "model_type": "chat", + "is_tools": true + }, + { + "llm_name": "gpt-4o", + "tags": "LLM,CHAT,128k", + "max_tokens": 128000, + "model_type": "chat", + "is_tools": true + }, + { + "llm_name": "chatgpt-4o-latest", + "tags": "LLM,CHAT,128k", + "max_tokens": 128000, + "model_type": "chat", + "is_tools": true + }, + { + "llm_name": "llama3.3-70b", + "tags": "LLM,CHAT,128k", + "max_tokens": 128000, + "model_type": "chat", + "is_tools": true + }, + { + "llm_name": "deepseek-reasoner", + "tags": "LLM,CHAT,64k", + "max_tokens": 64000, + "model_type": "chat", + "is_tools": true + }, + { + "llm_name": "gemini-2.0-flash", + "tags": "LLM,CHAT", + "max_tokens": 1000000, + "model_type": "image2text", + "is_tools": true + }, + { + "llm_name": "claude-3-7-sonnet-20250219", + "tags": "LLM,CHAT", + "max_tokens": 200000, + "model_type": "chat", + "is_tools": true + }, + { + "llm_name": "claude-3-7-sonnet-latest", + "tags": "LLM,CHAT", + "max_tokens": 200000, + "model_type": "chat", + "is_tools": true + }, + { + "llm_name": "grok-3-beta", + "tags": "LLM,CHAT", + "max_tokens": 131072, + "model_type": "chat", + "is_tools": true + }, + { + "llm_name": "grok-3-mini-beta", + "tags": "LLM,CHAT", + "max_tokens": 131072, + "model_type": "chat", + "is_tools": true + }, + { + "llm_name": "gpt-4.1", + "tags": "LLM,CHAT", + "max_tokens": 1000000, + "model_type": "chat", + "is_tools": true + }, + { + "llm_name": "o3", + "tags": "LLM,CHAT", + "max_tokens": 200000, + "model_type": "chat", + "is_tools": true + }, + { + "llm_name": "o4-mini", + "tags": "LLM,CHAT", + "max_tokens": 200000, + "model_type": "chat", + "is_tools": true + }, + { + "llm_name": "qwen3-235b-a22b", + "tags": "LLM,CHAT,128k", + "max_tokens": 128000, + "model_type": "chat", + "is_tools": false + }, + { + "llm_name": "qwen3-32b", + "tags": "LLM,CHAT,128k", + "max_tokens": 128000, + "model_type": "chat", + "is_tools": false + }, + { + "llm_name": "gemini-2.5-pro-preview-05-06", + "tags": "LLM,CHAT", + "max_tokens": 1000000, + "model_type": "chat", + "is_tools": true + }, + { + "llm_name": "llama-4-maverick", + "tags": "LLM,CHAT,128k", + "max_tokens": 128000, + "model_type": "chat", + "is_tools": true + }, + { + "llm_name": "gemini-2.5-flash", + "tags": "LLM,CHAT", + "max_tokens": 1000000, + "model_type": "chat", + "is_tools": true + }, + { + "llm_name": "claude-sonnet-4-20250514", + "tags": "LLM,CHAT", + "max_tokens": 200000, + "model_type": "chat", + "is_tools": true + }, + { + "llm_name": "claude-opus-4-20250514", + "tags": "LLM,CHAT", + "max_tokens": 200000, + "model_type": "image2text", + "is_tools": true + }, + { + "llm_name": "gemini-2.5-pro", + "tags": "LLM,CHAT", + "max_tokens": 1000000, + "model_type": "image2text", + "is_tools": true + }, + { + "llm_name": "jina-clip-v2", + "tags": "TEXT EMBEDDING,TEXT RE-RANK", + "max_tokens": 8192, + "model_type": "embedding", + "is_tools": false + }, + { + "llm_name": "jina-reranker-m0", + "tags": "TEXT EMBEDDING,TEXT RE-RANK", + "max_tokens": 10240, + "model_type": "rerank", + "is_tools": false + } + ] } ] } diff --git a/docs/references/supported_models.mdx b/docs/references/supported_models.mdx index 472e5fbe4..f106ef850 100644 --- a/docs/references/supported_models.mdx +++ b/docs/references/supported_models.mdx @@ -4,6 +4,7 @@ slug: /supported_models --- # Supported models + import APITable from '@site/src/components/APITable'; A complete list of models supported by RAGFlow, which will continue to expand. @@ -63,6 +64,7 @@ A complete list of models supported by RAGFlow, which will continue to expand. | ZHIPU-AI | :heavy_check_mark: | :heavy_check_mark: | | :heavy_check_mark: | | | | 01.AI | :heavy_check_mark: | | | | | | | DeepInfra | :heavy_check_mark: | :heavy_check_mark: | | | :heavy_check_mark: | :heavy_check_mark: | +| 302.AI | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | | | ```mdx-code-block @@ -70,7 +72,7 @@ A complete list of models supported by RAGFlow, which will continue to expand. :::danger IMPORTANT If your model is not listed here but has APIs compatible with those of OpenAI, click **OpenAI-API-Compatible** on the **Model providers** page to configure your model. -::: +::: :::note The list of supported models is extracted from [this source](https://github.com/infiniflow/ragflow/blob/main/rag/llm/__init__.py) and may not be the most current. For the latest supported model list, please refer to the Python file. diff --git a/rag/llm/chat_model.py b/rag/llm/chat_model.py index 9ecd7a1f2..4f37cf482 100644 --- a/rag/llm/chat_model.py +++ b/rag/llm/chat_model.py @@ -1724,8 +1724,6 @@ class GPUStackChat(Base): raise ValueError("Local llm url cannot be None") base_url = urljoin(base_url, "v1") super().__init__(key, model_name, base_url, **kwargs) - - class DeepInfraChat(Base): _FACTORY_NAME = "DeepInfra" @@ -1733,3 +1731,12 @@ class DeepInfraChat(Base): if not base_url: base_url = "https://api.deepinfra.com/v1/openai" super().__init__(key, model_name, base_url, **kwargs) + + +class Ai302Chat(Base): + _FACTORY_NAME = "302.AI" + + def __init__(self, key, model_name, base_url="https://api.302.ai/v1", **kwargs): + if not base_url: + base_url = "https://api.302.ai/v1" + super().__init__(key, model_name, base_url, **kwargs) diff --git a/rag/llm/embedding_model.py b/rag/llm/embedding_model.py index 93b5982be..2a270e82c 100644 --- a/rag/llm/embedding_model.py +++ b/rag/llm/embedding_model.py @@ -930,8 +930,7 @@ class GiteeEmbed(SILICONFLOWEmbed): if not base_url: base_url = "https://ai.gitee.com/v1/embeddings" super().__init__(key, model_name, base_url) - - + class DeepInfraEmbed(OpenAIEmbed): _FACTORY_NAME = "DeepInfra" @@ -939,3 +938,12 @@ class DeepInfraEmbed(OpenAIEmbed): if not base_url: base_url = "https://api.deepinfra.com/v1/openai" super().__init__(key, model_name, base_url) + + +class Ai302Embed(Base): + _FACTORY_NAME = "302.AI" + + def __init__(self, key, model_name, base_url="https://api.302.ai/v1/embeddings"): + if not base_url: + base_url = "https://api.302.ai/v1/embeddings" + super().__init__(key, model_name, base_url) diff --git a/rag/llm/rerank_model.py b/rag/llm/rerank_model.py index 7f2181bdf..a1fa466d8 100644 --- a/rag/llm/rerank_model.py +++ b/rag/llm/rerank_model.py @@ -617,3 +617,12 @@ class GiteeRerank(JinaRerank): if not base_url: base_url = "https://ai.gitee.com/v1/rerank" super().__init__(key, model_name, base_url) + + +class Ai302Rerank(Base): + _FACTORY_NAME = "302.AI" + + def __init__(self, key, model_name, base_url="https://api.302.ai/v1/rerank"): + if not base_url: + base_url = "https://api.302.ai/v1/rerank" + super().__init__(key, model_name, base_url) diff --git a/rag/llm/sequence2txt_model.py b/rag/llm/sequence2txt_model.py index 1300144ad..3a26b8835 100644 --- a/rag/llm/sequence2txt_model.py +++ b/rag/llm/sequence2txt_model.py @@ -208,7 +208,6 @@ class GiteeSeq2txt(Base): self.client = OpenAI(api_key=key, base_url=base_url) self.model_name = model_name - class DeepInfraSeq2txt(Base): _FACTORY_NAME = "DeepInfra" diff --git a/rag/llm/tts_model.py b/rag/llm/tts_model.py index 32e7064b3..2e944d6e9 100644 --- a/rag/llm/tts_model.py +++ b/rag/llm/tts_model.py @@ -383,7 +383,6 @@ class SILICONFLOWTTS(Base): if chunk: yield chunk - class DeepInfraTTS(OpenAITTS): _FACTORY_NAME = "DeepInfra" diff --git a/web/src/assets/svg/llm/ai302.svg b/web/src/assets/svg/llm/ai302.svg new file mode 100644 index 000000000..80a864ee9 --- /dev/null +++ b/web/src/assets/svg/llm/ai302.svg @@ -0,0 +1 @@ +302.AI \ No newline at end of file diff --git a/web/src/constants/llm.ts b/web/src/constants/llm.ts index 60e2aeb77..63469b969 100644 --- a/web/src/constants/llm.ts +++ b/web/src/constants/llm.ts @@ -50,6 +50,7 @@ export enum LLMFactory { GPUStack = 'GPUStack', VLLM = 'VLLM', GiteeAI = 'GiteeAI', + Ai302 = '302.AI', DeepInfra = 'DeepInfra', } @@ -106,5 +107,6 @@ export const IconMap = { [LLMFactory.GPUStack]: 'gpustack', [LLMFactory.VLLM]: 'vllm', [LLMFactory.GiteeAI]: 'gitee-ai', + [LLMFactory.Ai302]: 'ai302', [LLMFactory.DeepInfra]: 'deepinfra', }; diff --git a/web/src/utils/common-util.ts b/web/src/utils/common-util.ts index ededa4121..60e5d4c7d 100644 --- a/web/src/utils/common-util.ts +++ b/web/src/utils/common-util.ts @@ -43,6 +43,7 @@ const orderFactoryList = [ LLMFactory.ZhipuAI, LLMFactory.Ollama, LLMFactory.Xinference, + LLMFactory.Ai302, ]; export const sortLLmFactoryListBySpecifiedOrder = (list: IFactory[]) => {