Skip to content

RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into context infrastructure.

Feature: Add the new anthropic and voyage models (#15516)

Wang Qid41373cfa909
diff --git a/conf/llm_factories.json b/conf/llm_factories.json
index 5a61d20064..e6bfe83db8 100644
--- a/conf/llm_factories.json
+++ b/conf/llm_factories.json
@@ -3939,6 +3939,27 @@
"rank": "990",
"url": "https://api.anthropic.com/",
"llm": [
+ {
+ "llm_name": "claude-opus-4-8",
+ "tags": "LLM,CHAT,IMAGE2TEXT,200k",
+ "max_tokens": 204800,
+ "model_type": "chat",
+ "is_tools": true
+ },
+ {
+ "llm_name": "claude-opus-4-7",
+ "tags": "LLM,CHAT,IMAGE2TEXT,200k",
+ "max_tokens": 204800,
+ "model_type": "chat",
+ "is_tools": true
+ },
+ {
+ "llm_name": "claude-opus-4-6",
+ "tags": "LLM,CHAT,IMAGE2TEXT,200k",
+ "max_tokens": 204800,
+ "model_type": "chat",
+ "is_tools": true
+ },
{
"llm_name": "claude-opus-4-5-20251101",
"tags": "LLM,CHAT,IMAGE2TEXT,200k",
@@ -3960,6 +3981,13 @@
"model_type": "chat",
"is_tools": true
},
+ {
+ "llm_name": "claude-sonnet-4-6",
+ "tags": "LLM,CHAT,IMAGE2TEXT,200k",
+ "max_tokens": 204800,
+ "model_type": "chat",
+ "is_tools": true
+ },
{
"llm_name": "claude-sonnet-4-5-20250929",
"tags": "LLM,CHAT,IMAGE2TEXT,200k",
@@ -4010,6 +4038,24 @@
"tags": "TEXT EMBEDDING, TEXT RE-RANK",
"status": "1",
"llm": [
+ {
+ "llm_name": "voyage-4-large",
+ "tags": "TEXT EMBEDDING,32000",
+ "max_tokens": 32000,
+ "model_type": "embedding"
+ },
+ {
+ "llm_name": "voyage-4",
+ "tags": "TEXT EMBEDDING,32000",
+ "max_tokens": 32000,
+ "model_type": "embedding"
+ },
+ {
+ "llm_name": "voyage-4-lite",
+ "tags": "TEXT EMBEDDING,32000",
+ "max_tokens": 32000,
+ "model_type": "embedding"
+ },
{
"llm_name": "voyage-3-large",
"tags": "TEXT EMBEDDING,32000",
@@ -4106,6 +4152,18 @@
"max_tokens": 4000,
"model_type": "rerank"
},
+ {
+ "llm_name": "rerank-2.5",
+ "tags": "RE-RANK, 32000",
+ "max_tokens": 32000,
+ "model_type": "rerank"
+ },
+ {
+ "llm_name": "rerank-2.5-lite",
+ "tags": "RE-RANK, 32000",
+ "max_tokens": 32000,
+ "model_type": "rerank"
+ },
{
"llm_name": "rerank-2",
"tags": "RE-RANK, 16000",
diff --git a/conf/models/anthropic.json b/conf/models/anthropic.json
index 93cd6b2797..d94ac4d882 100644
--- a/conf/models/anthropic.json
+++ b/conf/models/anthropic.json
@@ -9,6 +9,30 @@
},
"class": "anthropic",
"models": [
+ {
+ "name": "claude-opus-4-8",
+ "max_tokens": 128000,
+ "model_types": [
+ "chat",
+ "vision"
+ ]
+ },
+ {
+ "name": "claude-opus-4-7",
+ "max_tokens": 128000,
+ "model_types": [
+ "chat",
+ "vision"
+ ]
+ },
+ {
+ "name": "claude-opus-4-6",
+ "max_tokens": 128000,
+ "model_types": [
+ "chat",
+ "vision"
+ ]
+ },
{
"name": "claude-opus-4-5-20251101",
"max_tokens": 128000,
@@ -33,6 +57,14 @@
"vision"
]
},
+ {
+ "name": "claude-sonnet-4-6",
+ "max_tokens": 64000,
+ "model_types": [
+ "chat",
+ "vision"
+ ]
+ },
{
"name": "claude-sonnet-4-5-20250929",
"max_tokens": 64000,
diff --git a/conf/models/voyage.json b/conf/models/voyage.json
index 65c2272d93..8ad059cf0f 100644
--- a/conf/models/voyage.json
+++ b/conf/models/voyage.json
@@ -9,6 +9,27 @@
},
"class": "voyage",
"models": [
+ {
+ "name": "voyage-4-large",
+ "max_tokens": 32000,
+ "model_types": [
+ "embedding"
+ ]
+ },
+ {
+ "name": "voyage-4",
+ "max_tokens": 32000,
+ "model_types": [
+ "embedding"
+ ]
+ },
+ {
+ "name": "voyage-4-lite",
+ "max_tokens": 32000,
+ "model_types": [
+ "embedding"
+ ]
+ },
{
"name": "voyage-3.5",
"max_tokens": 327680,
@@ -51,6 +72,20 @@
"embedding"
]
},
+ {
+ "name": "rerank-2.5",
+ "max_tokens": 32000,
+ "model_types": [
+ "rerank"
+ ]
+ },
+ {
+ "name": "rerank-2.5-lite",
+ "max_tokens": 32000,
+ "model_types": [
+ "rerank"
+ ]
+ },
{
"name": "rerank-2",
"max_tokens": 4000,
diff --git a/rag/llm/chat_model.py b/rag/llm/chat_model.py
index 6571f11701..9e20514d30 100644
--- a/rag/llm/chat_model.py
+++ b/rag/llm/chat_model.py
@@ -127,6 +127,10 @@ def _apply_model_family_policies(
for key in ("temperature", "top_p", "logprobs", "top_logprobs"):
sanitized_gen_conf.pop(key, None)
sanitized_kwargs.pop(key, None)
+ elif provider == SupportedLiteLLMProvider.Anthropic and model_name_lower in {"claude-opus-4-7", "claude-opus-4-8"}:
+ for key in ("temperature", "top_p", "top_k"):
+ sanitized_gen_conf.pop(key, None)
+ sanitized_kwargs.pop(key, None)
if provider == SupportedLiteLLMProvider.HunYuan:
for key in ("presence_penalty", "frequency_penalty"):