diff --git a/src/content/docs-es/models.mdx b/src/content/docs-es/models.mdx index a1c0431..fdf5e87 100644 --- a/src/content/docs-es/models.mdx +++ b/src/content/docs-es/models.mdx @@ -309,4 +309,36 @@ OpenAI y la misma `base URL`. ]} /> +## Controlar el razonamiento. + +Todos los modelos de chat de arriba razonan antes de responder, y el +razonamiento llega separado de la respuesta, en `message.reasoning_content`. +Cuánto puede pensar cada modelo se elige por petición con el parámetro +`reasoning_effort`, y cada modelo lo aplica distinto: la tabla es el contrato. +Un valor que un modelo no puede aplicar nunca es un error. + +| Modelo | valores de `reasoning_effort` | Qué hace | +| --- | --- | --- | +| `glm5.3` · `glm5.3-flash` | `low`, `medium`, `high`, `max` | Control total. Valores más altos dejan que el modelo razone más antes de responder; `max` es el más profundo. | +| `qwen3.6` | `none`, `minimal`, `low`, `medium`, `high`, `max` | `none` y `minimal` se saltan por completo la fase de razonamiento. Los otros cuatro la acotan: low 2.048, medium 8.192, high 16.384, max 32.768 tokens. | +| `gemma4` | `none`, `minimal`, `low`, `medium`, `high`, `max` | Igual que `qwen3.6`: apagado, o un presupuesto de razonamiento entre 2.048 y 32.768 tokens. | +| `deepseek-v4-flash` | cualquier valor (sin efecto) | El modelo decide por petición cuánto razona; el parámetro nunca cambia eso. | +| `qwen3.8-flash` · `mimo-v2.5` | aceptado, profundidad no ajustable | El parámetro se acepta y nunca se rechaza, pero estos modelos gestionan su propia profundidad de razonamiento. | + +Sin parámetro, cada modelo usa su propio valor por defecto (razonamiento +activo en `qwen3.6` y `gemma4`, con presupuesto de 16.384 tokens). Más +razonamiento cuesta latencia y cuenta dentro de `max_tokens`; nunca cuesta +configuración adicional. + +```bash +curl https://api.nan.builders/v1/chat/completions \ + -H "Authorization: Bearer $NAN_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "model": "glm5.3-flash", + "reasoning_effort": "low", + "messages": [{"role": "user", "content": "Write a one-line summary of the CAP theorem."}] + }' +``` + diff --git a/src/content/docs/models.mdx b/src/content/docs/models.mdx index b4a3e0b..e1493bf 100644 --- a/src/content/docs/models.mdx +++ b/src/content/docs/models.mdx @@ -33,7 +33,7 @@ with the same `base URL`. ]} items={[ 'Tool calling (function calling)', - 'Reasoning mode (reasoning trace)', + 'Reasoning control (`reasoning_effort`: low · medium · high · max)', 'Coding and long-horizon agentic tasks', '1M token context', 'Streaming generation (SSE)', @@ -58,7 +58,7 @@ with the same `base URL`. ]} items={[ 'Tool calling', - 'Reasoning mode', + 'Reasoning mode (adaptive — not level-adjustable)', 'Vision (image input)', '1M token context', 'Streaming generation (SSE)', @@ -83,7 +83,7 @@ with the same `base URL`. ]} items={[ 'Tool calling (function calling)', - 'Reasoning mode', + 'Reasoning control (`reasoning_effort`: low · medium · high · max)', 'Vision (image input)', '1M token context', 'Streaming generation (SSE)', @@ -158,7 +158,7 @@ with the same `base URL`. ]} items={[ 'Tool calling (XML format)', - 'Reasoning mode', + 'Reasoning control (`none` · low · medium · high · max)', 'Multimodal (vision / images)', 'Streaming generation (SSE)', ]} @@ -182,7 +182,7 @@ with the same `base URL`. ]} items={[ 'Tool calling (XML format)', - 'Reasoning mode', + 'Reasoning control (`none` · low · medium · high · max)', 'Multimodal (vision / images)', 'Streaming generation (SSE)', ]} @@ -308,4 +308,35 @@ with the same `base URL`. ]} /> +## Controlling reasoning. + +Every chat model above thinks before it answers, and the reasoning trace +arrives separately from the answer, in `message.reasoning_content`. How much a +model is allowed to think is a request parameter, `reasoning_effort`, and each +model applies it differently — the table is the contract. A value a model +cannot apply is never an error. + +| Model | `reasoning_effort` values | What it does | +| --- | --- | --- | +| `glm5.3` · `glm5.3-flash` | `low`, `medium`, `high`, `max` | Fully controllable. Higher values let the model reason longer before it answers; `max` is the deepest. | +| `qwen3.6` | `none`, `minimal`, `low`, `medium`, `high`, `max` | `none` and `minimal` skip the reasoning phase entirely. The other four cap it: low 2,048, medium 8,192, high 16,384, max 32,768 tokens. | +| `gemma4` | `none`, `minimal`, `low`, `medium`, `high`, `max` | Same as `qwen3.6`: off, or a reasoning budget between 2,048 and 32,768 tokens. | +| `deepseek-v4-flash` | any value (no effect) | The model decides per request how much to reason; the parameter never changes that. | +| `qwen3.8-flash` · `mimo-v2.5` | accepted, depth not adjustable | The parameter is accepted and never rejected, but these models manage their own reasoning depth. | + +With no parameter, every model uses its own default (reasoning on for +`qwen3.6` and `gemma4`, with a 16,384-token budget). More reasoning costs +latency and counts toward `max_tokens`; it never costs extra setup. + +```bash +curl https://api.nan.builders/v1/chat/completions \ + -H "Authorization: Bearer $NAN_API_KEY" \ + -H "Content-Type: application/json" \ + -d '{ + "model": "glm5.3-flash", + "reasoning_effort": "low", + "messages": [{"role": "user", "content": "Write a one-line summary of the CAP theorem."}] + }' +``` + diff --git a/src/data/openapi.json b/src/data/openapi.json index 989ae4a..790fa90 100644 --- a/src/data/openapi.json +++ b/src/data/openapi.json @@ -221,13 +221,15 @@ "reasoning_effort": { "type": "string", "enum": [ + "none", + "minimal", "low", "medium", - "high" + "high", + "max" ], - "default": "medium", - "description": "Reasoning depth (`deepseek-v4-flash` only). The trace comes back in `message.reasoning_content`. More effort helps on hard problems, at the cost of latency and tokens.", - "example": "medium" + "description": "Reasoning depth. Per model: `glm5.3` and `glm5.3-flash` accept `low`, `medium`, `high` and `max` — deeper means the model reasons longer before answering. `qwen3.6` and `gemma4` accept `none` or `minimal` (no reasoning phase at all) and `low`, `medium`, `high`, `max`, which cap the reasoning phase at 2,048 / 8,192 / 16,384 / 32,768 tokens. `deepseek-v4-flash` reasons adaptively per request: the parameter is accepted and has no effect. The remaining chat models accept the parameter and manage their own depth. The reasoning trace arrives in `message.reasoning_content`. A value a model cannot apply is never rejected. Details: [Models](https://nan.builders/docs/models).", + "example": "high" }, "chat_template_kwargs": { "type": "object",