Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 28 additions & 5 deletions src/content/docs-es/codex.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,19 @@ Edita `~/.codex/config.toml`:
```toml
model_provider = "nan"
model = "glm5.3-flash"
model_context_window = 1048576

[model_providers.nan]
name = "NaN"
base_url = "https://api.nan.builders/v1"
env_key = "NAN_API_KEY"
wire_api = "chat"
wire_api = "responses"
```

Tres detalles que importan:
Cuatro detalles que importan:

- **`wire_api = "chat"`** hace que Codex use `/chat/completions`. Es lo que quieres con la mayoría de modelos: el endpoint `/responses` del clúster solo va emitiendo la respuesta por partes con `deepseek-v4-flash`, y con los demás contesta de una sola vez, así que con `"responses"` verías la respuesta aparecer de golpe al final.
- **`wire_api = "responses"`** es el único valor que Codex sigue aceptando. Desde la 0.154, `"chat"` no es que vaya peor: el fichero no carga y Codex no abre. Esta página recomendaba `"chat"` porque `/responses` contestaba de una sola vez; ahora emite la respuesta por partes, salvo con `qwen3.6` y `gemma4` (mira abajo).
- **`model_context_window`** hace falta porque Codex no tiene metadatos de los modelos del clúster: sin él supone una ventana y compacta la conversación mucho antes de tiempo. Pon la del modelo que uses; están en [Modelos](/es/docs/models).
- **El identificador del proveedor no puede ser `openai`, `ollama` ni `lmstudio`**, que están reservados. Por eso se llama `nan`.
- **`base_url` termina en `/v1`** y nada más. No añadas la ruta del endpoint.

Expand All @@ -64,7 +66,24 @@ Puedes cambiarlo sin tocar el fichero:
codex --model deepseek-v4-flash
```

O dejar varios proveedores declarados y elegir con `--profile` si prefieres perfiles separados por tarea.
Con una pega: la `model_context_window` del fichero no cambia con el modelo, así que un modelo de 262.144 tokens se queda con la ventana del que tengas declarado, y Codex compacta contra una ventana que no existe.

Para tener los modelos del clúster a mano, cada uno con su ventana, escribe un fichero por modelo en `~/.codex/`. Codex lo llama perfil: tu `config.toml` con ese fichero encima.

```toml
# ~/.codex/nan-qwen36.config.toml
model = "qwen3.6"
model_provider = "nan"
model_context_window = 262144
```

```bash
codex --profile nan-qwen36
```

Ojo con el nombre: Codex quiere "un nombre simple" y **rechaza los puntos**, así que `qwen3.6` no vale como perfil aunque sí como modelo.

El resto del `config.toml` (tu proveedor, tus MCP, tus permisos) sigue aplicando; el perfil solo pisa lo que nombra. El [CLI de NaN](/es/docs/nan-cli) los escribe por ti, uno por cada modelo de chat del clúster, con el prefijo `nan-` y sin los puntos: `nan-glm53-flash`, `nan-deepseek-v4-flash`, `nan-mimo-v26-flash`, `nan-qwen36`... Al desconectar Codex se los lleva.

## Modelo recomendado

Expand All @@ -74,7 +93,11 @@ O dejar varios proveedores declarados y elegir con `--profile` si prefieres perf

- **Las funciones en la nube de Codex no aplican.** Al declarar un proveedor propio, todo va contra NaN desde tu máquina.
- **El razonamiento se ve distinto según el modelo.** Los modelos del clúster emiten su traza de razonamiento a su manera, y Codex no siempre la presenta como con los modelos de OpenAI.
- **Si cambias `wire_api` a `"responses"`**, solo `deepseek-v4-flash` sigue mostrando la respuesta poco a poco. Con los demás modelos aparece de golpe al final. No es un cuelgue: es que con esos modelos ese endpoint todavía no emite la respuesta por partes.
- **`wire_api = "chat"` en un fichero antiguo.** Codex 0.154 lo retiró: si lo tienes, ni la CLI ni la app de escritorio abren. Cámbialo a `"responses"`, o pasa por el Setup del CLI de NaN, que lo corrige solo.
- **`model_context_window` repetida.** Las versiones del CLI de NaN anteriores a la 0.1.20 la añadían al final del fichero en cada pasada del setup. Dos son una clave duplicada y Codex no carga el fichero: la CLI dice `duplicate key` y la app abre un diálogo de error y nada más. La 0.1.20 deja una sola y la pone donde se lee.
- **`401 This API key does not have access to the requested model`.** Pese al mensaje, la clave suele estar bien: el modelo es uno que el clúster no sirve. O el `model_provider` apunta al clúster pero el `model` sigue siendo de OpenAI, o el modelo se ha retirado: `mimo-v2.5` ahora es `mimo-v2.6-flash`. Comprueba el id en [Modelos](/es/docs/models). El CLI de NaN 0.1.30 cambia el perfil `nan-mimo-v25` por `nan-mimo-v26-flash` la próxima vez que pases por su Setup.
- **Con `qwen3.6` y `gemma4` la respuesta sigue llegando de golpe** al final del turno. No es un cuelgue: con esos dos el `/responses` del clúster retiene la respuesta hasta tenerla completa. El resto de modelos la va emitiendo según se escribe.
- **`Model metadata for ... not found. Defaulting to fallback metadata`** en cada turno. Es ruido: Codex lo imprime antes de leer tu `model_context_window`, y la ventana que acaba usando es la tuya.

</Details>

33 changes: 28 additions & 5 deletions src/content/docs/codex.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,19 @@ Edit `~/.codex/config.toml`:
```toml
model_provider = "nan"
model = "glm5.3-flash"
model_context_window = 1048576

