Skip to content

Translate reasoning-effort field for clients that can't vary the model ID (Open WebUI, OpenCode) #958

Description

@asf0

Clients like Open WebUI and OpenCode expose a reasoning-effort selector (e.g. reasoning_effort: "low"/"medium"/"high") as a plain request body field, sent alongside a fixed model value. There's currently no way to translate that into llama.cpp's native chat_template_kwargs.enable_thinking / thinking_budget_tokens fields.

The existing workaround (#584) requires the client to vary the model string itself per preset (e.g. model:low, model:med) via setParamsByID. That works for clients that let the user pick a model-ID variant, but Open WebUI/OpenCode don't — they keep model fixed and vary a separate effort field instead.

Request: a filter that maps a configurable input field (default reasoning_effort) to a set of presets, each preset setting chat_template_kwargs.enable_thinking / thinking_budget_tokens. Explicit client-supplied native fields should always win over the preset values. Since the model ID is never touched, switching effort levels shouldn't require unloading/reloading the model.

I have a PR up implementing this: #934.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions