@gtrabanco/pi-nan-provider 1.5.4 → 1.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +63 -32
- package/README.es.md +63 -55
- package/README.md +57 -49
- package/package.json +1 -1
- package/scripts/generate-models.ts +27 -37
- package/scripts/manual-overrides.ts +168 -120
- package/scripts/models.generated.ts +407 -78
- package/src/mcp/media-server.ts +1 -1
package/AGENTS.md
CHANGED
|
@@ -206,45 +206,59 @@ Since 1.0.0 the package version **aligns its MAJOR.MINOR with the pi release lin
|
|
|
206
206
|
truth (maintainer instruction, reaffirmed 2026-09-29), cross-checked against
|
|
207
207
|
the `model` param description in https://nan.builders/openapi.json, plus
|
|
208
208
|
(since 2026-11-10) the live `GET /v1/models` for models NaN launches before
|
|
209
|
-
the docs catch up (see "
|
|
209
|
+
the docs catch up (see "Larger models" below). The original
|
|
210
210
|
seven documented chat models declare 1M-token windows where the docs say so —
|
|
211
211
|
`deepseek-v4-flash`, `glm5.3-flash`, `qwen3.8-flash` and `mimo-v2.6-flash` at
|
|
212
212
|
**1,048,576**, `qwen3.6` and `gemma4` at **262,144** — and the first three
|
|
213
213
|
carry a `MANUAL_OVERRIDES.contextWindow` because models.dev lagged (rounded
|
|
214
214
|
1,000,000 for the first two, stale 262,144 for `qwen3.8-flash`; docs checked
|
|
215
215
|
2026-10-14).
|
|
216
|
-
Official chat models (checked 2026-
|
|
216
|
+
Official chat models (checked 2026-11-17): community `deepseek-v4-flash`,
|
|
217
217
|
`mimo-v2.6-flash`, `qwen3.8-flash`, `glm5.3-flash`, `qwen3.6`, `gemma4`
|
|
218
|
-
(all text+image vision) + `glm5.3`
|
|
219
|
-
|
|
218
|
+
(all text+image vision) + `glm5.3` (~753B MoE, **text only** since the
|
|
219
|
+
2026-11-17 docs — an image, audio, video or file part answers 400, earlier
|
|
220
|
+
turns included; the old card said multimodal, models.dev now says text-only).
|
|
220
221
|
**glm5.3 is a general catalog model since 2026-11-10** (NaN announced "a
|
|
221
222
|
partir de ahora ya NO habrá modelos exclusivos por tier"; the live
|
|
222
223
|
`GET /v1/models` lists it for a non-premium key, checked 2026-11-10). It was
|
|
223
224
|
premium live-only before (`LIVE_ONLY_MODEL_IDS` in the generator and
|
|
224
225
|
`LIVE_ONLY_MODEL_DATA` in `src/fetch-models.ts`); both were REMOVED in
|
|
225
226
|
package 1.5.1 as dead code once nothing was tier-gated. Its values live in
|
|
226
|
-
`MANUAL_OVERRIDES["glm5.3"]` (1,048,576 / 131,072, text
|
|
227
|
-
reasoningEffortValues low/medium/high/max,
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
`
|
|
238
|
-
`
|
|
239
|
-
(`EXTERNAL_MODELS`), each with a provenance
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
227
|
+
`MANUAL_OVERRIDES["glm5.3"]` (1,048,576 / 131,072, **text only**,
|
|
228
|
+
reasoningEffortValues minimal/low/medium/high/xhigh/max,
|
|
229
|
+
`thinkingLevelMap { off: "minimal" }` — GLM cannot stop reasoning and the
|
|
230
|
+
docs apply `none` as `minimal`, name "GLM 5.3") over the models.dev entry
|
|
231
|
+
(text-only, 1,000,000). The overlay/merge paths now treat it like any
|
|
232
|
+
catalogued id (issue #19's invariant is intact: the store decides which ids
|
|
233
|
+
exist, the generated catalog decides their capabilities). `src/usage.ts` no
|
|
234
|
+
longer has a `premium` flag (removed in 1.5.1 at the maintainer's request);
|
|
235
|
+
its token windows are a known follow-up, NaN moved to credits.
|
|
236
|
+
**Larger models — six, all documented since 2026-11-17** (the docs' own
|
|
237
|
+
label; NaN bills them as "larger model" because they use credits faster):
|
|
238
|
+
`kimi-k3.1-pro`, `qwen3.8-max`, `qwen4-max`, `deepseek-v4-pro`, `hy4`,
|
|
239
|
+
`hy4-flash`. They live in `scripts/manual-overrides.ts` as `LARGER_MODELS`
|
|
240
|
+
(renamed from `EXTERNAL_MODELS` in package 1.5.6), each with a provenance
|
|
241
|
+
note citing https://nan.builders/docs/models (checked 2026-11-17):
|
|
242
|
+
contextWindow 1,048,576 per NaN's 1M convention except the two Alibaba
|
|
243
|
+
flagships (1,000,000, the first-party vendor value); maxTokens from the
|
|
244
|
+
card's "Max answer" (kimi 1,048,576, deepseek-v4-pro 393,216, hy4 and
|
|
245
|
+
hy4-flash 65,536, qwen3.8-max 131,072, qwen4-max 131,072) — pi-ai clamps the
|
|
246
|
+
outgoing budget to the context room (`clampMaxTokensToContext`), so a large
|
|
247
|
+
documented ceiling never becomes an over-context request; input from the
|
|
248
|
+
card (`deepseek-v4-pro` is text-only); reasoning true; cost 0 (maintainer
|
|
249
|
+
decision). `qwen4-max` and `hy4-flash` are the two ids the catalog never had
|
|
250
|
+
— models.dev provider `nan` lists neither, so they enter through
|
|
251
|
+
`MANUAL_ONLY_MODEL_IDS`; the other four are models.dev entries corrected by
|
|
252
|
+
the overrides. Reasoning: the docs keep `kimi-k3.1-pro` and
|
|
253
|
+
`deepseek-v4-pro` out of the contract and state their `none` aliases are NOT
|
|
254
|
+
mapped, so they declare no effort values and no `thinkingLevelMap`;
|
|
255
|
+
`qwen3.8-max` gets `maxTokensField: "max_completion_tokens"` because its
|
|
256
|
+
`max_tokens` bounds only the visible answer (issue #34's quota failure
|
|
257
|
+
mode); `qwen4-max`, `qwen3.8-flash`, `hy4`, `hy4-flash` and `qwen3.8-max`
|
|
258
|
+
map `off` to `none`; `hy4` reasons by default with the gateway applying
|
|
259
|
+
`low` when no level is sent.
|
|
260
|
+
When the docs or models.dev change, re-verify the values (docs win; a
|
|
261
|
+
measurement wins over the docs).
|
|
248
262
|
Removed by the provider: `glm5.2` (2026-09-05) and `mimo-v2.5` (checked
|
|
249
263
|
2026-09-29 — zero mentions in the docs and in openapi.json, and models.dev
|
|
250
264
|
dropped it too; superseded by `mimo-v2.6-flash`). models.dev may re-list a
|
|
@@ -290,7 +304,16 @@ Since 1.0.0 the package version **aligns its MAJOR.MINOR with the pi release lin
|
|
|
290
304
|
`test/issue-2-truncated-stream.test.ts`, `test/issue-4-token-usage.test.ts`,
|
|
291
305
|
`test/issue-7-streaming-usage-default.test.ts`;
|
|
292
306
|
issues #2, #4 and #7.
|
|
293
|
-
- **
|
|
307
|
+
- **The catalog declares `thinkingLevelMap` for reasoning suppression** (issue #16, measured 2026-09-27 against live gateway, repro script in the issue; extended 2026-11-17 from the docs for every model they now document). `deepseek-v4-flash` → `{ off: "none" }` (0 reasoning tokens, reproducible); `glm5.3-flash` and `glm5.3` → `{ off: "minimal" }` (38 reasoning tokens + answer; `none` does NOT work on glm5.3-flash — 13,382 tokens — and the docs state GLM always reasons, so `none` is applied as `minimal`); `qwen3.6`, `gemma4`, `qwen3.8-flash`, `qwen4-max`, `qwen3.8-max`, `hy4`, `hy4-flash` → `{ off: "none" }` (the NaN docs state that with no parameter these models reason by default and that `none` turns reasoning off — https://nan.builders/docs/models#controlling-reasoning, checked 2026-11-17 — so `off` must send `none` explicitly). `kimi-k3.1-pro` and `deepseek-v4-pro` declare NO map: the docs keep them out of the reasoning contract and state their `none` aliases are not mapped, so `off` sends nothing and the model decides. pi-ai's `buildRequest` maps `reasoning: "off"` → `reasoningEffort: undefined` → fires the off-branch that checks `model.thinkingLevelMap?.off` (verified in pi-ai 1.5.1, `api/openai-completions.js` ~line 715). `reasoningEffortValues` is catalog documentation only — pi and pi-ai never read it (`rg reasoningEffortValues node_modules/@earendil-works` → no match on 1.5.1) — and it now lives in ONE place, each model's `MANUAL_OVERRIDES` entry, with no fallback map in the generator. Ladders follow the docs: `deepseek-v4-flash` `none`+minimal…max (the measured fact that only `none` *suppresses* is unchanged and still drives its off map), `mimo-v2.6-flash` `none`/low…max (`minimal` is applied as `low`, `xhigh` as `max`), GLM and the two new models include `xhigh`. `xhigh` and `max` are opt-in in pi-ai: `getSupportedThinkingLevels` only lists them when the map carries a non-null entry for that level, and `clampThinkingLevel` silently degrades a request for either one to `high` otherwise (pi-ai 1.5.1 `dist/models.js:701-713`; its README says both "are opt-in and require a non-null map entry"). NaN accepts both, so every model whose docs declare a ladder up to `max` now carries identity entries `{ xhigh: "xhigh", max: "max" }` — `deepseek-v4-flash`, `gemma4`, `qwen3.6`, `glm5.3`, `glm5.3-flash`, `qwen3.8-flash`, `qwen4-max`, `mimo-v2.6-flash` (the gateway applies `xhigh` as `max` there) — while `hy4`, `hy4-flash` and `qwen3.8-max` (docs document only the off switch) and `kimi-k3.1-pro`/`deepseek-v4-pro` (outside the contract) keep `off` alone and stay at `off`…`high`. Verified end to end: before the entries a `max` request reached the gateway as `reasoning_effort: "high"`; now it reaches it as `"max"`. The README limits table records which models' `maxTokens` DOES bound reasoning plus answer (`qwen4-max`, `hy4`, `hy4-flash`, `mimo-v2.6-flash` per the 2026-11-17 docs) versus the measured case where it does not (max_tokens=512 on deepseek-v4-flash still yielded 13,376 reasoning tokens).
|
|
308
|
+
- **Catalog cost is pinned to 0** (generator constant `NAN_CATALOG_COST`, recorded
|
|
309
|
+
in `GENERATED_CATALOG_META.notes`). NaN bills a credit pool (1 credit ≈ 0.026 €),
|
|
310
|
+
not per-token USD, so pi's per-token cost estimate has nothing to report. models.dev
|
|
311
|
+
provider `nan` started publishing a DERIVED USD conversion on 2026-11-17
|
|
312
|
+
(deepseek-v4-flash 0.29484 / 1.17936, glm5.3 1.37592 / 4.32432, …), which is not a
|
|
313
|
+
price NaN charges; adopting it would make pi display that estimate as real money.
|
|
314
|
+
A model with a confirmed per-token price can still override `cost` through
|
|
315
|
+
`MANUAL_OVERRIDES`; to adopt models.dev's numbers everywhere, delete the constant.
|
|
316
|
+
Regression test: `test/larger-models-2026-11-17.test.ts`.
|
|
294
317
|
- A NaN request that still exceeds the destination model's context window (the
|
|
295
318
|
cross-model thinking guard is disabled with `NAN_THINKING_GUARD=0`, the
|
|
296
319
|
inflation is not a `thinking` block, or the window is smaller) gets NaN's
|
|
@@ -310,8 +333,8 @@ Since 1.0.0 the package version **aligns its MAJOR.MINOR with the pi release lin
|
|
|
310
333
|
- Since 0.10.0, this package uses native MCP via `pi.registerMcpServer()`.
|
|
311
334
|
The server is session-scoped, visible in `/mcp` with source "extension".
|
|
312
335
|
Server names and tool IDs:
|
|
313
|
-
- `nan-media` → tools: `mcp__nan_media__generate_image/edit_image/text_to_speech/list_voices/speech_to_text/list_models/embed_text/rerank_documents/get_quota`
|
|
314
|
-
(community stdio, `npx -y nan-mcp-server@1.
|
|
336
|
+
- `nan-media` → tools: `mcp__nan_media__generate_image/edit_image/text_to_speech/list_voices/speech_to_text/list_models/embed_text/rerank_documents/get_quota/get_usage`
|
|
337
|
+
(community stdio, `npx -y nan-mcp-server@1.5.0`, 120s timeout; 10 tools as of 1.5.0)
|
|
315
338
|
- `exposure: "direct"` — tools are declared to the model.
|
|
316
339
|
- User `mcp.json` entries with the same name take precedence.
|
|
317
340
|
- `/nan-mcp enable/disable` calls `pi.registerMcpServer()` / `pi.unregisterMcpServer()` directly.
|
|
@@ -336,10 +359,18 @@ Since 1.0.0 the package version **aligns its MAJOR.MINOR with the pi release lin
|
|
|
336
359
|
key, shared rate limit/quota). Spec: https://nan.builders/openapi.json
|
|
337
360
|
(tag "MCP"). **Currently exposes no tools** (see the removal note above).
|
|
338
361
|
- Community `nan-mcp-server` (https://github.com/luciferfran/nan-mcp-server):
|
|
339
|
-
stdio MCP server, version-pinned via NAN_MEDIA_MCP_VERSION (default 1.
|
|
340
|
-
or full command override via NAN_MEDIA_MCP_COMMAND. Tools (1.
|
|
362
|
+
stdio MCP server, version-pinned via NAN_MEDIA_MCP_VERSION (default 1.5.0)
|
|
363
|
+
or full command override via NAN_MEDIA_MCP_COMMAND. Tools (1.5.0): generate_image,
|
|
341
364
|
edit_image, text_to_speech, list_voices, speech_to_text, list_models, embed_text,
|
|
342
|
-
rerank_documents, get_quota.
|
|
365
|
+
rerank_documents, get_quota, get_usage.
|
|
366
|
+
The pin moved `1.3.0 → 1.5.0` in package 1.5.5 (issue #40, auto-created by the
|
|
367
|
+
weekly check; verdict safe, no tracked tool dropped). Upstream `1.4.0` added
|
|
368
|
+
`qwen-image-2.1` image support (no package change: the native image model
|
|
369
|
+
already exists in `src/images.ts`); `1.5.0` added `get_usage` — real
|
|
370
|
+
consumption and the credit pool from `GET /v1/usage`, recommended over the
|
|
371
|
+
legacy `get_quota` whose counters can be frozen (stale lines are flagged) —
|
|
372
|
+
and native registration exposes it automatically, so it is documented, not
|
|
373
|
+
bridged per-tool (verified on the published `server.js`, 2026-11-16).
|
|
343
374
|
- Automated check (scripts/check-nan-mcp-server.ts) compares the npm registry
|
|
344
375
|
against the pin weekly and files a `dependencies` issue when a newer release
|
|
345
376
|
exists, with a breaking/safe verdict from the live server tool surface.
|
package/README.es.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @gtrabanco/𝜋-nan-provider
|
|
2
2
|
|
|
3
3
|
[](https://opensource.org/licenses/MIT)
|
|
4
|
-
[](https://github.com/gtrabanco/pi-nan-provider/releases)
|
|
5
5
|
[](https://cloud.nan.builders/r/7GK06FX8)
|
|
6
6
|
|
|
7
7
|
[NaN Builders](https://cloud.nan.builders/r/7GK06FX8) model provider + MCP nativo para [pi](https://github.com/earendil-works/pi).
|
|
@@ -25,8 +25,8 @@ Registra el proveedor `nan` vía `pi.registerProvider()` usando la API OpenAI-co
|
|
|
25
25
|
| **Controles de razonamiento** | `reasoningEffortValues` + `thinkingLevelMap` por modelo ([#16](https://github.com/gtrabanco/pi-nan-provider/issues/16)), el guard de stream solo-razonamiento ([#21](https://github.com/gtrabanco/pi-nan-provider/issues/21)) y el límite provisional `max_completion_tokens` para `qwen3.8-flash` ([#34](https://github.com/gtrabanco/pi-nan-provider/issues/34)). |
|
|
26
26
|
| **Cabecera de atribución** | `X-Pi-Provider: gtrabanco/pi-nan-provider@<version>` en cada petición, eliminada cuando la telemetría de instalación de pi está desactivada. |
|
|
27
27
|
| **Modelos de imagen nativos** | `flux-2-klein` y `qwen-image-2.1` registrados como modelos de pi `type: "image"`, accesibles desde codemode y extensiones. |
|
|
28
|
-
| **Puente MCP nativo de media** | El servidor `nan-media` (
|
|
29
|
-
| **Informe de
|
|
28
|
+
| **Puente MCP nativo de media** | El servidor `nan-media` (10 herramientas) registrado con `pi.registerMcpServer()`, gestionado con `/nan-mcp`. |
|
|
29
|
+
| **Informe de créditos** | `/nan-usage` muestra saldo de créditos con barra de progreso, desglose por modelo (input / cached / output en M, créditos consumidos) y periodo de facturación — todo desde `GET /v1/usage` ([#37](https://github.com/gtrabanco/pi-nan-provider/issues/37)). |
|
|
30
30
|
| **Evidencia de anomalías de caché** | Captura de `cf-ray` sobre la firma repetida `id` + `created` del gateway ([#17](https://github.com/gtrabanco/pi-nan-provider/issues/17)) más el recolector determinista `/nan-debug` ([#35](https://github.com/gtrabanco/pi-nan-provider/issues/35)). |
|
|
31
31
|
| **Integración con pi** | Refresco de modelos dirigido por el runtime Models de pi, overrides por modelo en `models.json` y el changelog de la extensión (`pi.changelogPath`) que pi muestra tras una actualización. |
|
|
32
32
|
|
|
@@ -35,7 +35,7 @@ Comandos:
|
|
|
35
35
|
| Comando | Propósito |
|
|
36
36
|
| :--- | :--- |
|
|
37
37
|
| `/nan-mcp` | Gestionar el puente MCP de media (`status` / `enable` / `disable`) |
|
|
38
|
-
| `/nan-usage [1-90]` |
|
|
38
|
+
| `/nan-usage [1-90]` | Saldo de créditos con barra de uso, desglose por modelo (in / cached / out en M · créditos cr) y totales históricos |
|
|
39
39
|
| `/nan-debug [tema] [--window N] [--out ruta] [--emit]` | Paquete de evidencia reproducible y redactado para NaN |
|
|
40
40
|
|
|
41
41
|
---
|
|
@@ -261,6 +261,7 @@ conector con `pi config` → Built-in extensions → `mcp`.
|
|
|
261
261
|
| `mcp__nan_media__embed_text` | Embeddings de texto (qwen3-embedding) |
|
|
262
262
|
| `mcp__nan_media__rerank_documents` | Reordenación de documentos (Qwen3-Reranker) |
|
|
263
263
|
| `mcp__nan_media__get_quota` | Cuota de tokens por modelo (usado / tope / restante / reinicio) |
|
|
264
|
+
| `mcp__nan_media__get_usage` | Consumo real y bolsa de créditos (`GET /v1/usage`; preferido frente a los contadores obsoletos de `get_quota`) |
|
|
264
265
|
|
|
265
266
|
> pi 0.99.0–0.99.1 usaba la forma con guiones (`mcp__nan-media__*`); pi 0.99.2+ sanitiza los
|
|
266
267
|
> nombres de herramientas a solo `[A-Za-z0-9_]`, así que los guiones se convirtieron en guiones
|
|
@@ -271,7 +272,7 @@ conector con `pi config` → Built-in extensions → `mcp`.
|
|
|
271
272
|
| Variable | Por defecto | Descripción |
|
|
272
273
|
| :--- | :--- | :--- |
|
|
273
274
|
| `NAN_MEDIA_MCP` | — | Override por sesión (`0` o `false` para desactivar). |
|
|
274
|
-
| `NAN_MEDIA_MCP_VERSION` | `1.
|
|
275
|
+
| `NAN_MEDIA_MCP_VERSION` | `1.5.0` | Versión del servidor fijada (recomendado). |
|
|
275
276
|
| `NAN_MEDIA_MCP_COMMAND` | — | Override del comando personalizado. |
|
|
276
277
|
| `NAN_MEDIA_MCP_TIMEOUT_MS` | `120000` | Timeout por llamada. |
|
|
277
278
|
|
|
@@ -293,22 +294,22 @@ también están automatizadas: el workflow semanal `check-pi-sdk-versions` abre
|
|
|
293
294
|
|
|
294
295
|
---
|
|
295
296
|
|
|
296
|
-
## 📊
|
|
297
|
+
## 📊 Créditos: `/nan-usage`
|
|
297
298
|
|
|
298
|
-
Muestra tu
|
|
299
|
+
Muestra tu saldo de créditos NaN con una barra de progreso, desglose por modelo (input / cached / output en millones, créditos consumidos), periodo de facturación y totales históricos.
|
|
299
300
|
|
|
300
301
|
### Cómo funciona
|
|
301
302
|
|
|
302
303
|
`/nan-usage` llama al endpoint [`GET /v1/usage`](https://nan.builders/docs/api#tag/usage) de NaN con **la misma API key que ya usas para chat** — la credencial guardada en pi (`/login nan`) o `NAN_API_KEY`. Sin login de la CLI, sin cookie de sesión, sin configuración extra.
|
|
303
304
|
|
|
304
|
-
El endpoint devuelve tu
|
|
305
|
+
El endpoint devuelve tu consumo (filas por fecha y modelo) más los totales que cubren la ventana solicitada — máx. 90 días inclusivos. El comando lee esos totales y los muestra en un layout centrado en créditos: la barra principal refleja créditos consumidos vs. el allowance de tu plan, y cada fila de modelo muestra tokens (in / cached / out) y los créditos que costó.
|
|
305
306
|
|
|
306
|
-
Límite de
|
|
307
|
+
Límite de velocidad: 30 peticiones por minuto para `/usage`, separado de los endpoints de modelos.
|
|
307
308
|
|
|
308
309
|
### Uso
|
|
309
310
|
|
|
310
311
|
```
|
|
311
|
-
/nan-usage # mes
|
|
312
|
+
/nan-usage # mes actual en UTC (coincide con el periodo de facturación)
|
|
312
313
|
/nan-usage 7 # ventana móvil de 7 días (1-90)
|
|
313
314
|
/nan-usage 30 # ventana móvil de 30 días
|
|
314
315
|
/nan-usage help # muestra la línea de uso
|
|
@@ -320,7 +321,7 @@ Límite de tasa: 30 peticiones por minuto para `/usage`, separado del de los end
|
|
|
320
321
|
```
|
|
321
322
|
/login nan
|
|
322
323
|
```
|
|
323
|
-
o
|
|
324
|
+
o exportala en su lugar:
|
|
324
325
|
```bash
|
|
325
326
|
export NAN_API_KEY=sk-...
|
|
326
327
|
```
|
|
@@ -330,42 +331,37 @@ Límite de tasa: 30 peticiones por minuto para `/usage`, separado del de los end
|
|
|
330
331
|
```
|
|
331
332
|
|
|
332
333
|
> [!TIP]
|
|
333
|
-
> ¿No se resuelve
|
|
334
|
+
> ¿No se resuelve clave API? El comando vuelve a la tabla de cuotas estática de los docs y te indica cómo autenticarte.
|
|
334
335
|
|
|
335
|
-
###
|
|
336
|
+
### Qué ves
|
|
336
337
|
|
|
337
|
-
**Con API
|
|
338
|
+
**Con clave API** (uso real):
|
|
338
339
|
```
|
|
339
|
-
|
|
340
|
+
💳 Créditos
|
|
341
|
+
[████████░░░░░░░░░░░░] 13.4% usado · 936.7 / 7000 (6063.3 restantes)
|
|
342
|
+
Periodo: 2026-11-02 → 2026-12-02 UTC
|
|
340
343
|
|
|
341
|
-
|
|
344
|
+
⏱️ Próximo reset: 2026-12-02 UTC (20d 16h 0m 0s)
|
|
342
345
|
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
MiMo V2.5:
|
|
352
|
-
[███░░░░░░░░░░░░░░░░░] 12.5% of monthly cap
|
|
353
|
-
Used: 125.0M / 1.0B (875.0M remaining) · 840 requests
|
|
354
|
-
|
|
355
|
-
GLM 5.3:
|
|
356
|
-
[████████░░░░░░░░░░░░] 40.0% of monthly cap
|
|
357
|
-
Used: 1.2B / 3.0B (1.8B remaining) · 2,400 requests
|
|
358
|
-
↳ rolling window: 400.0M / 4h (daily granularity — /usage cannot break it down)
|
|
359
|
-
|
|
360
|
-
Uncapped models:
|
|
346
|
+
⚡ Uso
|
|
347
|
+
deepseek-v4-flash · 2701.1M in / 450.9M cached / 8.8M out · 189.7 (cr)
|
|
348
|
+
glm5.3-flash · 1619.6M in / 20.9M cached / 7.2M out · 621.4 (cr)
|
|
349
|
+
qwen3.6 · 1123.9M in / 37.1M cached / 3.3M out · 0 (cr)
|
|
350
|
+
mimo-v2.6-flash · 368.4M in / 67.4M cached / 3.3M out · 104.3 (cr)
|
|
351
|
+
qwen3.8-flash · 286.4M in / 0.0M cached / 1.3M out · 21.3 (cr)
|
|
352
|
+
qwen3-embedding · 4.6M in / 0.0M cached / 0.0M out · 0 (cr)
|
|
353
|
+
gemma4 · 1.0M in / 0.0M cached / 0.0M out · 0 (cr)
|
|
361
354
|
|
|
362
|
-
|
|
355
|
+
Créditos totales consumidos: 936.7 (cr)
|
|
363
356
|
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
💡 Source: GET /v1/usage · caps from https://nan.builders/docs/models
|
|
357
|
+
Histórico: 30.9B tokens · 125,915 requests (actualizado 2026-11-12)
|
|
358
|
+
💡 Fuente: GET /v1/usage
|
|
367
359
|
```
|
|
368
360
|
|
|
361
|
+
- **💳 Créditos**: barra de progreso con `% usado · used / allowance (remaining)`, fechas del periodo de facturación, créditos de pack con expiración si aplica, advertencia si la cuenta está congelada.
|
|
362
|
+
- **⚡ Uso**: modelos ordenados por créditos consumidos (métrica primaria de facturación), cada fila: `model · X.XM in / YM cached / Z.ZM out · W (cr)`.
|
|
363
|
+
- **Histórico**: totales de vida útil con la última marca de caché.
|
|
364
|
+
|
|
369
365
|
**Sin API key** (solo límites estáticos):
|
|
370
366
|
```
|
|
371
367
|
📊 NaN Quota Status (static limits)
|
|
@@ -446,17 +442,23 @@ Modelos de chat:
|
|
|
446
442
|
| `mimo-v2.6-flash` | 1,048,576 | 131,072 | texto, imagen | ✅ |
|
|
447
443
|
| `glm5.3-flash` | 1,048,576 | 131,072 | texto, imagen | ✅ |
|
|
448
444
|
| `qwen3.8-flash` | 1,048,576 | 131,072 | texto, imagen | ✅ |
|
|
449
|
-
| `glm5.3` | 1,048,576 | 131,072 | texto
|
|
450
|
-
| `
|
|
451
|
-
| `
|
|
452
|
-
| `
|
|
453
|
-
| `
|
|
454
|
-
|
|
455
|
-
|
|
445
|
+
| `glm5.3` | 1,048,576 | 131,072 | texto | ✅ |
|
|
446
|
+
| `hy4-flash` | 1,048,576 | 65,536 | texto, imagen | ✅ |
|
|
447
|
+
| `hy4` | 1,048,576 | 65,536 | texto, imagen | ✅ |
|
|
448
|
+
| `kimi-k3.1-pro` | 1,048,576 | 1,048,576 | texto, imagen | ✅ |
|
|
449
|
+
| `qwen3.8-max` | 1,000,000 | 131,072 | texto, imagen | ✅ |
|
|
450
|
+
| `qwen4-max` | 1,000,000 | 131,072 | texto, imagen | ✅ |
|
|
451
|
+
| `deepseek-v4-pro` | 1,048,576 | 393,216 | texto | ✅ |
|
|
452
|
+
|
|
453
|
+
> Las ventanas de contexto y la salida máxima de la tabla son los valores **documentados** en [los docs de NaN](https://nan.builders/docs/models) (comprobado 2026-11-17), que son la fuente de verdad; models.dev es un espejo que un humano actualiza más tarde y puede ir por detrás. `glm5.3` fue solo-premium y solo-en-vivo hasta que NaN eliminó los modelos exclusivos por tier el 2026-11-10; ahora está en el catálogo estático, **solo texto** (una imagen, audio, vídeo o fichero — o un turno anterior que lleve uno — responde `400`, así que empieza sesión nueva o cambia de modelo).
|
|
454
|
+
>
|
|
455
|
+
> Los **modelos grandes** — `kimi-k3.1-pro`, `qwen3.8-max`, `qwen4-max`, `deepseek-v4-pro`, `hy4`, `hy4-flash` — son los que NaN factura como "larger model" (gastan créditos más rápido). Los cuatro que entraron en el catálogo el 2026-11-10 llevaban una salida máxima plana de 32,768 y ningún mapeo de razonamiento porque los docs aún no los documentaban; desde el 2026-11-17 cada uno declara su propio "Max answer" y su comportamiento de razonamiento documentado. `qwen4-max` y `hy4-flash` son ids nuevos que el catálogo no tenía (models.dev, proveedor `nan`, no lista ninguno de los dos; el `/models` en vivo y los docs sí). La salida máxima es un techo, no una petición: pi-ai recorta el presupuesto saliente al hueco que queda en la ventana de contexto (`clampMaxTokensToContext`), así que un techo de 1M tokens en `kimi-k3.1-pro` nunca se convierte en un `max_tokens` fuera de contexto.
|
|
456
456
|
>
|
|
457
|
-
> `
|
|
457
|
+
> `qwen3.8-max` envía `max_completion_tokens` en vez de `max_tokens`, y `qwen3.8-flash` hace lo mismo: en esos dos los docs dicen que `max_tokens` solo limita la respuesta visible y el razonamiento se factura por encima, así que el presupuesto del cliente debe cubrir el total (issue #34).
|
|
458
458
|
>
|
|
459
|
-
>
|
|
459
|
+
> Todos los modelos del catálogo reportan **coste 0**: NaN factura un pool de créditos (1 crédito ≈ 0,026 €), no USD por token, así que la estimación de coste de pi no tiene nada que reportar. models.dev, proveedor `nan`, empezó a publicar una conversión derivada a USD el 2026-11-17; el catálogo no la adopta, porque pi la mostraría como dinero real. Usa `/nan-usage` para el consumo real.
|
|
460
|
+
>
|
|
461
|
+
> `*` El límite de salida de 32,768 en `deepseek-v4-flash` es el techo de los docs oficiales de NaN para pi (https://nan.builders/docs/pi, "the same set the NaN CLI writes", issue #20, 2026-10-02); models.dev lista 384,000, pero la pasarela rechaza `max_tokens` por encima de ~256k con 403. `gemma4` se queda con los 32,768 de models.dev: los 65,536 de los bloques de pi/OpenCode están descritos ahí como "a client-side budget rather than a server cap", así que se mantiene el valor menor en vez de arriesgar un `400`.
|
|
460
462
|
|
|
461
463
|
> [!NOTE]
|
|
462
464
|
> **Techo práctico con caché de prompt fría (issue #18).** Las ventanas de contexto de la tabla son las ventanas reales de los modelos, pero el borde de api.nan.builders (Cloudflare) aborta las respuestas que superan su Proxy Read Timeout de 120 s. Medido con peticiones frías directas (relleno único, sin caché de prompt; 2026-10-01): 208.036 tokens (~960 KB de cuerpo) respondió en 12,9 s mientras que ~220k y ~286k tokens devolvieron **HTTP 524 `origin_response_timeout`** a los ~126 s; los mismos tamaños con caché cálida responden en ~10 s. El techo práctico para peticiones frías queda por tanto muy por debajo de las ventanas declaradas. Desde 1.0.0 el provider reclasifica un 524 en una petición estimada por encima de 200.000 tokens (`NAN_COLD_CACHE_CEILING_TOKENS`) como desbordamiento de contexto para que pi compacte y reintente en vez de quedarse colgado; un 524 en una petición menor se deja intacto (timeout transitorio genuino).
|
|
@@ -484,16 +486,22 @@ El parámetro `reasoning_effort` de NaN controla cuánto piensa el modelo antes
|
|
|
484
486
|
|
|
485
487
|
| Modelo | Effort de razonamiento | Cómo funciona |
|
|
486
488
|
| :--- | :--- | :--- |
|
|
487
|
-
| `glm5.3` | `low` · `medium` · `high` · `max` |
|
|
488
|
-
| `
|
|
489
|
-
| `
|
|
490
|
-
| `
|
|
491
|
-
| `
|
|
492
|
-
| `
|
|
493
|
-
| `
|
|
489
|
+
| `glm5.3`, `glm5.3-flash` | `minimal` · `low` · `medium` · `high` · `xhigh` · `max` | GLM no puede parar de razonar: los docs aplican `none` como `minimal`, su razonamiento más corto (unos pocos tokens), así que `thinking: "off"` envía `minimal` vía el `thinkingLevelMap` del catálogo. Valores más altos razonan más antes de responder. `glm5.3-flash` se midió en ~38 tokens de razonamiento con `minimal` (issue #16, 2026-09-27); `none` no lo suprime |
|
|
490
|
+
| `qwen3.6`, `gemma4` | `none` · `minimal` · `low` · `medium` · `high` · `xhigh` · `max` | `none`/`minimal` omiten el razonamiento por completo; el resto limita la fase de razonamiento a 2K / 8K / 16K / 32K tokens. `thinking: "off"` envía `reasoning_effort: "none"` automáticamente vía el `thinkingLevelMap` del catálogo — los docs de NaN dicen que sin parámetro estos modelos razonan por defecto (presupuesto de 16,384 tokens), así que `off` debe ser explícito |
|
|
491
|
+
| `deepseek-v4-flash` | `none` · `minimal` · `low` · `medium` · `high` · `xhigh` · `max` | `none` deshabilita el razonamiento (0 tokens de razonamiento, respuesta completa); cualquier otro valor solo lo dirige — medido: 57 tokens de razonamiento con `low`, 63 omitiendo el parámetro y 109 con `minimal` (issue #16, re-sondado en vivo 2026-10-14). `thinking: "off"` envía `reasoning_effort: "none"` vía el `thinkingLevelMap` del catálogo — sin él el modelo se descontrola hasta `finish_reason: "length"` sin respuesta |
|
|
492
|
+
| `qwen3.8-flash` | `none` · `minimal` · `low` · `medium` · `high` · `xhigh` · `max` | El razonamiento está encendido por defecto (`none` lo apaga, el resto dirige su profundidad). `thinking: "off"` envía `reasoning_effort: "none"`; su presupuesto se limita con `max_completion_tokens` (issue #34), y hay un tope duro de razonamiento vía `thinking_budget` |
|
|
493
|
+
| `qwen4-max` | `none` · `minimal` · `low` · `medium` · `high` · `xhigh` · `max` | `none` apaga el razonamiento, `minimal` a `max` lo dirigen, y `max_tokens` limita razonamiento **más** respuesta. Los docs recomiendan fijar un presupuesto: una respuesta abierta puede tardar muchos minutos |
|
|
494
|
+
| `mimo-v2.6-flash` | `none` · `low` · `medium` · `high` · `max` | `none` apaga el razonamiento (`minimal` se aplica como `low` y `xhigh` como `max`, así que esos dos no se declaran aparte); el razonamiento cuenta dentro de `max_tokens`. Medido en vivo 2026-10-14: `none` da 0 tokens de razonamiento con respuesta completa |
|
|
495
|
+
| `qwen3.8-max` | `none` | `none` apaga el razonamiento. `max_tokens` solo limita la respuesta visible, así que el catálogo envía `max_completion_tokens` para cubrir el total. Un presupuesto de razonamiento (`thinking_budget`) no se respeta en este modelo |
|
|
496
|
+
| `hy4` | `none` | Razona por defecto — la pasarela aplica `low` cuando la petición no nombra ningún nivel, y tu valor siempre gana. `none` lo apaga. `max_tokens` limita razonamiento más respuesta |
|
|
497
|
+
| `hy4-flash` | `none` | Razona por defecto sin nivel por defecto; `reasoning_effort: "none"` lo apaga (ignora `enable_thinking`). `max_tokens` limita razonamiento más respuesta, así que uno pequeño puede volver vacío |
|
|
498
|
+
| `kimi-k3.1-pro`, `deepseek-v4-pro` | *(sin mapeo declarado)* | Los docs dejan a estos dos fuera del contrato de razonamiento y dicen que los alias de `none` **no están mapeados** en ellos, así que el catálogo no declara valores de effort ni `thinkingLevelMap`: `thinking: "off"` no envía ningún parámetro y decide el modelo |
|
|
499
|
+
|
|
500
|
+
> [!NOTE]
|
|
501
|
+
> **`xhigh` y `max` son opt-in en pi.** pi-ai solo ofrece esos dos niveles a un modelo cuando su `thinkingLevelMap` los declara (`getSupportedThinkingLevels`; si no, una petición de cualquiera de los dos se degrada en silencio a `high`). Por eso el catálogo lleva entradas de identidad (`xhigh: "xhigh"`, `max: "max"`) en todos los modelos cuya doc declara una escalera hasta `max` — los siete modelos de chat más `mimo-v2.6-flash`, donde la pasarela aplica `xhigh` como `max`. `hy4`, `hy4-flash` y `qwen3.8-max` solo documentan su interruptor de apagado, y `kimi-k3.1-pro`/`deepseek-v4-pro` están fuera del contrato, así que esos cinco se quedan en `off`…`high`.
|
|
494
502
|
|
|
495
503
|
> [!NOTE]
|
|
496
|
-
> `maxTokens` NO limita la fase de razonamiento en
|
|
504
|
+
> `maxTokens` NO limita la fase de razonamiento en `deepseek-v4-flash`, `glm5.3`, `glm5.3-flash`, `qwen3.8-flash`, `mimo-v2.6-flash`, `qwen3.8-max` ni `kimi-k3.1-pro`. La fase de razonamiento corre hasta completarse (o se corta en el límite de stream solo-razonamiento de NaN: 45.000 caracteres de razonamiento, o 420 s sin salida visible) independientemente del presupuesto — medido: `max_tokens=512` en deepseek-v4-flash aún consumió 13,376 tokens de completación, todos de razonamiento (26x el techo). Este es un comportamiento del gateway confirmado por el issue #16 (medido 2026-09-27) y por NaN para `qwen3.8-flash` (issue #34, 2026-11-11 — el exceso además factura contra la cuota). Los docs del 2026-11-17 añaden los modelos donde el presupuesto **sí** cubre el total, razonamiento más respuesta: `qwen4-max` (hasta 131.000), `hy4-flash` y `hy4` (hasta 64.000), y `mimo-v2.6-flash`. Como límite provisional para `qwen3.8-flash` **y `qwen3.8-max`** el catálogo envía `max_completion_tokens`, que NaN confirmó que SÍ se respeta; sobrevive porque la compat de esos modelos desactiva el renombrado a `max_tokens` del sanitizador de esquema (el OpenAPI publicado solo documenta `max_tokens`). Retira esos overrides cuando NaN publique el arreglo en su gateway — `test/issue-34-max-completion-tokens.test.ts` es el tripwire. Solo el razonamiento aún puede agotar el presupuesto completo y cerrar el turno con contenido vacío; ese corte lleva el marcador `reasoning_only_stream` de NaN y pi-ai reintenta el turno (issue #21).
|
|
497
505
|
|
|
498
506
|
## 🚀 Desarrollo
|
|
499
507
|
|