Skip to content

Custom backend models show all 8 reasoning efforts instead of the model's real ones #144

Description

@android6

Repro: add a custom OpenAI-compatible backend (https://api.deepseek.com), model deepseek-v4-pro, route openai-chat, Reasoning ON → open the reasoning-effort menu.

Expected: Off / High / Maximum — models.dev (deepseek/deepseek-v4-pro) publishes toggle + effort [high, max]. Actual: Off, Minimal, Low, Medium, High, Extra high, Maximum, Ultra (screenshot). Picking one sends that literal reasoning_effort to the API.

Cause (v0.6.0):

The backend editor has no efforts control, so buildCustomModelConnection (src/features/model-access/custom-backend.ts) always saves reasoningEfforts: [].
connectionsToModelProviders (src/lib/models-dev.ts, ~L115) spreads connection capabilities after models.dev metadata, so the empty array overwrites the catalog-derived list.
ReasoningEffortSelector.tsx L39 treats an empty list as unknown and renders the full hardcoded scale — note ultra exists in no models.dev entry for this model, so the menu can only be that fallback.

Fix — override only when non-empty:

ts
...(caps.reasoningEfforts?.length ? { reasoningEfforts: caps.reasoningEfforts } : {}),

Side note: reasoningMetadataForModel unions reasoning_options across every */deepseek-v4-pro reseller entry in the catalog (42 of them), which would still pollute the menu after this fix — preferring the canonical provider entry could be a follow-up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions