-
Notifications
You must be signed in to change notification settings - Fork 24
map max_tokens to max_completion_tokens internally #144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe parameter key for LLM maximum completion tokens is renamed from "max_tokens" to "max_completion_tokens" consistently across the custom LLM handler, DeepEval manager, base LLM manager, and all corresponding test files. No logic or control flow changes are introduced. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/lightspeed_evaluation/core/llm/deepeval.py (1)
19-26: Fix DeepEvalLiteLLMModelparameter: usemax_tokensinstead ofmax_completion_tokens.DeepEval's LiteLLMModel constructor accepts
max_tokens, notmax_completion_tokens. The current parameter is silently ignored and won't configure the token limit as intended.Update line 23 to:
max_tokens=llm_params.get("max_completion_tokens"),Also, replace the
print()statement on line 28 with structured logging (required by coding guidelines forsrc/lightspeed_evaluation/**/*.pyfiles).
🧹 Nitpick comments (1)
src/lightspeed_evaluation/core/llm/custom.py (1)
119-128: Parameter name is correct; consider optional backward compatibility fallback.
LiteLLM'scompletionAPI supportsmax_completion_tokens, so the current implementation is valid. However, if callers may passmax_tokens(older convention), the suggested fallback pattern provides safer compatibility:💡 Optional backward compatibility improvement
- "max_completion_tokens": self.llm_params.get("max_completion_tokens"), + "max_completion_tokens": self.llm_params.get( + "max_completion_tokens", self.llm_params.get("max_tokens") + ),
VladimirKadlec
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Use max_completion_tokens instead of deprecated max_tokens
Type of change
Tools used to create PR
Identify any AI code assistants used in this PR (for transparency and review context)
Related Tickets & Documents
Checklist before requesting a review
Testing
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.