mirror of
https://github.com/langgenius/dify-official-plugins.git
synced 2026-07-21 17:45:23 -04:00
[PR #2341] [MERGED] feat(xinference): add think parameter to control deep thinking mode #2411
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/langgenius/dify-official-plugins/pull/2341
Author: @Alysondao
Created: 12/27/2025
Status: ✅ Merged
Merged: 12/28/2025
Merged by: @crazywoola
Base:
main← Head:feat/xinference-think-parameter📝 Commits (1)
7d337e0feat(llm): add thinking mode parameter and bump version to 0.0.9📊 Changes
2 files changed (+67 additions, -21 deletions)
View changed files
📝
models/xinference/manifest.yaml(+1 -1)📝
models/xinference/models/llm/llm.py(+66 -20)📄 Description
Background
Some OpenAI-compatible models (e.g. Qwen3, DeepSeek-V3.1) support a thinking / reasoning mode.
However, Xinference currently does not provide an explicit way to enable or disable this behavior at the request level.
In real-world business scenarios, we found that Xinference-deployed model plugins do not support dynamically enabling or disabling deep thinking.
Previously, the common workaround was to control this behavior via environment variables at deployment time.
This approach is coarse-grained and inflexible: within the same service, different business workflows may have different requirements — some benefit from deep reasoning, while others prioritize latency and cost and do not need it.
To address this limitation, this PR introduces a request-level parameter to explicitly control whether deep thinking is enabled.
This PR adds an optional think boolean parameter to allow explicit control of this behavior.
What’s changed
thinkparameter (boolean) for Xinference LLM modelsthink=false, automatically disable deep thinking at request level by passing:extra_body.chat_template_kwargs.enable_thinking = falseextra_body.thinking = falsethinkparameter for easier configuration and migrationthinkis not provided, the server-side default behavior is preservedHow to use
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.