fix: make chat-template thinking configurable - #561
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds optional Changesenable_thinking configuration and propagation
Sequence Diagram(s)sequenceDiagram
participant Operator as Operator
participant ConfigLoader as config loader
participant Settings as Settings
participant ModelEndpointService as model endpoint service
participant VLLMClient as VLLMClient
participant vLLMAPI as vLLM API
Operator->>ConfigLoader: set enable_thinking in env / YAML
ConfigLoader->>Settings: load config fields
Settings->>ModelEndpointService: seed endpoint extras
ModelEndpointService->>VLLMClient: pass enable_thinking
VLLMClient->>VLLMClient: move flag into chat_template_kwargs
VLLMClient->>vLLMAPI: POST /chat/completions
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
The config models now define enable_thinking with a None default, so the getattr fallback in the dispatcher can never trigger. Use direct attribute access to match the surrounding sibling-field access.
dcdfdef to
29c932e
Compare
Ahmath-Gadji
left a comment
There was a problem hiding this comment.
LGTM.
I've tested it. Nothing is broken on my side
Why
Mistral-tokenizer deployments fail when OpenRAG sends Qwen-specific chat-template kwargs by default. Removing the option entirely is also a regression for deployments that rely on suppressing Qwen-style reasoning traces.
Change
This makes the thinking control opt-in across the affected LLM and VLM paths. Mistral deployments omit it by default, while Qwen-style deployments can enable the setting explicitly.
Fixes #559.
Verification
uv run --no-env-file pytest tests/unit -qAUTH_TOKEN=test-admin-token OPENRAG_API_URL=http://localhost:8080 uv run --no-env-file pytest tests/integration/api -q --tb=shortuv run --no-env-file ruff check ...uv run --no-env-file ruff format --check ...git diff --checkSummary by CodeRabbit