opencode-zen-freex 0.2.12 → 0.2.13
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/MAINTAINING.md +10 -1
- package/README.md +1 -1
- package/limits.mjs +53 -11
- package/models.mjs +83 -6
- package/package.json +1 -1
package/MAINTAINING.md
CHANGED
|
@@ -22,7 +22,13 @@ small. `deepseek-v4.1-flash-free` is declared 200000/32000 while
|
|
|
22
22
|
`deepseek-v4.1-flash` — the paid id serving the same upstream model, which
|
|
23
23
|
`x-opencode-upstream-model-id` confirms — is declared 1000000/384000 in that
|
|
24
24
|
same catalogue, and `mimo-v2.6-flash-free` is declared 200000/32000 against a
|
|
25
|
-
model whose own vendor publishes 1048576/131072.
|
|
25
|
+
model whose own vendor publishes 1048576/131072. The ids the tier added on
|
|
26
|
+
2026-10-16 were under-reported the same way on the day they appeared:
|
|
27
|
+
`ll-alpha-free` names a 262144-token completion ceiling in its own refusal
|
|
28
|
+
against a declared 65536, and `glm-5.3-flash-free` is declared 200000/32000
|
|
29
|
+
while its paid twin `glm-5.3-flash` is declared 1000000/131072 in the same
|
|
30
|
+
catalogue — and a 232685-token prompt was served through the free id, which the
|
|
31
|
+
declared window does not allow.
|
|
26
32
|
|
|
27
33
|
Both numbers are acted on. The window decides when a conversation is compacted
|
|
28
34
|
and how much of it is ever sent; the output cap is sent as `max_tokens` on every
|
|
@@ -42,6 +48,9 @@ measured against. Each axis carries `samples` and `how`; the short of it:
|
|
|
42
48
|
| `big-pickle` | output | 131072 | the ceiling the route names when it is asked for too much |
|
|
43
49
|
| `nemotron-3.5-lightning-free` | context | 1000000 | the route's own refusal, in its own words |
|
|
44
50
|
| `longcat-2.5-preview-free` | output | 262144 | the ceiling the route names when it is asked for too much |
|
|
51
|
+
| `ll-alpha-free` | output | 262144 | the ceiling the route's own refusal names, against a declared 65536 |
|
|
52
|
+
| `glm-5.3-flash-free` | context | 1000000 | what this route declares for the same upstream model, with a 232685-token prompt served as witness |
|
|
53
|
+
| `glm-5.3-flash-free` | output | 131072 | what this route declares for the same upstream model |
|
|
45
54
|
|
|
46
55
|
A prompt sized just over the window is refused with
|
|
47
56
|
|
package/README.md
CHANGED
|
@@ -47,7 +47,7 @@ magpie plugin login opencode-zen-free
|
|
|
47
47
|
|
|
48
48
|
免费模型的目录上限有时被 Zen 少报,而少报的那一边没有谁会报错:`deepseek-v4.1-flash-free` 在目录里是 20 万上下文 / 3.2 万输出,而同一上游模型的付费 id 是 100 万 / 38.4 万。上下文窗口太小只会让宿主安静地早点压缩,输出上限太小会把回复截断成看起来像模型自己停下的样子,所以插件对这类模型按实测与路由自述对齐(依据与复测方法见 `MAINTAINING.md` 的 “Limits Zen under-reports”),并在运行中采用上游自报的窗口。
|
|
49
49
|
|
|
50
|
-
已下线的模型和 SystemOne
|
|
50
|
+
已下线的模型和 SystemOne 模型会被排除:「下线」指的是状态写着 `retired`/`disabled`,或带着已生效的退役日期。目录里标了 `deprecated` 但 Zen 的列表里还在的模型**照常提供**——`deprecated` 是预告,而「还在不在」由列表说了算(实测 2026-10-16:`muse-spark-1.2-contributor-free` 在目录里是 `deprecated`,Zen 仍在服务它,把它当退役就把一个能用的免费模型藏掉了)。这份列表在宿主每次列举模型时重新获取(magpie 在启动时做一次,之后每小时一次):Zen 不再免费开放的模型会退出列表,新转为免费的模型会加入列表——**不等** OpenCode 的目录或文档写到它:只要 Zen 的列表里有、id 里带 `-free`,就按 provider 自己的协议(OpenAI 兼容 / chat)提供,目录晚一步也不影响。
|
|
51
51
|
|
|
52
52
|
目录或文档读不到时**不算 fallback**:Zen 的列表已经读到了,它就是当前该提供的东西;报成 fallback 会让宿主保守地沿用上一次完整读到的列表,于是读不到 `raw.githubusercontent.com` 或 `models.opencode.ai` 的机器永远看不到之后新转免费的模型。只有**列表本身**读不到才沿用上一次结果;第一次还没读到之前,用的是打包在插件里的那份,所以这个 provider 不会空着。请求一个当前并不免费的模型,会得到一个 404 并列出当时免费的模型;若某个模型是在上次列举之后才转免费的,请求会在重新获取列表后照常服务(最多每分钟一次)。可用性和限流由 Zen 决定,插件这边拿不到剩余额度。
|
|
53
53
|
|
package/limits.mjs
CHANGED
|
@@ -96,20 +96,62 @@ export const LIMITS = {
|
|
|
96
96
|
how: "\"Upstream request failed: [invalid_parameter] 参数校验失败: /max_tokens: 1000000 is not less or equal to 262144\" — the second wording namedOutputCap reads, where the ceiling is the number max_tokens has to stay under. Its context needs nothing: the catalogue's 1000000 is what that same refusal calls the endpoint's window.",
|
|
97
97
|
},
|
|
98
98
|
},
|
|
99
|
+
// The two the free tier added on 2026-10-16, each measured the day it was
|
|
100
|
+
// noticed. Both under-report in the catalogue the same way the older entries
|
|
101
|
+
// do, and both were checked on every axis: nothing below is what a refusal
|
|
102
|
+
// happened to say, it is all that was asked.
|
|
103
|
+
"ll-alpha-free": {
|
|
104
|
+
output: {
|
|
105
|
+
value: 262144,
|
|
106
|
+
source: "route",
|
|
107
|
+
declaredAt: 65536,
|
|
108
|
+
measured: "2026-10-16",
|
|
109
|
+
samples: "max_completion_tokens 1000000 and 300000 both refused, each naming 262144; nothing above 65536 watched — the ceiling is the route's own number, four times what the catalogue declares",
|
|
110
|
+
how: "\"Upstream request failed: [400] max_completion_tokens is too large: 300000.This model supports at most 262144 completion tokens.\" — the ceiling is the number the sentence names. Its context needs nothing: the same day's refusal, \"The input (341480 tokens) is longer than the model's context length (262144 tokens).\", is the window the catalogue already declares.",
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
"glm-5.3-flash-free": {
|
|
114
|
+
context: {
|
|
115
|
+
value: 1000000,
|
|
116
|
+
source: "route-twin",
|
|
117
|
+
declaredAt: 200000,
|
|
118
|
+
measured: "2026-10-16",
|
|
119
|
+
samples: "a 232685-token prompt was served and answered from (usage.prompt_tokens 232685), so the declared 200000 is already known to be small; nothing above it was refused, because this upstream refuses no max_tokens at all",
|
|
120
|
+
how: "glm-5.3-flash, the paid id serving the same upstream model — the catalogue's own canonical_model_id for this free id is zhipuai/glm-5.3-flash — is declared 1000000 in this same catalogue",
|
|
121
|
+
},
|
|
122
|
+
output: {
|
|
123
|
+
value: 131072,
|
|
124
|
+
source: "route-twin",
|
|
125
|
+
declaredAt: 32000,
|
|
126
|
+
measured: "2026-10-16",
|
|
127
|
+
samples: "max_tokens 4000000 was accepted with no refusal at all, which is the DeepSeek upstream's shape: silence here is not evidence of a ceiling either way, and nothing above 32000 was watched",
|
|
128
|
+
how: "the same paid twin declares 131072 on this axis",
|
|
129
|
+
},
|
|
130
|
+
},
|
|
99
131
|
};
|
|
100
132
|
|
|
101
133
|
// "This model's maximum context length is 1048576 tokens. However, you
|
|
102
134
|
// requested 1422278 tokens (1038278 in the messages, 384000 in the
|
|
103
|
-
// completion)." — the route's own words, and the
|
|
104
|
-
// route that states a window. A second upstream phrases the same fact as
|
|
105
|
-
// endpoint's maximum context length is ...", with the request broken into
|
|
106
|
-
// input, tool input and output; both are the route naming its own window,
|
|
107
|
-
// its "requested about" figure is a rough one (chars, not tokens) rather
|
|
108
|
-
// the count a served request reports in `usage.prompt_tokens`. A generic
|
|
109
|
-
// says nothing attributable and is left alone; §7 of the measured notes has
|
|
110
|
-
// context overflow and an invalid parameter answering with byte-identical 400s
|
|
135
|
+
// completion)." — the route's own words, and the sentence seen most often on
|
|
136
|
+
// this route that states a window. A second upstream phrases the same fact as
|
|
137
|
+
// "This endpoint's maximum context length is ...", with the request broken into
|
|
138
|
+
// text input, tool input and output; both are the route naming its own window,
|
|
139
|
+
// and its "requested about" figure is a rough one (chars, not tokens) rather
|
|
140
|
+
// than the count a served request reports in `usage.prompt_tokens`. A generic
|
|
141
|
+
// 400 says nothing attributable and is left alone; §7 of the measured notes has
|
|
142
|
+
// a context overflow and an invalid parameter answering with byte-identical 400s
|
|
111
143
|
// on another Zen model.
|
|
112
|
-
|
|
144
|
+
//
|
|
145
|
+
// A third wording states the same fact as a parenthetical, and was missed until
|
|
146
|
+
// it was measured: "The input (341480 tokens) is longer than the model's context
|
|
147
|
+
// length (262144 tokens)." (`ll-alpha-free`, 2026-10-16). It names the same
|
|
148
|
+
// number in the same sentence, so it is read the same way — a window this file
|
|
149
|
+
// does not read is a window the plugin keeps under-declaring, which is the one
|
|
150
|
+
// failure it exists to remove.
|
|
151
|
+
const NAMED_CONTEXT = [
|
|
152
|
+
/maximum context length is (\d+) tokens/id,
|
|
153
|
+
/context length \((\d+) tokens?\)/id,
|
|
154
|
+
];
|
|
113
155
|
|
|
114
156
|
// "max_tokens is too large: 200000. This model supports at most 131072 completion
|
|
115
157
|
// tokens, whereas you provided 200000." — an upstream that validates the ceiling
|
|
@@ -169,7 +211,7 @@ function describe({ kind, id, axis, value, measuredAgainst, declared }) {
|
|
|
169
211
|
// The window a refusal names, or undefined when the body says nothing
|
|
170
212
|
// attributable. Exported for the tests and for anyone reading a capture.
|
|
171
213
|
export function namedContextWindow(text) {
|
|
172
|
-
return namedFrom(
|
|
214
|
+
return namedFrom(NAMED_CONTEXT, text)?.value;
|
|
173
215
|
}
|
|
174
216
|
|
|
175
217
|
// The completion ceiling a refusal names, or undefined. Same rule as the window:
|
|
@@ -373,7 +415,7 @@ function digitsEnd(found) {
|
|
|
373
415
|
// returned cannot be two answers.
|
|
374
416
|
function namedAxes(text, limit, cut) {
|
|
375
417
|
const head = text.slice(0, limit);
|
|
376
|
-
const context = namedFrom(
|
|
418
|
+
const context = namedFrom(NAMED_CONTEXT, head);
|
|
377
419
|
const output = namedFrom(NAMED_OUTPUT, head);
|
|
378
420
|
const onCut = (found) => cut && found !== undefined && digitsEnd(found) >= head.length;
|
|
379
421
|
return {
|
package/models.mjs
CHANGED
|
@@ -44,15 +44,23 @@ const hasValue = (value) => value !== null && value !== undefined;
|
|
|
44
44
|
// offered. A status that is set — "active" included — is still read as itself.
|
|
45
45
|
const isSet = (value) => hasValue(value) && String(value).trim() !== "";
|
|
46
46
|
|
|
47
|
+
// A status ends a model when it says the model is gone: "retired" and
|
|
48
|
+
// "disabled" are endings. "deprecated" is not one — it says the catalogue
|
|
49
|
+
// expects the model to go, and what decides whether it is still there is the
|
|
50
|
+
// list Zen serves, which discovery already reads: measured 2026-10-16,
|
|
51
|
+
// `muse-spark-1.2-contributor-free` is marked deprecated in the catalogue while
|
|
52
|
+
// Zen lists it and the free tier answers a request for it through this plugin,
|
|
53
|
+
// so reading that status as an ending hid a model that was being served.
|
|
54
|
+
const ENDED = ["retired", "disabled"];
|
|
55
|
+
|
|
47
56
|
function isRetired(model) {
|
|
48
57
|
return (
|
|
49
58
|
model.deprecated === true ||
|
|
50
|
-
|
|
51
|
-
isSet(model.status) ? model.status : model.lifecycle,
|
|
52
|
-
) ||
|
|
59
|
+
ENDED.includes(isSet(model.status) ? model.status : model.lifecycle) ||
|
|
53
60
|
// Read through `isSet`, not `hasValue`: a blank `deprecated_at` is the empty
|
|
54
61
|
// string the catalogue writes for a date it does not have, and reading it as
|
|
55
|
-
// a date retired a model that was still on offer.
|
|
62
|
+
// a date retired a model that was still on offer. An effective date is an
|
|
63
|
+
// ending whatever the status beside it says.
|
|
56
64
|
isSet(model.deprecated_at) ||
|
|
57
65
|
isSet(model.retirement_date)
|
|
58
66
|
);
|
|
@@ -191,10 +199,19 @@ export const bootstrapProtocols = {
|
|
|
191
199
|
"nemotron-3.5-lightning-free": "chat",
|
|
192
200
|
"muse-spark-1.3-contributor-free": "responses",
|
|
193
201
|
"jev-1.13-free": "systemone",
|
|
202
|
+
// The free tier's list on 2026-10-16, when these five appeared: the four chat
|
|
203
|
+
// ones and the responses one below, whose paid twin the docs table names.
|
|
204
|
+
"deepseek-v4.1-flash-free": "chat",
|
|
205
|
+
"glm-5.3-flash-free": "chat",
|
|
206
|
+
"ll-alpha-free": "chat",
|
|
207
|
+
"nemotron-3.5-super-vl-free": "chat",
|
|
208
|
+
"muse-spark-1.2-contributor-free": "responses",
|
|
194
209
|
};
|
|
195
210
|
|
|
196
|
-
// Offline bootstrap metadata from the OpenCode catalog, 2026-10-06; the
|
|
197
|
-
//
|
|
211
|
+
// Offline bootstrap metadata from the OpenCode catalog, 2026-10-06; the free
|
|
212
|
+
// models listed since added on 2026-10-15, and the ids the tier was serving on
|
|
213
|
+
// 2026-10-16 added then. A host that reaches nothing on its first run offers
|
|
214
|
+
// these; the first discovery replaces the list.
|
|
198
215
|
export const bootstrapProvider = {
|
|
199
216
|
npm: SDK.chat,
|
|
200
217
|
models: {
|
|
@@ -270,6 +287,66 @@ export const bootstrapProvider = {
|
|
|
270
287
|
{ type: "effort", values: ["minimal", "low", "medium", "high", "xhigh"] },
|
|
271
288
|
],
|
|
272
289
|
},
|
|
290
|
+
// The free ids the tier was serving on 2026-10-16 and this snapshot did not
|
|
291
|
+
// carry. Their numbers are the catalogue's, as every other entry here is —
|
|
292
|
+
// `limits.mjs` is what corrects the ones the catalogue under-reports, and it
|
|
293
|
+
// carries entries for two of these.
|
|
294
|
+
"deepseek-v4.1-flash-free": {
|
|
295
|
+
name: "DeepSeek V4.1 Flash Free",
|
|
296
|
+
cost: { input: 0, output: 0 },
|
|
297
|
+
limit: { context: 200000, output: 32000 },
|
|
298
|
+
reasoning: true,
|
|
299
|
+
tool_call: true,
|
|
300
|
+
interleaved: { field: "reasoning_content" },
|
|
301
|
+
modalities: { input: ["text", "image"], output: ["text"] },
|
|
302
|
+
reasoning_options: [{ type: "effort", values: ["low", "high", "max"] }],
|
|
303
|
+
},
|
|
304
|
+
"glm-5.3-flash-free": {
|
|
305
|
+
name: "GLM-5.3-Flash Free",
|
|
306
|
+
cost: { input: 0, output: 0 },
|
|
307
|
+
limit: { context: 200000, output: 32000 },
|
|
308
|
+
reasoning: true,
|
|
309
|
+
tool_call: true,
|
|
310
|
+
interleaved: { field: "reasoning_content" },
|
|
311
|
+
modalities: { input: ["text", "image", "video", "pdf"], output: ["text"] },
|
|
312
|
+
reasoning_options: [{ type: "effort", values: ["low", "high", "max"] }],
|
|
313
|
+
},
|
|
314
|
+
"ll-alpha-free": {
|
|
315
|
+
name: "LL Alpha Free",
|
|
316
|
+
cost: { input: 0, output: 0 },
|
|
317
|
+
limit: { context: 262144, output: 65536 },
|
|
318
|
+
reasoning: true,
|
|
319
|
+
tool_call: true,
|
|
320
|
+
interleaved: { field: "reasoning_content" },
|
|
321
|
+
modalities: { input: ["text"], output: ["text"] },
|
|
322
|
+
reasoning_options: [
|
|
323
|
+
{ type: "effort", values: ["low", "medium", "high", "xhigh", "max"] },
|
|
324
|
+
],
|
|
325
|
+
},
|
|
326
|
+
"nemotron-3.5-super-vl-free": {
|
|
327
|
+
name: "Nemotron 3.5 Super VL Free",
|
|
328
|
+
cost: { input: 0, output: 0 },
|
|
329
|
+
limit: { context: 1048576, output: 131072 },
|
|
330
|
+
reasoning: true,
|
|
331
|
+
tool_call: true,
|
|
332
|
+
interleaved: { field: "reasoning_content" },
|
|
333
|
+
modalities: { input: ["text", "image"], output: ["text"] },
|
|
334
|
+
reasoning_options: [
|
|
335
|
+
{ type: "effort", values: ["none", "minimal", "low", "medium", "high", "xhigh"] },
|
|
336
|
+
],
|
|
337
|
+
},
|
|
338
|
+
"muse-spark-1.2-contributor-free": {
|
|
339
|
+
name: "Muse Spark 1.2 Free",
|
|
340
|
+
cost: { input: 0, output: 0 },
|
|
341
|
+
provider: { npm: SDK.responses },
|
|
342
|
+
limit: { context: 1048576, output: 131072 },
|
|
343
|
+
reasoning: true,
|
|
344
|
+
tool_call: true,
|
|
345
|
+
modalities: { input: ["text", "image", "video", "pdf", "audio"], output: ["text"] },
|
|
346
|
+
reasoning_options: [
|
|
347
|
+
{ type: "effort", values: ["minimal", "low", "medium", "high", "xhigh"] },
|
|
348
|
+
],
|
|
349
|
+
},
|
|
273
350
|
},
|
|
274
351
|
};
|
|
275
352
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-zen-freex",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.13",
|
|
4
4
|
"description": "OpenCode Zen's free models, for hosts that are not OpenCode: the public credential, automatic discovery and native streaming protocols",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.mjs",
|