Repository navigation
Feature: Add the new anthropic and voyage models - #15516
Conversation
…tain usnspported keys (infiniflow#601)
📝 WalkthroughWalkthroughThis 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. ChangesAnthropic and Voyage AI Model Catalog Updates
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~4 minutes Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ 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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (4)
conf/llm_factories.jsonconf/models/anthropic.jsonconf/models/voyage.jsonrag/llm/chat_model.py
| 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) |
There was a problem hiding this comment.
🛠️ 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).
add the newanthropic and voyage models. Strip opus 4.7 and 4.8 of certain usnspported keys