Repository navigation
Description
Context & Rationale
is_reasoning_model (ai/client/models.py:209-218) decides from the model name alone. It checks for :thinking, then two substrings, six exact names and eight prefixes (config/constants.py:1691-1707).
OpenAICompatProviderMixin uses the answer to pick request parameters (ai/client/openai.py:102-105):
- reasoning models get
reasoning_effortandmax_completion_tokens; - other models get
max_tokens,temperatureandtop_p(:57-80).
At ef21785 it is wrong in both directions for the deployed gateway:
devops-reasoningis on the exact list, but the gateway routes it toollama_chat/qwen3-coder:30b(k8s/llm/gateway/configmap.yaml:49-52), which does not reason. Its temperature and top_p are never sent.gpt-oss:20bserves two of the fourdevops-reviewdeployments (configmap.yaml:99-108) and is a reasoning model, but it gets standard parameters and noreasoning_effort.- Names outside the lists:
o5-miniandclaude-opus-4also return false.
The gateway sets drop_params: true (configmap.yaml:166), so mismatched parameters are dropped silently instead of failing. A direct provider call gets no such protection. The gateway already serves /model/info, which fetch_model_info reads (ai/gateway.py:258).
Scope & Deliverables
- Deliverable:
- The client picks parameters from a declared capability:
- gateway deployments declare
supports_reasoningin theirmodel_info, and the client reads it from/model/infoonce per process; - models used directly without the gateway declare it in devops-cli's model configuration;
- an undeclared model gets standard parameters.
- gateway deployments declare
- Delete the three name lists and the
:thinkingcheck.
- The client picks parameters from a declared capability:
- Acceptance criteria:
-
Unit tests against a fake
/model/infopayload check that:- a declared deployment gets reasoning parameters;
- an undeclared one gets standard parameters;
- a model named
o3with no declaration gets standard parameters.
Verified by the tests, with no network.
-
grep -rn 'CONST_REASONING_MODEL_' src testsprints nothing. Verified by the command. -
Check a person runs after deploying the gateway config:
curl -s -H "Authorization: Bearer $DEVOPS_AI_GATEWAY_KEY" "$DEVOPS_AI_GATEWAY_URL/model/info" | jq '.data[] | {model_name, model: .litellm_params.model, r: .model_info.supports_reasoning}'showstrueonly for thegpt-ossdeployments.
-
- Key questions:
- What happens for a model group that mixes reasoning and non-reasoning deployments, such as
devops-review? Proposed: a group gets reasoning parameters only when every deployment in it declares support. A mixed group gets standard parameters, and the PR records that this applies todevops-review. - Does the pinned LiteLLM image pass
supports_reasoningthrough/model/info? The builder confirms it with the curl check above. If it does not, the client reads the same flag from devops-cli's own model configuration (proposed).
- What happens for a model group that mixes reasoning and non-reasoning deployments, such as
- Constraint: No name or prefix matching remains. Tests never call a gateway.
Strategic Alignment
- Milestone: Backlog (no release)
- Depends on: none
- Related: fix(security): network references come from url and ip syntax, not identifier-prefix and property-suffix lists #431 (split from it), feat(cli): measured per-deployment capability probes replacing parameter-count failover floors #595 (the same name-based pattern for capability floors), feat(ai): gpt-oss reasoning effort for group analysis is measured and set on its gateway deployments #479
Split off #431 during the v0.2.25/v0.2.26 readiness review (2026-10-01): Part of #431's original scope that #431 no longer covers. It is a different module (the AI client) and needs a gateway config change, so it is its own PR.
Update 2026-10-08: refinement
Owner decision on #1001: thinking comes from pydantic-ai settings and profiles, never names. The declared capability sets supports_thinking on the ModelProfile; ai/client/openai.py:57-80 goes with #1001's adapters. Sources add Ollama's /api/show capabilities; the error-text checks (ai/client/ollama.py:214-401) go.
- A model named
o3with no declaration getssupports_thinking=False. - With thinking off, no reasoning parameter is sent.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty commentedon Oct 3, 2026
Evidence from the model-choice evaluation (2026-10-03):
enable_thinking=Falseturns thinking on. Source:.data/model-choice-20261003.md, section 3, and its verification pass. Lines are at e3ff98c.How "no thinking" becomes
think: true.enable_thinking=False(ai/review/pipeline.py:967). On the gateway path that reaches only reasoning-named models (ai/client/openai.py:101-104)._apply_reasoning_paramsmaps False to effort"low", or to the configuredai.reasoning_effort, which is"high"in the owner's config (openai.py:60).ollama_chatmap_openai_paramssetsthink = value in {"low", "medium", "high"}for every model except gpt-oss [sourced: BerriAI/litellm v1.103.0litellm/llms/ollama/chat/transformation.py].think: true.Ollama's side (v0.34.4) [sourced]:
think: trueon a model without that capability, such as qwen3-coder:30b. It acceptsthink: false(server/routes.go:2704-2723).thinkis omitted can differ from the model card's. For qwen3.8:27b, Ollama applies "medium" (server/model_thinking.go), while the card's default is xhigh (https://huggingface.co/Qwen/Qwen3.8-27B).The workaround today.
think: falsein a gateway deployment'slitellm_paramsreaches Ollama as top-levelthink, because LiteLLM'stransform_requestkeeps False. The model-choice plan uses it for a qwen3.6:35b-a3b trial group.Suggested addition to the criteria. A model declared to support thinking, called with
enable_thinking=False, sendsthink: false(or no reasoning parameter), never an effort that LiteLLM maps tothink: true. A model declared without it gets nothinkat all.No review model is reasoning-named today (
devops-review,qwen3-coder:30b), so this bites only if a thinking model joins the review. P2 still fits.The other settings the pipeline cannot pass are filed as #1070:
num_ctxon the gateway path, sampling keys that are silently dropped, streamed chat sending no sampling, sampling that cannot be left unset, sessions that record no sampling, and the reply cache key.dan-petty commentedon Oct 8, 2026
Addition from the 2026-10-08 client-library audit (checked at release/v0.2.29, 05e9388).
The native Ollama client decides thinking support from error text.
think: true, and on an HTTP 400 whose body contains "does not support thinking" it records the model as non-thinking and retries withthink: false(ai/client/ollama.py:213,:388).:216,:392).Ollama's documented source is
POST /api/show, whose reply lists the model'scapabilities(for examplethinking). The client should read it once per host and model, cache it, and sendthinkonly when the model declares the capability. The error-text checks and the retry go.Key question for the owner: probe on first use or at prewarm?
Found by the 2026-10-08 client-library audit.
dan-petty commentedon Oct 17, 2026
Moved to v0.2.37: v0.2.37 started with fewer than its 16 items and was topped up to 16 from Ready items, critical fixes and P0 features first. (devops roadmap reprioritize)
fix(ai): reasoning request parameters follow declared capability (#888)…
dan-petty commentedon Oct 18, 2026
What changed
#1636, merged into
release/v0.2.37as 50711da.25 file(s) changed.
How it was verified
Check runs at 30d88eb:
Acceptance Criteria of
docs/agent/tasks/task-888-reasoning-request-parameters.md:No Acceptance Criteria section.
feat(release): v0.2.37 (#1720)