@magpie-community/opencode-zen-free-auth 0.1.16 → 0.1.17
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/models.mjs +19 -1
- package/package.json +1 -1
package/models.mjs
CHANGED
|
@@ -53,6 +53,18 @@ function listedFree(id) {
|
|
|
53
53
|
return /-free$/.test(id);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
+
// "258K" is the model's working label, not an exact maximum. Zen's live
|
|
57
|
+
// catalog lists deepseek-v4.1-flash-free at 200000, but on 2026-10-26 a
|
|
58
|
+
// request whose upstream usage was in 576 + cache_read 258,048 = 258,624
|
|
59
|
+
// tokens got a 200 from the free tier. That is the measured floor; the
|
|
60
|
+
// later 283,545-token attempt was magpie's own estimate, not upstream
|
|
61
|
+
// usage, so it is not a ceiling. Reporting more than the vendor accepts
|
|
62
|
+
// routes requests that then fail, so the floor is used until a source
|
|
63
|
+
// says more. Remove this when the catalog carries the real value.
|
|
64
|
+
const CONTEXT_FLOOR = {
|
|
65
|
+
"deepseek-v4.1-flash-free": 258_624,
|
|
66
|
+
};
|
|
67
|
+
|
|
56
68
|
export function buildModels(ids, provider, protocols, baseURL) {
|
|
57
69
|
const result = {};
|
|
58
70
|
for (const id of ids) {
|
|
@@ -81,7 +93,13 @@ export function buildModels(ids, provider, protocols, baseURL) {
|
|
|
81
93
|
providerID: PROVIDER,
|
|
82
94
|
name: model.name ?? id,
|
|
83
95
|
api: { id, url: baseURL, npm: SDK[protocol] },
|
|
84
|
-
limit: {
|
|
96
|
+
limit: {
|
|
97
|
+
output: 4096,
|
|
98
|
+
...model.limit,
|
|
99
|
+
context: CONTEXT_FLOOR[id]
|
|
100
|
+
? Math.max(model.limit?.context ?? 0, CONTEXT_FLOOR[id])
|
|
101
|
+
: model.limit?.context ?? 32768,
|
|
102
|
+
},
|
|
85
103
|
capabilities: {
|
|
86
104
|
temperature: model.temperature ?? true,
|
|
87
105
|
reasoning: model.reasoning ?? false,
|
package/package.json
CHANGED