Proposal: auto-suppress THINKING for structured-output (format=) requests

Abierto
#1,598 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
python

Línea de trabajo

Read the related issues #1553, #406, and #1587 to understand the parser failure and existing thinking-option behavior. The proposal names generate_from_raw, act, and @generative as entry points, but does not identify files or tests. First get maintainer sign-off on the default-behavior change; done means structured-output requests default thinking off unless explicitly overridden, with coverage for the affected entry points.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

area/backends enhancement needs-design p2

Problem

#1553 documents that structured-output examples using @generative stubs / format= are unreliable on thinking models unless the caller explicitly sets ModelOption.THINKING: False — the output parser otherwise receives the combined think-block-plus-answer text.

#1587 (Granite 4.2 defaults) independently confirmed the underlying mechanism: granite4.2 thinks by default unless reasoning_effort="none" / chat_template_kwargs.enable_thinking=False is sent, and produces a disproportionately long think block even for trivial prompts (observed: a 64-token capped reply was ~45 thinking tokens with thinking on, 2 with it off).

Proposal

When a caller passes format=SomeModel (or otherwise requests constrained/structured output) to generate_from_raw / act / a @generative stub, and the caller has not explicitly set ModelOption.THINKING, default it to False. This fixes the "parser receives combined think+answer text" failure mode structurally, instead of requiring every caller to remember to set the option themselves.

This is a default-behavior change (an explicit ModelOption.THINKING: True would still opt back in), so it needs maintainer sign-off on the direction before implementation — filing as a proposal to discuss, not a ready-to-merge PR.

Related

  • #1553 — states the problem, requests test coverage for ModelOption.THINKING on OllamaModelBackend
  • #406 — cross-backend thinking abstraction (this would be one concrete policy built on top of it)
  • #1587 — Ollama-specific THINKING → reasoning_effort mapping this proposal would build on
Lenguaje dominante
Python
Estrellas
1.8k
Forks
161
Merge medio
4 d 3 h
PR fusionados (30 d)
45

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de generative-computing/mellea

Todos los issues de generative-computing/mellea

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.