Skip to content

Feature: Add the new anthropic and voyage models - #15516

Merged
wangq8 merged 1 commit into
infiniflow:mainfrom
wangq8:feature/idriss/add_claude_voyage_models
Jun 2, 2026
Merged

wangq8 merged 1 commit into
infiniflow:mainfrom
wangq8:feature/idriss/add_claude_voyage_models

Conversation

@wangq8

@wangq8 wangq8 commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

add the newanthropic and voyage models. Strip opus 4.7 and 4.8 of certain usnspported keys

@coderabbitai

coderabbitai Bot commented Jun 2, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR updates LLM model catalogs for Anthropic and Voyage AI providers. New Anthropic Claude Opus 4 variants and Sonnet 4.6 are defined in the model registry and registered in the provider factory. Voyage AI embedding and reranking model catalogs are similarly updated. Runtime handling adds parameter sanitization for the new Anthropic opus models.

Changes

Anthropic and Voyage AI Model Catalog Updates

Layer / File(s) Summary
Anthropic model catalog and factory registration
conf/models/anthropic.json, conf/llm_factories.json
Added Claude Opus 4 variants (claude-opus-4-{8,7,6}) with max_tokens: 128000 supporting chat and vision, and Claude Sonnet 4.6 with max_tokens: 64000. Registered all new Anthropic models in the provider factory.
Voyage AI model catalog and factory registration
conf/models/voyage.json, conf/llm_factories.json
Added Voyage embedding models (voyage-4-large, voyage-4, voyage-4-lite) and reranking models (rerank-2.5, rerank-2.5-lite) with appropriate max_tokens and model_types. Registered all new Voyage models in the provider factory.
Anthropic LiteLLM parameter sanitization
rag/llm/chat_model.py
Added LiteLLM model-family policy to strip temperature, top_p, and top_k parameters for Claude Opus 4.7 and 4.8 when routing through Anthropic provider.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~4 minutes

Poem

🐰 Whiskers twitching with delight,
New Claude models shining bright,
Voyage charts set sail with glee,
Parameters tuned perfectly! ✨

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is incomplete and does not follow the required template structure with 'What problem does this PR solve?' and 'Type of change' sections. Complete the description by filling out all required template sections: explain the problem being solved, select the type of change (New Feature), and provide any additional context needed for reviewers.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: adding new Anthropic and Voyage models to the configuration.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@wangq8
wangq8 requested a review from 6ba3i June 2, 2026 09:14
@wangq8 wangq8 added the ci Continue Integration label Jun 2, 2026
@wangq8
wangq8 marked this pull request as ready for review June 2, 2026 09:15
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jun 2, 2026
@wangq8 wangq8 changed the title add the new anthropic and voyage models Feature: Add the new anthropic and voyage models Jun 2, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@rag/llm/chat_model.py`:
- Around line 130-133: Add a log statement inside the branch handling
SupportedLiteLLMProvider.Anthropic for model_name_lower in {"claude-opus-4-7",
"claude-opus-4-8"} to record that temperature/top_p/top_k are being stripped;
specifically, emit a debug/info log from the module logger (or existing logger
used in this file) that includes the model name (model_name_lower) and which
keys were removed from sanitized_gen_conf and sanitized_kwargs (temperature,
top_p, top_k) so the flow is traceable; place the log immediately before or
after the loop that pops those keys (references:
SupportedLiteLLMProvider.Anthropic, model_name_lower, sanitized_gen_conf,
sanitized_kwargs).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 02f4eb50-aa76-44e2-bf78-70c286469f2f

📥 Commits

Reviewing files that changed from the base of the PR and between a98889c and dd82a98.

📒 Files selected for processing (4)
  • conf/llm_factories.json
  • conf/models/anthropic.json
  • conf/models/voyage.json
  • rag/llm/chat_model.py

Comment thread rag/llm/chat_model.py
Comment on lines +130 to +133
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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Add logging for the new parameter-stripping flow.

Per coding guidelines, new flows should include logging. Consider adding a log statement to track when parameters are being stripped for these specific models.

📝 Proposed logging addition
 elif provider == SupportedLiteLLMProvider.Anthropic and model_name_lower in {"claude-opus-4-7", "claude-opus-4-8"}:
+    logging.info(f"Stripping unsupported parameters (temperature, top_p, top_k) for Anthropic model: {model_name}")
     for key in ("temperature", "top_p", "top_k"):
         sanitized_gen_conf.pop(key, None)
         sanitized_kwargs.pop(key, None)

As per coding guidelines: "Add logging for new flows" for Python files.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@rag/llm/chat_model.py` around lines 130 - 133, Add a log statement inside the
branch handling SupportedLiteLLMProvider.Anthropic for model_name_lower in
{"claude-opus-4-7", "claude-opus-4-8"} to record that temperature/top_p/top_k
are being stripped; specifically, emit a debug/info log from the module logger
(or existing logger used in this file) that includes the model name
(model_name_lower) and which keys were removed from sanitized_gen_conf and
sanitized_kwargs (temperature, top_p, top_k) so the flow is traceable; place the
log immediately before or after the loop that pops those keys (references:
SupportedLiteLLMProvider.Anthropic, model_name_lower, sanitized_gen_conf,
sanitized_kwargs).

@wangq8
wangq8 merged commit d41373c into infiniflow:main Jun 2, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants