refactor: regex-based auto-resolution for tool call and reasoning parsers#2290
Draft
mikasenghaas wants to merge 10 commits intorefactor/before-validator-propagationfrom
Draft
refactor: regex-based auto-resolution for tool call and reasoning parsers#2290mikasenghaas wants to merge 10 commits intorefactor/before-validator-propagationfrom
mikasenghaas wants to merge 10 commits intorefactor/before-validator-propagationfrom
Conversation
3343a6d to
18a0089
Compare
…sers Replace the hardcoded MODEL_TOOL_CALL_PARSER dict in server.py with regex patterns in a new utils/parsers.py module. This means new model variants are matched automatically without needing a new dict entry for every checkpoint. Also adds reasoning_parser auto-resolution (previously only tool_call_parser was auto-detected) and moves all resolution logic into InferenceConfig.to_vllm() so it's testable without a running server. Parser mapping fixes: INTELLECT-3 and Qwen3-Coder now correctly resolve to qwen3_coder instead of hermes. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
"auto" triggers auto-resolution, None disables it — explicit opt-out. Also adds reasoning_parser = "auto" default (previously None). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move auto-resolution from to_vllm() into a ModelConfig model_validator so it runs eagerly when the config is constructed. This means logs appear during `uv run rl ...` config validation, not only when the inference server process starts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The model validator can fire multiple times during config construction (default ModelConfig + final ModelConfig). Move logging to the RL entrypoint where it runs exactly once after the logger is initialized. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…dator" This reverts commit 03ef4eb.
tyro constructs ModelConfig multiple times during arg parser setup, causing validator logs to fire more than once. Remove logging from the validator — resolved values are visible in the dumped subconfigs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…isagg_inference/inference.toml Restore the two lines removed in the regex-parser refactor commit — they're semantically equivalent to the auto-resolved values, but keeping them explicit avoids churn in a config file users may reference. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
18a0089 to
4cf0884
Compare
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.
Summary
MODEL_TOOL_CALL_PARSERdict (~100 entries) inserver.pywith regex patterns inutils/parsers.py— new model variants are matched automatically without a new dict entry per checkpointreasoning_parserauto-resolution (previously onlytool_call_parserwas auto-detected)@model_validatoronInferenceConfig.ModelConfig(auto_resolve_parsers) — testable without a running serverqwen3_coderinstead ofhermesExtracted from #1994.
🤖 Generated with Claude Code