Skip to content

feat(ratio-setting): add compatibility for gemma-4 model suffix handling#4063

Open
sxjeru wants to merge 1 commit intoQuantumNous:mainfrom
sxjeru:gemma
Open

feat(ratio-setting): add compatibility for gemma-4 model suffix handling#4063
sxjeru wants to merge 1 commit intoQuantumNous:mainfrom
sxjeru:gemma

Conversation

@sxjeru
Copy link
Copy Markdown

@sxjeru sxjeru commented Apr 3, 2026

根据 AIS 和相关文档,Gemma 4 已支持通过 thinkingLevel 控制思考开关。

即使 newapi 支持 gemma-4-26b-a4b-it-minimal

image

Summary by CodeRabbit

Release Notes

  • New Features
    • Added support for Gemma-4 model variants with configuration suffixes, enabling proper normalization and compatibility within the system.

Copilot AI review requested due to automatic review settings April 3, 2026 04:25
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 3, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b1a6d7fe-c755-447b-8748-70618199e786

📥 Commits

Reviewing files that changed from the base of the PR and between c9611c4 and e7f8d5d.

📒 Files selected for processing (1)
  • setting/ratio_setting/model_ratio.go

Walkthrough

The setting/ratio_setting/model_ratio.go file is enhanced to handle gemma-4 model name variants with reasoning effort suffixes. A new import for the reasoning package is added, and the FormatMatchingModelName function now trims effort-related suffixes from gemma-4 model names using the TrimEffortSuffix function.

Changes

Cohort / File(s) Summary
Gemma-4 Reasoning Suffix Handling
setting/ratio_setting/model_ratio.go
Added import of reasoning package and new conditional branch in FormatMatchingModelName to detect and trim effort/thinking suffixes (e.g., -minimal, -high) from gemma-4 prefixed model names, normalizing them to base model identifiers.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested reviewers

  • seefs001

Poem

🐰 With whiskers twitching, through suffixes we hop,
Gemma-4 efforts trimmed in a single swift chop,
No -minimal fuzz, no -high extra weight,
Just base model names, normalized and great! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding support for gemma-4 model variants with effort/thinking suffixes through suffix handling logic.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the model-name normalization logic used by ratio/price lookups to handle Gemma 4 “reasoning effort” suffixes (e.g., -minimal, -high) by trimming them to the base model name, improving compatibility with upstream model naming variants.

Changes:

  • Add setting/reasoning dependency to reuse the shared effort-suffix parsing logic.
  • Update FormatMatchingModelName to trim Gemma 4 effort suffixes (via reasoning.TrimEffortSuffix) so ratio matching uses the base model name.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants