refactor: centralize model parameters into JSON config (model_specs)#2176
Open
Haixing-Hu wants to merge 4 commits intolbjlaq:mainfrom
Open
refactor: centralize model parameters into JSON config (model_specs)#2176Haixing-Hu wants to merge 4 commits intolbjlaq:mainfrom
Haixing-Hu wants to merge 4 commits intolbjlaq:mainfrom
Conversation
Replace hardcoded model-specific parameters (maxOutputTokens, thinkingBudget caps, overhead values, model aliases) with a centralized JSON config file (resources/model_specs.json) and a Rust registry module (proxy/model_specs.rs). New files: - resources/model_specs.json: all model parameters in one place - src/proxy/model_specs.rs: config loading, lookup (with prefix matching), and convenience functions (cap_max_output_tokens, cap_thinking_budget, etc.) Refactored files: - common_utils.rs: model alias resolution via model_specs::resolve_alias() - gemini/wrapper.rs: default thinking budget, budget capping, maxOutputTokens cap, adaptive max tokens, thinking overhead — all from config - openai/request.rs: default budget, budget caps, overhead values from config - claude/request.rs: default budget, budget caps, opus fixed values, maxOutputTokens safe limit, overhead values — all from config Benefits: - Adding new models or adjusting limits requires only editing model_specs.json - No more scattered magic numbers (24576, 65536, 131072, 16000, etc.) - Consistent behavior across all three protocol mappers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
refactor: centralize model parameters into JSON config (model_specs)