[model_providers.nan]
name = "NaN"
base_url = "https://api.nan.builders/v1"
env_key = "NAN_API_KEY"
wire_api = "chat"
wire_api = "responses"
```

Three details that matter:
Four details that matter:

- **`wire_api = "chat"`** makes Codex use `/chat/completions`. That is what you want with most models: the cluster's `/responses` endpoint streams incrementally only on `deepseek-v4-flash`, and on the others it answers in one go, so with `"responses"` you would see the answer appear all at once at the end.
- **`wire_api = "responses"`** is the only value Codex still takes. Since 0.154, `"chat"` does not just work worse: the file does not load and Codex does not open. This page used to recommend `"chat"` because `/responses` answered in one go; it streams the answer now, except on `qwen3.6` and `gemma4` (see below).
- **`model_context_window`** is needed because Codex has no metadata for the cluster's models: without it, it guesses a window and compacts the conversation long before it has to. Use the one for the model you run; they are in [Models](/docs/models).
- **The provider identifier cannot be `openai`, `ollama` or `lmstudio`**, which are reserved. That is why it is called `nan`.
- **`base_url` ends at `/v1`** and nothing more. Do not add the endpoint path.

Expand All @@ -64,7 +66,24 @@ You can change it without touching the file:
codex --model deepseek-v4-flash
```

Or leave several providers declared and pick with `--profile` if you prefer separate profiles per task.
With one catch: the `model_context_window` in the file does not follow the model, so a 262,144-token model keeps the window of whichever one you declared, and Codex compacts against a window that is not there.

To keep the cluster's models at hand, each with its own window, write one file per model in `~/.codex/`. Codex calls it a profile: your `config.toml` with that file layered on top.

```toml
# ~/.codex/nan-qwen36.config.toml
model = "qwen3.6"
model_provider = "nan"
model_context_window = 262144
```

```bash
codex --profile nan-qwen36
```

Mind the name: Codex wants "a plain name" and **rejects dots**, so `qwen3.6` is not usable as a profile even though it is fine as a model.

The rest of your `config.toml` - your provider, your MCP servers, your permissions - still applies; the profile only overrides what it names. The [NaN CLI](/docs/nan-cli) writes them for you, one per chat model on the cluster, prefixed `nan-` and with the dots dropped: `nan-glm53-flash`, `nan-deepseek-v4-flash`, `nan-mimo-v26-flash`, `nan-qwen36`... Disconnecting Codex takes them away again.

## Recommended model

Expand All @@ -74,6 +93,10 @@ Or leave several providers declared and pick with `--profile` if you prefer sepa

- **Codex's cloud features do not apply.** Once you declare a provider of your own, everything goes to NaN from your machine.
- **Reasoning looks different depending on the model.** The cluster's models emit their reasoning trace their own way, and Codex does not always present it the way it does with OpenAI's models.
- **If you change `wire_api` to `"responses"`**, only `deepseek-v4-flash` keeps showing the answer gradually. With the other models it appears all at once at the end. It is not a hang: on those models that endpoint does not stream yet.
- **`wire_api = "chat"` in an older file.** Codex 0.154 dropped it: if you have it, neither the CLI nor the desktop app opens. Change it to `"responses"`, or go through the NaN CLI's Setup, which repairs it for you.
- **A repeated `model_context_window`.** NaN CLI versions before 0.1.20 appended one at the end of the file on every setup run. Two of them is a duplicate key and Codex will not load the file: the CLI says `duplicate key` and the desktop app opens an error dialog and nothing else. 0.1.20 leaves one and puts it where it is read from.
- **`401 This API key does not have access to the requested model`.** Despite the wording, the key is usually fine: the model is one the cluster does not serve. Either `model_provider` points at the cluster but `model` is still an OpenAI one, or the model has been retired - `mimo-v2.5` is now `mimo-v2.6-flash`. Check the id against [Models](/docs/models). NaN CLI 0.1.30 swaps the `nan-mimo-v25` profile for `nan-mimo-v26-flash` the next time you run its Setup.
- **On `qwen3.6` and `gemma4` the answer still arrives all at once** at the end of the turn. It is not a hang: on those two the cluster's `/responses` holds the answer until it is complete. Every other model streams it as it is written.
- **`Model metadata for ... not found. Defaulting to fallback metadata`** on every turn. It is noise: Codex prints it before it reads your `model_context_window`, and the window it ends up using is yours.

</Details>
Loading
Loading