@gtrabanco/pi-nan-provider 1.5.5 → 1.5.7
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 +57 -28
- package/README.es.md +38 -23
- package/README.md +37 -22
- package/package.json +1 -1
- package/scripts/generate-models.ts +27 -37
- package/scripts/manual-overrides.ts +168 -121
- package/scripts/models.generated.ts +217 -68
- package/src/openai-compat-sanitizer.ts +10 -9
- package/src/provider-factory.ts +6 -4
|
@@ -15,7 +15,9 @@
|
|
|
15
15
|
* models.dev value in place.
|
|
16
16
|
*
|
|
17
17
|
* Fields override the models.dev-derived entry one-for-one:
|
|
18
|
-
* name, reasoning, input, cost, contextWindow, maxTokens
|
|
18
|
+
* name, reasoning, input, cost, contextWindow, maxTokens, reasoningEffortValues,
|
|
19
|
+
* thinkingLevelMap. `maxTokensField` is the exception: it lands on the entry's
|
|
20
|
+
* `compat` (see the field docs below).
|
|
19
21
|
*
|
|
20
22
|
* An override may also act as a pin — a value models.dev already agrees with,
|
|
21
23
|
* kept so an upstream regression cannot silently drop a confirmed capability.
|
|
@@ -61,51 +63,34 @@ export interface ManualModelOverride {
|
|
|
61
63
|
}
|
|
62
64
|
|
|
63
65
|
/**
|
|
64
|
-
*
|
|
65
|
-
* (
|
|
66
|
+
* Reasoning effort values are NOT a separate table: every model declares its own
|
|
67
|
+
* `reasoningEffortValues` (and `thinkingLevelMap`) inside MANUAL_OVERRIDES below,
|
|
68
|
+
* next to the provenance note that justifies the list. models.dev exposes no
|
|
69
|
+
* `reasoning_effort_values` field — only `reasoning_options` — so these lists
|
|
70
|
+
* are hand-maintained from https://nan.builders/docs/models#controlling-reasoning.
|
|
66
71
|
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
* from the docs. The values flow through MANUAL_OVERRIDES.reasoningEffortValues
|
|
70
|
-
* and appear in GeneratedModelEntry.reasoningEffortValues, where the pi
|
|
71
|
-
* model-selector can read them to show the correct granularity.
|
|
72
|
+
* One source only: `scripts/generate-models.ts` reads them from the override and
|
|
73
|
+
* has no fallback map of its own.
|
|
72
74
|
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* accepted and effective by the gateway.
|
|
80
|
-
* - qwen3.6, gemma4: none/minimal skip reasoning, others cap depth
|
|
81
|
-
* (2,048 / 8,192 / 16,384 / 32,768).
|
|
82
|
-
* - deepseek-v4-flash: `none` reproducibly disables reasoning (0 reasoning
|
|
83
|
-
* tokens, full answer); every other value — `minimal`, `low`, `high` and
|
|
84
|
-
* omitting the parameter — leaves it ON (issue #16, 2026-09-27,
|
|
85
|
-
* re-confirmed live 2026-10-14: none 0 / low 57 / omitted 63 reasoning
|
|
86
|
-
* tokens). The docs say "any value (no effect)"; the measurement wins, so
|
|
87
|
-
* the catalog declares only ["none"].
|
|
88
|
-
* - mimo-v2.6-flash: the docs list it as "accepted, depth not adjustable",
|
|
89
|
-
* but the live re-probe (2026-10-14) shows `none` → 0 reasoning tokens
|
|
90
|
-
* while `low` → 22 and omission → 17. Adjustable at the off end, so it
|
|
91
|
-
* carries `thinkingLevelMap { off: "none" }`.
|
|
92
|
-
* - qwen3.8-flash: the docs say "accepted, depth not adjustable"; the live
|
|
93
|
-
* probe measured 0 reasoning tokens for `none` (2026-10-14) but no other
|
|
94
|
-
* value was sampled, so no `thinkingLevelMap` is declared — the docs state
|
|
95
|
-
* its default is reasoning ON, so `off` sends nothing and the model decides.
|
|
75
|
+
* A model with `reasoningEffortValues: []` accepts the parameter but manages its
|
|
76
|
+
* own reasoning depth — it is never an error to send a value. `thinkingLevelMap.off`
|
|
77
|
+
* is the load-bearing field: pi maps `reasoning: "off"` to `reasoningEffort:
|
|
78
|
+
* undefined`, and pi-ai only emits `reasoning_effort` when that map supplies a
|
|
79
|
+
* value. The effort list itself is catalog documentation (pi and pi-ai do not
|
|
80
|
+
* read it; checked against pi-ai/pi 1.5.1).
|
|
96
81
|
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
*
|
|
101
|
-
*
|
|
82
|
+
* `xhigh` and `max` need an entry of their own. pi-ai treats both as OPT-IN:
|
|
83
|
+
* `getSupportedThinkingLevels()` only lists them when the map carries a non-null
|
|
84
|
+
* entry (pi-ai 1.5.1 `dist/models.js`, and its README: "`xhigh` and `max` are
|
|
85
|
+
* opt-in and require a non-null map entry"). Without it pi clamps a requested
|
|
86
|
+
* `max` down to `high` and the gateway never sees it, even though NaN accepts it.
|
|
87
|
+
* So every model whose docs declare a ladder up to `max` carries the identity
|
|
88
|
+
* entries `{ xhigh: "xhigh", max: "max" }`: the strings are what pi-ai would
|
|
89
|
+
* send anyway, so the map only widens what pi offers. Models whose docs document
|
|
90
|
+
* nothing but `none` plus a default (`hy4`, `hy4-flash`, `qwen3.8-max`) and the
|
|
91
|
+
* two outside the reasoning contract (`kimi-k3.1-pro`, `deepseek-v4-pro`) keep
|
|
92
|
+
* `off` alone and stay at `off`…`high`.
|
|
102
93
|
*/
|
|
103
|
-
export const REASONING_EFFORT_VALUES: Record<string, string[]> = {
|
|
104
|
-
"glm5.3": ["low", "medium", "high", "max"],
|
|
105
|
-
"glm5.3-flash": ["minimal", "low", "medium", "high", "max"],
|
|
106
|
-
"qwen3.6": ["none", "minimal", "low", "medium", "high", "max"],
|
|
107
|
-
"gemma4": ["none", "minimal", "low", "medium", "high", "max"],
|
|
108
|
-
};
|
|
109
94
|
|
|
110
95
|
/**
|
|
111
96
|
* Provenance for the manual-only mimo-v2.6-flash entry, shared by
|
|
@@ -116,42 +101,75 @@ const MANUAL_ONLY_NOTE =
|
|
|
116
101
|
"omnimodal model (text, image, audio input) served by NaN; limits and modalities from https://nan.builders/docs/models#mimo-v2-6-flash (checked 2026-09-25, quotas re-checked 2026-09-29): 1,048,576 context / 131,072 max output / 1.0B monthly quota per member. Tool calling: yes. Streaming: yes. Input modalities (pi-representable): text, image (audio not representable in pi's Model type). Fallback entry: emitted only while models.dev provider nan does not list the model — models.dev started listing it on 2026-09-29, so the generator then keeps the models.dev values and attaches this note to that entry instead of emitting a second one.";
|
|
117
102
|
|
|
118
103
|
/**
|
|
119
|
-
* NaN
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
* -
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
* -
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
104
|
+
* NaN's larger models (the NaN docs' own label). Four of them entered the
|
|
105
|
+
* catalog on 2026-11-10 as "external, undocumented" — ZDR models served
|
|
106
|
+
* through external providers — and `qwen4-max`/`hy4-flash` are newer still.
|
|
107
|
+
*
|
|
108
|
+
* https://nan.builders/docs/models now documents every one of them (checked
|
|
109
|
+
* 2026-11-17): context, "Max answer", input modalities and reasoning behaviour.
|
|
110
|
+
* models.dev provider `nan` lists the four from 2026-11-10 but neither
|
|
111
|
+
* `qwen4-max` nor `hy4-flash`, so the whole block keeps its entries: they are
|
|
112
|
+
* what makes these values survive a models.dev refresh, and the manual-only
|
|
113
|
+
* detail keeps the two undocumented ids in the catalog even though models.dev
|
|
114
|
+
* has no row for them at all.
|
|
115
|
+
*
|
|
116
|
+
* Values and their sources (docs win; models.dev first-party vendor entries
|
|
117
|
+
* only break ties the docs leave open — the 1M = 1,048,576 vs 1,000,000 one):
|
|
118
|
+
* - qwen4-max: 1M context (vendor 1,000,000), "Max answer 131K", text+image,
|
|
119
|
+
* `reasoning_effort` none…max with `none` off, `max_tokens` bounds the total.
|
|
120
|
+
* - hy4-flash: 1M context, "Max answer 64K", text+image, reasons by default with
|
|
121
|
+
* no default level, `none` turns it off, `max_tokens` bounds the total.
|
|
122
|
+
* - hy4: 1M context, "Max answer 64K", text+image, default level `low`,
|
|
123
|
+
* aliases mapped.
|
|
124
|
+
* - qwen3.8-max: 1M context (vendor 1,000,000), "Max answer 131K", text+image,
|
|
125
|
+
* `none` off, and `max_completion_tokens` caps the total while `max_tokens`
|
|
126
|
+
* bounds only the visible answer (issue #34's quota failure mode).
|
|
127
|
+
* - kimi-k3.1-pro: 1M context, "Max answer 1M", text+image, reasoning model
|
|
128
|
+
* with no documented level contract and aliases NOT mapped.
|
|
129
|
+
* - deepseek-v4-pro: 1M context, "Max answer 393K", text only, same caveat.
|
|
130
|
+
* - cost 0: maintainer decision (NaN bills credits, not per-token USD).
|
|
139
131
|
*/
|
|
140
|
-
const
|
|
141
|
-
"
|
|
132
|
+
const LARGER_MODEL_NOTE_SUFFIX =
|
|
133
|
+
" Cost 0 per maintainer decision (NaN bills credits, not per-token USD).";
|
|
142
134
|
|
|
143
|
-
const
|
|
135
|
+
const LARGER_MODELS: Record<string, ManualModelOverride> = {
|
|
136
|
+
"qwen4-max": {
|
|
137
|
+
name: "Qwen4 Max",
|
|
138
|
+
input: ["text", "image"],
|
|
139
|
+
reasoning: true,
|
|
140
|
+
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
|
141
|
+
contextWindow: 1_000_000,
|
|
142
|
+
maxTokens: 131_072,
|
|
143
|
+
reasoningEffortValues: ["none", "minimal", "low", "medium", "high", "xhigh", "max"],
|
|
144
|
+
thinkingLevelMap: { off: "none", xhigh: "xhigh", max: "max" },
|
|
145
|
+
note:
|
|
146
|
+
"Qwen4 Max, Alibaba's Qwen 4 flagship, documented in https://nan.builders/docs/models (checked 2026-11-17) and listed by the live GET https://api.nan.builders/v1/models (checked 2026-11-17); models.dev provider nan does not list it, so it enters as a manual-only entry. contextWindow 1,000,000: the card says '1M token context' and both first-party vendor entries on models.dev (vercel/alibaba/qwen4-max and openrouter/qwen/qwen4-max) say 1,000,000 — the smaller of that and NaN's 1M = 1,048,576 convention (https://nan.builders/docs/pi), the same rule qwen3.8-max follows. maxTokens 131,072: the card says 'Max answer 131K tokens' and the reasoning section says 'max_tokens bounds the total, reasoning plus answer, up to 131,000'. input text+image and reasoning true per the card. Reasoning: the card says 'reasoning_effort: none turns it off · minimal to max', and the reasoning section repeats that none turns it off on this model, so reasoningEffortValues declares the documented ladder and thinkingLevelMap { off: 'none' } supplies the off switch when pi maps reasoning:'off' to undefined." +
|
|
147
|
+
LARGER_MODEL_NOTE_SUFFIX,
|
|
148
|
+
},
|
|
149
|
+
"hy4-flash": {
|
|
150
|
+
name: "Hy4 Flash",
|
|
151
|
+
input: ["text", "image"],
|
|
152
|
+
reasoning: true,
|
|
153
|
+
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
|
154
|
+
contextWindow: 1_048_576,
|
|
155
|
+
maxTokens: 65_536,
|
|
156
|
+
reasoningEffortValues: ["none"],
|
|
157
|
+
thinkingLevelMap: { off: "none" },
|
|
158
|
+
note:
|
|
159
|
+
"Hy4 Flash, Tencent's fast Hunyuan 4, documented in https://nan.builders/docs/models (checked 2026-11-17) and listed by the live GET https://api.nan.builders/v1/models (checked 2026-11-17); models.dev provider nan does not list it, so it enters as a manual-only entry. contextWindow 1,048,576: the card says '1M token context' and NaN's 1M convention is 1,048,576 (https://nan.builders/docs/pi), which the first-party models.dev entry openrouter/tencent/hy4-flash also reports. maxTokens 65,536: the card says 'Max answer 64K tokens' (64K = 65,536), and its reasoning section says 'max_tokens bounds reasoning plus answer, up to 64,000', so the classic max_tokens field stays. input text+image and reasoning true per the card ('Tool calling and reasoning'). The docs keep this model out of the effort table ('Reasons by default, with no default level applied ... To turn reasoning off send reasoning_effort: none; the model ignores enable_thinking on its own'), so reasoningEffortValues declares only the documented off value and thinkingLevelMap { off: 'none' } puts it on the wire." +
|
|
160
|
+
LARGER_MODEL_NOTE_SUFFIX,
|
|
161
|
+
},
|
|
144
162
|
"kimi-k3.1-pro": {
|
|
145
163
|
name: "Kimi K3.1 Pro",
|
|
146
164
|
input: ["text", "image"],
|
|
147
165
|
reasoning: true,
|
|
148
166
|
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
|
149
167
|
contextWindow: 1_048_576,
|
|
150
|
-
maxTokens:
|
|
168
|
+
maxTokens: 1_048_576,
|
|
151
169
|
reasoningEffortValues: [],
|
|
152
170
|
note:
|
|
153
|
-
"
|
|
154
|
-
|
|
171
|
+
"Kimi K3.1 Pro, documented in https://nan.builders/docs/models (checked 2026-11-17; models.dev provider nan lists it since 2026-11-10). contextWindow 1,048,576 ('1M token context') and maxTokens 1,048,576 ('Max answer 1M tokens', which models.dev nan reports as limit.output) — pi-ai clamps the outgoing budget with clampMaxTokensToContext, so declaring the documented maximum never sends an over-context max_tokens. input text+image per the card. Reasoning: the card only says 'Reasoning model', and the docs keep this model out of the effort contract while stating that the `none` aliases are NOT mapped on it, so no reasoningEffortValues and no thinkingLevelMap are declared: pi sends no reasoning_effort and the model's own behaviour decides." +
|
|
172
|
+
LARGER_MODEL_NOTE_SUFFIX,
|
|
155
173
|
},
|
|
156
174
|
"qwen3.8-max": {
|
|
157
175
|
name: "Qwen3.8 Max",
|
|
@@ -159,11 +177,13 @@ const EXTERNAL_MODELS: Record<string, ManualModelOverride> = {
|
|
|
159
177
|
reasoning: true,
|
|
160
178
|
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
|
161
179
|
contextWindow: 1_000_000,
|
|
162
|
-
maxTokens:
|
|
163
|
-
|
|
180
|
+
maxTokens: 131_072,
|
|
181
|
+
maxTokensField: "max_completion_tokens",
|
|
182
|
+
reasoningEffortValues: ["none"],
|
|
183
|
+
thinkingLevelMap: { off: "none" },
|
|
164
184
|
note:
|
|
165
|
-
"
|
|
166
|
-
|
|
185
|
+
"Qwen3.8 Max, documented in https://nan.builders/docs/models (checked 2026-11-17; models.dev provider nan lists it since 2026-11-10). contextWindow 1,000,000: the card says '1M token context' and the first-party vendor value on models.dev provider alibaba (qwen3.8-max) is 1,000,000 — the smaller of that and NaN's 1M = 1,048,576 convention (https://nan.builders/docs/pi). maxTokens 131,072: the card says 'Max answer 131K tokens'. maxTokensField 'max_completion_tokens': the docs state that on this model 'max_tokens only bounds the visible answer: the reasoning comes on top of it. To cap the total (reasoning plus answer, and so the cost) use max_completion_tokens' — the quota blowout issue #34 fixed for qwen3.8-flash, same fix, same sanitizer exemption (SanitizerOptions.preserveMaxCompletionTokens, wired from compat.maxTokensField in src/provider-factory.ts). input text+image per the card. Reasoning: the docs say 'none turns it off' for this model, so reasoningEffortValues declares 'none' and thinkingLevelMap { off: 'none' } sends it when pi maps reasoning:'off' to undefined." +
|
|
186
|
+
LARGER_MODEL_NOTE_SUFFIX,
|
|
167
187
|
},
|
|
168
188
|
"deepseek-v4-pro": {
|
|
169
189
|
name: "DeepSeek V4-Pro (0813 version)",
|
|
@@ -171,11 +191,11 @@ const EXTERNAL_MODELS: Record<string, ManualModelOverride> = {
|
|
|
171
191
|
reasoning: true,
|
|
172
192
|
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
|
173
193
|
contextWindow: 1_048_576,
|
|
174
|
-
maxTokens:
|
|
194
|
+
maxTokens: 393_216,
|
|
175
195
|
reasoningEffortValues: [],
|
|
176
196
|
note:
|
|
177
|
-
"
|
|
178
|
-
|
|
197
|
+
"DeepSeek V4-Pro (0813 version), documented in https://nan.builders/docs/models (checked 2026-11-17; models.dev provider nan lists it since 2026-11-10). contextWindow 1,048,576 ('1M token context'). maxTokens 393,216: the card says 'Max answer 393K tokens', the same 393,216 the docs clamp deepseek-v4-flash to; models.dev nan reports 384,000, so the docs value wins (maintainer instruction: docs are the source of truth). input text only per the card ('text generation & chat · reasoning'). Reasoning: the card only says 'Reasoning model', and the docs state the `none` aliases are NOT mapped on this model, so no reasoningEffortValues and no thinkingLevelMap are declared." +
|
|
198
|
+
LARGER_MODEL_NOTE_SUFFIX,
|
|
179
199
|
},
|
|
180
200
|
hy4: {
|
|
181
201
|
name: "Hy4",
|
|
@@ -183,16 +203,17 @@ const EXTERNAL_MODELS: Record<string, ManualModelOverride> = {
|
|
|
183
203
|
reasoning: true,
|
|
184
204
|
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
|
185
205
|
contextWindow: 1_048_576,
|
|
186
|
-
maxTokens:
|
|
187
|
-
reasoningEffortValues: [],
|
|
206
|
+
maxTokens: 65_536,
|
|
207
|
+
reasoningEffortValues: ["none"],
|
|
208
|
+
thinkingLevelMap: { off: "none" },
|
|
188
209
|
note:
|
|
189
|
-
"
|
|
190
|
-
|
|
210
|
+
"Hy4, Tencent's Hunyuan 4, documented in https://nan.builders/docs/models (checked 2026-11-17; models.dev provider nan lists it since 2026-11-10). contextWindow 1,048,576 ('1M token context'). maxTokens 65,536: the card says 'Max answer 64K tokens' and models.dev provider nan reports the same 65,536, so it is no longer the flat 32,768 default. input text+image, reasoning true. Reasoning: the card says 'Reasons by default; if you send no reasoning_effort (nor an alias) we apply low, and your own value always wins', and the aliases ARE mapped on this model, so thinkingLevelMap { off: 'none' } supplies the documented off switch ('To turn reasoning off, send none ... it works on every model except GLM'). No other level is documented for it, so reasoningEffortValues declares only 'none'." +
|
|
211
|
+
LARGER_MODEL_NOTE_SUFFIX,
|
|
191
212
|
},
|
|
192
213
|
};
|
|
193
214
|
|
|
194
|
-
const
|
|
195
|
-
"NaN
|
|
215
|
+
const LARGER_MODEL_DETAIL =
|
|
216
|
+
"NaN larger model documented in https://nan.builders/docs/models (checked 2026-11-17) and listed by the live GET https://api.nan.builders/v1/models (checked 2026-11-17), but absent from models.dev provider nan";
|
|
196
217
|
|
|
197
218
|
/**
|
|
198
219
|
* Models NaN serves that models.dev provider nan may not list. Mirrors the
|
|
@@ -203,7 +224,7 @@ const EXTERNAL_MODEL_DETAIL =
|
|
|
203
224
|
*/
|
|
204
225
|
export const MANUAL_ONLY_MODEL_IDS: Record<string, string> = {
|
|
205
226
|
"mimo-v2.6-flash": MANUAL_ONLY_NOTE,
|
|
206
|
-
...Object.fromEntries(Object.keys(
|
|
227
|
+
...Object.fromEntries(Object.keys(LARGER_MODELS).map((id) => [id, LARGER_MODEL_DETAIL])),
|
|
207
228
|
};
|
|
208
229
|
|
|
209
230
|
/**
|
|
@@ -220,80 +241,106 @@ export const MANUAL_ONLY_MODELS: Record<string, ManualModelOverride> = {
|
|
|
220
241
|
maxTokens: 131_072,
|
|
221
242
|
note: MANUAL_ONLY_NOTE,
|
|
222
243
|
},
|
|
223
|
-
...
|
|
244
|
+
...LARGER_MODELS,
|
|
224
245
|
};
|
|
225
246
|
|
|
226
247
|
/**
|
|
227
248
|
* Manual overrides keyed by model id. Fields override the models.dev-derived
|
|
228
249
|
* entry one-for-one. Every override carries a provenance note.
|
|
229
250
|
*
|
|
230
|
-
*
|
|
231
|
-
*
|
|
232
|
-
*
|
|
233
|
-
*
|
|
234
|
-
*
|
|
235
|
-
*
|
|
236
|
-
*
|
|
237
|
-
* -
|
|
238
|
-
*
|
|
239
|
-
*
|
|
240
|
-
*
|
|
241
|
-
*
|
|
242
|
-
*
|
|
251
|
+
* Every model declares its own `reasoningEffortValues` here (models.dev has no
|
|
252
|
+
* such field), and the ones pi must be able to switch off also declare
|
|
253
|
+
* `thinkingLevelMap.off`: pi maps `reasoning: "off"` to `reasoningEffort:
|
|
254
|
+
* undefined` and pi-ai only emits `reasoning_effort` when that map supplies a
|
|
255
|
+
* value, so the map is what makes `thinking: off` reach the gateway.
|
|
256
|
+
*
|
|
257
|
+
* Per-model contract (https://nan.builders/docs/models#controlling-reasoning,
|
|
258
|
+
* checked 2026-11-17), with the 2026-09-27/2026-10-14 measurements recorded on
|
|
259
|
+
* the entries they still govern:
|
|
260
|
+
* - qwen3.6, gemma4: `none`/`minimal` skip reasoning, the rest cap the phase
|
|
261
|
+
* (2,048 / 8,192 / 16,384 / 32,768 tokens).
|
|
262
|
+
* - deepseek-v4-flash: `none` disables reasoning (measured: 0 reasoning
|
|
263
|
+
* tokens with a full answer), the rest only steer it (measured 57 / 63 / 109
|
|
264
|
+
* reasoning tokens for low / omitted / minimal).
|
|
265
|
+
* - mimo-v2.6-flash: `none` off; `minimal` is applied as `low`, `xhigh` as
|
|
266
|
+
* `max`.
|
|
267
|
+
* - glm5.3, glm5.3-flash: cannot stop reasoning; `none` is applied as
|
|
268
|
+
* `minimal`, which is what `off` maps to.
|
|
269
|
+
* - qwen3.8-flash, qwen4-max: `none` off (fully), `minimal`…`max` steer.
|
|
270
|
+
* - hy4: reasons by default, the gateway applies `low` when no level is sent;
|
|
271
|
+
* `none` off.
|
|
272
|
+
* - hy4-flash: reasons by default with no default level; `none` off.
|
|
273
|
+
* - qwen3.8-max: `none` off.
|
|
274
|
+
* - kimi-k3.1-pro, deepseek-v4-pro: the docs keep them out of the contract and
|
|
275
|
+
* the `none` aliases are not mapped on them, so nothing is declared and
|
|
276
|
+
* nothing is sent.
|
|
243
277
|
*/
|
|
244
278
|
export const MANUAL_OVERRIDES: Record<string, ManualModelOverride> = {
|
|
245
|
-
...
|
|
279
|
+
...LARGER_MODELS,
|
|
246
280
|
"glm5.3": {
|
|
247
281
|
name: "GLM 5.3",
|
|
248
|
-
input: ["text"
|
|
282
|
+
input: ["text"],
|
|
249
283
|
contextWindow: 1_048_576,
|
|
250
284
|
maxTokens: 131_072,
|
|
251
|
-
reasoningEffortValues: ["low", "medium", "high", "max"],
|
|
252
|
-
thinkingLevelMap: { off: "
|
|
285
|
+
reasoningEffortValues: ["minimal", "low", "medium", "high", "xhigh", "max"],
|
|
286
|
+
thinkingLevelMap: { off: "minimal", xhigh: "xhigh", max: "max" },
|
|
253
287
|
note:
|
|
254
|
-
"general catalog model since 2026-11-10: NaN announced it no longer has tier-exclusive models ('a partir de ahora ya NO habrá modelos exclusivos por tier'), and the live GET https://api.nan.builders/v1/models lists glm5.3 for a non-premium key (checked 2026-11-10)
|
|
288
|
+
"general catalog model since 2026-11-10: NaN announced it no longer has tier-exclusive models ('a partir de ahora ya NO habrá modelos exclusivos por tier'), and the live GET https://api.nan.builders/v1/models lists glm5.3 for a non-premium key (checked 2026-11-10). " +
|
|
289
|
+
"input text only: the model card says 'Text only: text in, text out, with no image, audio, video or file input; a request carrying one answers 400, earlier turns of the conversation included', and https://nan.builders/docs/pi declares the same 'input': ['text'] (https://nan.builders/docs/models, checked 2026-11-17). The earlier override declared text+image from the 2026-10-14 card; models.dev also lists it text-only now, so this is a correction of a stale value, not a divergence. " +
|
|
290
|
+
"contextWindow 1,048,576 ('1M token context'). maxTokens 131,072: models.dev's documented maximum; the docs' own pi/OpenCode blocks publish 32,768 and describe that field as 'a client-side budget rather than a server cap' (https://nan.builders/docs/opencode), so the larger model maximum stays. " +
|
|
291
|
+
"reasoningEffortValues minimal..max and thinkingLevelMap { off: 'minimal' }: the card says 'reasoning_effort: minimal to max; always reasons, none is applied as minimal' (checked 2026-11-17), so `thinking: off` sends the shortest reasoning the gateway honours. The previous map sent 'low' because the stale docs listed low as the floor. name 'GLM 5.3' per the docs (models.dev says 'GLM-5.3').",
|
|
255
292
|
},
|
|
256
293
|
"qwen3.8-flash": {
|
|
257
294
|
contextWindow: 1_048_576,
|
|
258
|
-
|
|
295
|
+
reasoningEffortValues: ["none", "minimal", "low", "medium", "high", "xhigh", "max"],
|
|
296
|
+
thinkingLevelMap: { off: "none", xhigh: "xhigh", max: "max" },
|
|
259
297
|
note:
|
|
260
|
-
"contextWindow 1,048,576: NaN docs state '1M token context (1,048,576 tokens)' and 'Max answer 131K tokens' (https://nan.builders/docs/models, checked 2026-
|
|
261
|
-
"maxTokensField
|
|
298
|
+
"contextWindow 1,048,576: NaN docs state '1M token context (1,048,576 tokens)' and 'Max answer 131K tokens' (https://nan.builders/docs/models, checked 2026-11-17) — models.dev still lists 262,144. The earlier override was withdrawn 2026-09-07 when the docs read '262K token context, the model's native window'; the docs now state 1M and they are the source of truth (maintainer instruction: docs win over models.dev, which a user updates later). maxTokens stays 131,072, which models.dev already matches and the docs confirm as the 131K max answer. " +
|
|
299
|
+
"maxTokensField: intermediate history only, no override today. Issue #34 (NaN maintainer confirmation 2026-11-11) reported that max_tokens did NOT bound the reasoning phase on this model and that the excess billed against the quota; package 1.5.3 sent max_completion_tokens as the interim bound. NaN support reported the gateway fix deployed and validated (max_tokens honours 1024, received 2026-11-17), so issue #36 removed the override in package 1.5.7 and the generated entry is back on the classic max_tokens field. qwen3.8-max keeps its own maxTokensField override on separate docs evidence (2026-11-17), not on the #34 interim. " +
|
|
300
|
+
"reasoningEffortValues none..max and thinkingLevelMap { off: 'none' }: the card says 'Reasoning on by default (reasoning_effort: none turns it off · minimal to max)' and the contract table says 'Off. No reasoning tokens' for `none` (https://nan.builders/docs/models, checked 2026-11-17), so `thinking: off` now actually disables reasoning. The earlier note said the parameter was 'accepted, depth not adjustable' with no map, which was true of the 2026-10-14 docs; the model card and the contract table now state the opposite and the docs win.",
|
|
262
301
|
},
|
|
263
302
|
"deepseek-v4-flash": {
|
|
264
303
|
input: ["text", "image"],
|
|
265
304
|
contextWindow: 1_048_576,
|
|
266
305
|
maxTokens: 32_768,
|
|
267
|
-
reasoningEffortValues: ["none"],
|
|
268
|
-
thinkingLevelMap: { off: "none" },
|
|
306
|
+
reasoningEffortValues: ["none", "minimal", "low", "medium", "high", "xhigh", "max"],
|
|
307
|
+
thinkingLevelMap: { off: "none", xhigh: "xhigh", max: "max" },
|
|
269
308
|
note:
|
|
270
|
-
"contextWindow 1,048,576: NaN docs state '1M token context' for this model (https://nan.builders/docs/models, checked 2026-
|
|
271
|
-
"input includes image: NaN serves the Vision-Exp variant ('takes images as input', https://nan.builders/docs/models; the image_url content-parts in https://nan.builders/openapi.json list deepseek-v4-flash among the vision models). models.dev provider nan also lists text+image
|
|
272
|
-
"maxTokens 32768 per the official NaN pi docs (https://nan.builders/docs/pi, 'the same set the NaN CLI writes', checked 2026-10-02) closing issue #20 — the gateway
|
|
273
|
-
"
|
|
274
|
-
"docs vs measurement (re-probed live 2026-10-14): https://nan.builders/docs/models#controlling-reasoning documents the parameter as 'any value (no effect) — the model decides per request', but the live gateway contradicts that: `none` gave 0 reasoning tokens / 0 reasoning chars / a 134-char answer, while `low` gave 57 reasoning tokens and omitting the parameter gave 63 (`minimal` gave 109). The docs are stale here; the measurement wins (maintainer instruction), so the measured behavior is kept. " +
|
|
309
|
+
"contextWindow 1,048,576: NaN docs state '1M token context' for this model (https://nan.builders/docs/models, checked 2026-11-17). models.dev lists 1,000,000, a rounded form of the same window; the docs value is authoritative (maintainer instruction: docs win over models.dev, which a user updates later). " +
|
|
310
|
+
"input includes image: NaN serves the Vision-Exp variant ('takes images as input', https://nan.builders/docs/models; the image_url content-parts in https://nan.builders/openapi.json list deepseek-v4-flash among the vision models). models.dev provider nan also lists text+image, so this stays a pin for the vision capability rather than a divergence. " +
|
|
311
|
+
"maxTokens 32768 per the official NaN pi docs (https://nan.builders/docs/pi, 'the same set the NaN CLI writes', checked 2026-10-02) closing issue #20 — the gateway rejects max_tokens above ~256k for this model with 403 permission_error (measured 2026-10-02: 256,000 → 200; 262,143 → 403), and the previous models.dev-derived 384000 made every pi request fail because pi-ai sends max_tokens = model.maxTokens by default. models.dev still lists 384000, so this override pins the documented value. " +
|
|
312
|
+
"reasoningEffortValues: the docs say 'none turns it off · minimal to max' and the contract table says the other values 'steer how much it reasons. They are hints the model follows, not hard caps' (https://nan.builders/docs/models#controlling-reasoning, checked 2026-11-17), so the documented ladder is declared. The measurement behind issue #16 stays the load-bearing fact and is unchanged: only \"none\" suppresses reasoning (0 reasoning tokens with a full answer; `low` 57, omitted 63, `minimal` 109 — re-probed live 2026-10-14), which is why thinkingLevelMap.off is \"none\". " +
|
|
275
313
|
"thinkingLevelMap { off: \"none\" } (issue #16, measured 2026-09-27): when pi maps reasoning:\"off\" to reasoningEffort:undefined, the thinkingLevelMap.off=\"none\" supplies the effort so the gateway receives reasoning_effort:\"none\" and does NOT enter runaway reasoning mode.",
|
|
276
314
|
},
|
|
277
315
|
"glm5.3-flash": {
|
|
278
316
|
contextWindow: 1_048_576,
|
|
279
|
-
|
|
317
|
+
maxTokens: 131_072,
|
|
318
|
+
reasoningEffortValues: ["minimal", "low", "medium", "high", "xhigh", "max"],
|
|
319
|
+
thinkingLevelMap: { off: "minimal", xhigh: "xhigh", max: "max" },
|
|
280
320
|
note:
|
|
281
|
-
"contextWindow 1,048,576:
|
|
282
|
-
"thinkingLevelMap { off: \"minimal\" }
|
|
283
|
-
"
|
|
321
|
+
"contextWindow 1,048,576 ('1M token context') and maxTokens 131,072: the docs state that an output budget above this model's maximum is lowered to 131072, so 131,072 is its documented ceiling (https://nan.builders/docs/models, checked 2026-11-17); models.dev lists the rounded 1,000,000 window. " +
|
|
322
|
+
"thinkingLevelMap { off: \"minimal\" }: the card says 'reasoning_effort: minimal to max; always reasons, none is applied as minimal' — the gateway never stops reasoning on this model. issue #16 measured the same effect on 2026-09-27: 'minimal' yields ~38 reasoning tokens with an answer, while 'none' does not suppress it (13,382 tokens). " +
|
|
323
|
+
"reasoningEffortValues minimal..max per the card, xhigh included (the docs' value ladder runs none, minimal, low, medium, high, xhigh, max).",
|
|
284
324
|
},
|
|
285
325
|
"mimo-v2.6-flash": {
|
|
286
|
-
|
|
326
|
+
reasoningEffortValues: ["none", "low", "medium", "high", "max"],
|
|
327
|
+
thinkingLevelMap: { off: "none", xhigh: "xhigh", max: "max" },
|
|
287
328
|
note:
|
|
288
|
-
"
|
|
329
|
+
"reasoningEffortValues none/low/medium/high/max: the card says 'reasoning_effort: none turns it off · low to max', and the contract table says 'minimal is applied as low and xhigh as max' (https://nan.builders/docs/models#controlling-reasoning, checked 2026-11-17), so only the values with their own meaning are declared. " +
|
|
330
|
+
"thinkingLevelMap { off: \"none\" } (live re-probe 2026-10-14): the 2026-10-14 docs called the parameter 'accepted, depth not adjustable', but the gateway makes it effective at the off end — `none` gave 0 reasoning tokens / a full answer, while `low` gave 22 reasoning tokens and omitting the parameter gave 17. Measured behavior wins over the docs, so `thinking: off` sends reasoning_effort:\"none\" and actually disables reasoning.",
|
|
289
331
|
},
|
|
290
332
|
"qwen3.6": {
|
|
291
|
-
|
|
292
|
-
|
|
333
|
+
reasoningEffortValues: ["none", "minimal", "low", "medium", "high", "xhigh", "max"],
|
|
334
|
+
thinkingLevelMap: { off: "none", xhigh: "xhigh", max: "max" },
|
|
335
|
+
note:
|
|
336
|
+
"thinkingLevelMap { off: \"none\" } (issue #16): NaN docs state that with no reasoning_effort parameter every model uses its own default and that default is reasoning ON for qwen3.6 (16,384-token budget), while `none` and `minimal` skip the reasoning phase entirely (https://nan.builders/docs/models#controlling-reasoning, checked 2026-11-17). pi maps reasoning:\"off\" to reasoningEffort:undefined, so without this map `thinking: off` sent no parameter and the model reasoned anyway; the map sends reasoning_effort:\"none\" and actually disables reasoning. " +
|
|
337
|
+
"reasoningEffortValues: the contract table documents the whole ladder (low 2,048, medium 8,192, high 16,384, xhigh and max 32,768 reasoning tokens on Chat Completions).",
|
|
293
338
|
},
|
|
294
339
|
"gemma4": {
|
|
295
|
-
|
|
340
|
+
reasoningEffortValues: ["none", "minimal", "low", "medium", "high", "xhigh", "max"],
|
|
341
|
+
thinkingLevelMap: { off: "none", xhigh: "xhigh", max: "max" },
|
|
296
342
|
note:
|
|
297
|
-
"thinkingLevelMap { off: \"none\" } (issue #16): NaN docs state that with no reasoning_effort parameter gemma4 defaults to reasoning ON (16,384-token budget), while `none`/`minimal` skip reasoning entirely (https://nan.builders/docs/models#controlling-reasoning, checked 2026-
|
|
343
|
+
"thinkingLevelMap { off: \"none\" } (issue #16): NaN docs state that with no reasoning_effort parameter gemma4 defaults to reasoning ON (16,384-token budget), while `none`/`minimal` skip reasoning entirely (https://nan.builders/docs/models#controlling-reasoning, checked 2026-11-17). pi maps reasoning:\"off\" to reasoningEffort:undefined, so without this map `thinking: off` sent no parameter and the model reasoned anyway; the map sends reasoning_effort:\"none\" and actually disables reasoning. " +
|
|
344
|
+
"reasoningEffortValues: the contract table documents the whole ladder (low 2,048, medium 8,192, high 16,384, xhigh and max 32,768 reasoning tokens on Chat Completions).",
|
|
298
345
|
},
|
|
299
346
|
};
|