Skip to content

refactor: regex-based auto-resolution for tool call and reasoning parsers#2290

Draft
mikasenghaas wants to merge 10 commits intorefactor/before-validator-propagationfrom
feat/regex-parser-resolution
Draft

refactor: regex-based auto-resolution for tool call and reasoning parsers#2290
mikasenghaas wants to merge 10 commits intorefactor/before-validator-propagationfrom
feat/regex-parser-resolution

Conversation

@mikasenghaas
Copy link
Copy Markdown
Member

@mikasenghaas mikasenghaas commented Apr 16, 2026

Based on #2291. Do not merge before.

Summary

  • Replace the hardcoded MODEL_TOOL_CALL_PARSER dict (~100 entries) in server.py with regex patterns in utils/parsers.py — new model variants are matched automatically without a new dict entry per checkpoint
  • Add reasoning_parser auto-resolution (previously only tool_call_parser was auto-detected)
  • Resolve parsers at config validation time via a @model_validator on InferenceConfig.ModelConfig (auto_resolve_parsers) — testable without a running server
  • Fix parser mappings: INTELLECT-3 and Qwen3-Coder now correctly resolve to qwen3_coder instead of hermes

Extracted from #1994.

🤖 Generated with Claude Code

mikasenghaas and others added 10 commits April 17, 2026 19:24
…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>
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>
@mikasenghaas mikasenghaas force-pushed the feat/regex-parser-resolution branch from 18a0089 to 4cf0884 Compare April 17, 2026 21:20
@mikasenghaas mikasenghaas changed the base branch from main to refactor/before-validator-propagation April 17, 2026 21:21
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.

1 participant