feat: reasoning level select (Off/Light/Moderate/High/Max)
Replace free-form reasoning_budget_tokens number input with a 5-level select in both the edit form (local_llm.py) and add-model form (local_llm.html). Values: 0 / 1024 / 4096 / 8192 / 32768 tokens. Edit form pre-selects the stored value. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -211,6 +211,11 @@ def _render(username: str, success: str = "", error: str = "") -> str:
|
|||||||
cur_tools = m.get("tools", True)
|
cur_tools = m.get("tools", True)
|
||||||
cur_tags = ", ".join(m.get("tags") or [])
|
cur_tags = ", ".join(m.get("tags") or [])
|
||||||
cur_reasoning_budget = m.get("reasoning_budget_tokens") or 0
|
cur_reasoning_budget = m.get("reasoning_budget_tokens") or 0
|
||||||
|
_rb_levels = [(0, "Off — Non-think"), (1024, "Light"), (4096, "Moderate"), (8192, "High"), (32768, "Max")]
|
||||||
|
reasoning_opts = "".join(
|
||||||
|
f'<option value="{v}" {"selected" if cur_reasoning_budget == v else ""}>{lbl}</option>'
|
||||||
|
for v, lbl in _rb_levels
|
||||||
|
)
|
||||||
|
|
||||||
model_rows += f'''
|
model_rows += f'''
|
||||||
<div class="model-row" id="model-{m["id"]}">
|
<div class="model-row" id="model-{m["id"]}">
|
||||||
@@ -258,9 +263,11 @@ def _render(username: str, success: str = "", error: str = "") -> str:
|
|||||||
title="Per-model tool loop cap. 0 = use the global default (orchestrator_max_rounds).">
|
title="Per-model tool loop cap. 0 = use the global default (orchestrator_max_rounds).">
|
||||||
</div>
|
</div>
|
||||||
<div class="field" style="flex:0 0 auto">
|
<div class="field" style="flex:0 0 auto">
|
||||||
<label title="OpenRouter reasoning budget in tokens. 0 = no reasoning override (model default). Injects reasoning.budget_tokens into the API call.">Reasoning tokens</label>
|
<label title="Reasoning depth via OpenRouter's reasoning.budget_tokens. Off = Non-think. Light ~1k, Moderate ~4k, High ~8k, Max ~32k tokens.">Reasoning</label>
|
||||||
<input type="number" name="reasoning_budget_tokens" value="{cur_reasoning_budget}" min="0"
|
<select name="reasoning_budget_tokens"
|
||||||
title="OpenRouter reasoning budget in tokens. 0 = disabled. E.g. 2048 for light thinking, 8192 for deep reasoning.">
|
title="Reasoning depth via OpenRouter's reasoning.budget_tokens. Off = Non-think. Light ~1k, Moderate ~4k, High ~8k, Max ~32k tokens.">
|
||||||
|
{reasoning_opts}
|
||||||
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="field" style="flex:0 0 auto">
|
<div class="field" style="flex:0 0 auto">
|
||||||
<label title="Whether this model supports tool calling. If not supported, requests skip the tool loop entirely.">Tool calling</label>
|
<label title="Whether this model supports tool calling. If not supported, requests skip the tool loop entirely.">Tool calling</label>
|
||||||
|
|||||||
@@ -503,6 +503,17 @@
|
|||||||
<input type="number" name="max_rounds" value="0" min="0"
|
<input type="number" name="max_rounds" value="0" min="0"
|
||||||
title="Per-model tool loop cap. 0 = use the global default (orchestrator_max_rounds).">
|
title="Per-model tool loop cap. 0 = use the global default (orchestrator_max_rounds).">
|
||||||
</div>
|
</div>
|
||||||
|
<div class="field" style="flex:0 0 auto">
|
||||||
|
<label title="Reasoning depth via OpenRouter's reasoning.budget_tokens. Off = Non-think. Light ~1k, Moderate ~4k, High ~8k, Max ~32k tokens.">Reasoning</label>
|
||||||
|
<select name="reasoning_budget_tokens"
|
||||||
|
title="Reasoning depth via OpenRouter's reasoning.budget_tokens. Off = Non-think. Light ~1k, Moderate ~4k, High ~8k, Max ~32k tokens.">
|
||||||
|
<option value="0" selected>Off — Non-think</option>
|
||||||
|
<option value="1024">Light</option>
|
||||||
|
<option value="4096">Moderate</option>
|
||||||
|
<option value="8192">High</option>
|
||||||
|
<option value="32768">Max</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
<div class="field" style="flex:0 0 auto">
|
<div class="field" style="flex:0 0 auto">
|
||||||
<label title="Whether this model supports tool calling. If not supported, requests skip the tool loop entirely.">Tool calling</label>
|
<label title="Whether this model supports tool calling. If not supported, requests skip the tool loop entirely.">Tool calling</label>
|
||||||
<select name="tools"
|
<select name="tools"
|
||||||
|
|||||||
Reference in New Issue
Block a user