Skip to content

fix: honor local model reasoning ladders - #7125

Open
gannp wants to merge 7 commits into
codewhale-hq:mainfrom
gannp:fix/upstream-local-model-reasoning
Open

gannp wants to merge 7 commits into
codewhale-hq:mainfrom
gannp:fix/upstream-local-model-reasoning

Conversation

@gannp

@gannp gannp commented Oct 28, 2026 •

Copy link
Copy Markdown

What and why

The vLLM Chat adapter sends low/medium/high uniformly, but reviewed Qwen3.8 templates accept low/medium/xhigh and reject high. Other reviewed templates expose only a thinking switch or low/high/max.

Add revision-sourced local template facts and apply them after generic vLLM shaping. Qwen3.8 legacy High/Max reaches xhigh; boolean templates omit fictitious effort; GLM-5.3-Flash and DeepSeek-V4-Vision receive their actual levels. Model effort uses chat_template_kwargs, omitting the top-level enum so older OpenAI schemas cannot reject xhigh/max before rendering. Preserve legacy aliases, separately named Thinking variants, unknown IDs and non-vLLM routes. Credentials, routing, messages/tools, sampling, token budgets, streaming and retries are unchanged.

Issue

Closes #7124

Validation

  • Final upstream e8490b8: Linux config regressions report test result: ok. 6 passed; 0 failed. Exact checkout SHA is logged at https://github.com/gannp/codewhale/actions/runs/40651512918 (attempt 6).

  • 36 offline registry-to-pinned-template checks pass; raw Qwen high rejection was reproduced before adaptation. No live inference or runtime changes.

  • Formatting checked; a regression through the production Chat route added. Full repository CI remains separate and is still running.

  • Local Windows cargo test could not link because MSVC link.exe is absent; this is recorded as unavailable, not a pass.

AI-assisted draft contribution. Canonical served-name facts are narrow and source-revision linked; arbitrary custom aliases/templates are not inferred.

DeepSeek-V4-Vision retains its pre-existing Off request spelling; only its enabled effort ladder is normalized.

Signed-off-by: gannp <36723715+gannp@users.noreply.github.com>
@github-actions github-actions Bot added the contribution-gate Author not yet in .github/APPROVED_CONTRIBUTORS; a maintainer grants access with /lgtm label Oct 28, 2026
gannp added 2 commits October 28, 2026 15:44
Signed-off-by: gannp <36723715+gannp@users.noreply.github.com>
Signed-off-by: gannp <36723715+gannp@users.noreply.github.com>
gannp added 2 commits October 28, 2026 15:58
Signed-off-by: gannp <36723715+gannp@users.noreply.github.com>
Signed-off-by: gannp <36723715+gannp@users.noreply.github.com>
Signed-off-by: gannp <36723715+gannp@users.noreply.github.com>
@Hmbown

Hmbown commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator

thank you for this!

@Hmbown
Hmbown marked this pull request as ready for review October 30, 2026 05:30
@Hmbown
Hmbown self-requested a review as a code owner October 30, 2026 05:30

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

Copilot AI balanced review requested due to automatic review settings October 30, 2026 05:30
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-30T05:30:55.964705Z
We couldn’t complete this review. Comment @codex review to try again.
e8490b8 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Local vLLM reasoning tiers are not integrated into shared normalization or the route picker, causing supported low/medium requests to be promoted and leaving those lower-effort options unavailable in the picker.

2 open issues
What changed in this PR

This PR adds model-specific reasoning compatibility to the vLLM Chat adapter, replacing uniform effort values with revision-sourced local template mappings.

Changes:

  • Adds reviewed reasoning ladders and legacy aliases for Qwen, boolean-thinking, GLM, and DeepSeek templates.
  • Applies model-specific controls after generic vLLM shaping, placing effort in chat_template_kwargs.
  • Adds regression coverage, documentation, and a feature registry entry.
File Description
docs/​LOCAL_MODEL_REASONING.md Documents supported ladders, wire values, and matching limits.
docs/​features.toml Registers local model reasoning compatibility.
crates/​tui/​src/​client/​chat.rs Integrates template shaping and adds a route-shaping regression.
crates/​config/​src/​local_reasoning.rs Implements model matching, alias normalization, request shaping, and checks.
crates/​config/​src/​local_reasoning.json Defines reviewed template mappings with source revisions.
crates/​config/​src/​lib.rs Exports the local reasoning module.

Review effort: Balanced

Comment on lines +18 to +19
/// Distinct selectable tiers, in ascending order.
pub tiers: Vec<String>,
Comment on lines +595 to +597
codewhale_config::local_reasoning::apply_local_reasoning_controls(
body, provider, model, effort,
);

This branch has not been deployed

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

Labels

contribution-gate Author not yet in .github/APPROVED_CONTRIBUTORS; a maintainer grants access with /lgtm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vLLM effort values must follow the local model template

3 participants