@qadanm/opencode-smart-router 0.0.0-stage → 0.6.1
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/CHANGELOG.md +286 -0
- package/CONTRIBUTING.md +103 -0
- package/LICENSE +21 -0
- package/README.md +425 -2
- package/SECURITY.md +174 -0
- package/config.example.json +107 -0
- package/dist/npm/index.js +40 -0
- package/docs/ARCHITECTURE.md +104 -0
- package/docs/DEBUGGING-GUI.md +70 -0
- package/docs/INSTALL.md +151 -0
- package/docs/LIMITATIONS.md +230 -0
- package/docs/MODELS.md +124 -0
- package/docs/OPENDESIGN-INTEGRATION.md +635 -0
- package/docs/QA.md +142 -0
- package/docs/SHARED-CORE.md +114 -0
- package/install +75 -0
- package/package.json +94 -4
- package/scripts/install.sh +324 -0
- package/scripts/uninstall.sh +91 -0
- package/src/allowance.ts +135 -0
- package/src/core/classify/classifier.ts +305 -0
- package/src/core/config-writer.ts +167 -0
- package/src/core/config.ts +1047 -0
- package/src/core/context/strategy.ts +188 -0
- package/src/core/context-health.ts +39 -0
- package/src/core/failures.ts +398 -0
- package/src/core/history/opencode.ts +173 -0
- package/src/core/models/protocol.ts +22 -0
- package/src/core/models/registry.ts +204 -0
- package/src/core/models/seed.ts +781 -0
- package/src/core/offline/mode.ts +321 -0
- package/src/core/plan-page.ts +390 -0
- package/src/core/plans/catalog.ts +487 -0
- package/src/core/policy/calibration.ts +259 -0
- package/src/core/policy/eligibility.ts +630 -0
- package/src/core/providers/enablement.ts +143 -0
- package/src/core/providers/opendesign-credits.ts +206 -0
- package/src/core/providers/opendesign-models.ts +654 -0
- package/src/core/providers/opendesign.ts +474 -0
- package/src/core/quota/calibration.ts +166 -0
- package/src/core/quota/commandcode.ts +471 -0
- package/src/core/quota/credentials.ts +490 -0
- package/src/core/quota/ledger.ts +1304 -0
- package/src/core/quota/opencode-go.ts +148 -0
- package/src/core/quota/opendesign.ts +1043 -0
- package/src/core/quota/reconcile.ts +155 -0
- package/src/core/quota/report.ts +261 -0
- package/src/core/quota/service.ts +273 -0
- package/src/core/reprompt.ts +48 -0
- package/src/core/routing/engine.ts +978 -0
- package/src/core/types.ts +866 -0
- package/src/core/ui.ts +236 -0
- package/src/core/util.ts +114 -0
- package/src/gui/index.tsx +1675 -0
- package/src/gui/viewmodel.ts +456 -0
- package/src/index.ts +33 -0
- package/src/rpc.ts +204 -0
- package/src/server/containment.ts +131 -0
- package/src/server/controller.ts +3405 -0
- package/src/server/route-tracker.ts +60 -0
- package/src/server/shared-core.ts +701 -0
- package/src/tui/index.tsx +168 -0
|
@@ -0,0 +1,654 @@
|
|
|
1
|
+
import type { CostTier } from "../types.js"
|
|
2
|
+
import { OPENDESIGN_CREDIT_MULTIPLIERS, OPENDESIGN_UNPUBLISHED_MULTIPLIER_MODELS } from "./opendesign-credits.js"
|
|
3
|
+
import { OPENDESIGN_DESIGN_PLAN_MODELS } from "../plans/catalog.js"
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* OpenDesign model catalog.
|
|
7
|
+
*
|
|
8
|
+
* The gateway is authoritative for entitlement, context, output budget and
|
|
9
|
+
* image support. Everything below was read from the live gateway's
|
|
10
|
+
* `GET /v1/models` response on 2026-10-29, which is refreshed by the discovery
|
|
11
|
+
* adapter at runtime.
|
|
12
|
+
*
|
|
13
|
+
* Two funding groups exist on the paid plans:
|
|
14
|
+
*
|
|
15
|
+
* - **Design Plan models** draw from the shared Design Plan credit pool and
|
|
16
|
+
* are charged at their published multiplier.
|
|
17
|
+
* - **Plan models** draw from the separate plan model pool, which has no
|
|
18
|
+
* usage windows. Design Plan multipliers do not apply to them.
|
|
19
|
+
*
|
|
20
|
+
* Which group a model belongs to is decided by the plan catalog, not by this
|
|
21
|
+
* file; `fundingPoolFor` is the single source of truth.
|
|
22
|
+
*
|
|
23
|
+
* Intelligence and design scores are reused from the router's existing seed
|
|
24
|
+
* for the same underlying model, because the same model has the same quality
|
|
25
|
+
* regardless of which subscription serves it. Models the router has never
|
|
26
|
+
* scored stay unapproved until the owner approves them explicitly.
|
|
27
|
+
*
|
|
28
|
+
* Underlying token prices are the vendor list prices already curated in the
|
|
29
|
+
* router seed. OpenDesign does not publish per-token prices for plan models;
|
|
30
|
+
* for Design Plan models it publishes a credit multiplier that converts usage
|
|
31
|
+
* value into credits. See docs/OPENDESIGN-INTEGRATION.md for the accuracy
|
|
32
|
+
* limits of this proxy.
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
export interface OpenDesignModelSpec {
|
|
36
|
+
readonly modelID: string
|
|
37
|
+
readonly name: string
|
|
38
|
+
/**
|
|
39
|
+
* Design Plan credit multiplier. Meaningful only for a model funded from
|
|
40
|
+
* the Design Plan pool; plan models are billed at plain usage value.
|
|
41
|
+
*/
|
|
42
|
+
readonly creditMultiplier: number
|
|
43
|
+
readonly multiplierEvidence: "published" | "unverified" | "not-applicable"
|
|
44
|
+
/** Usable input window the gateway reports for this model. */
|
|
45
|
+
readonly context: number
|
|
46
|
+
/** Maximum output tokens the gateway reports. */
|
|
47
|
+
readonly maxOutput: number
|
|
48
|
+
readonly input: readonly string[]
|
|
49
|
+
readonly cost: readonly CostTier[]
|
|
50
|
+
readonly intelligence: number
|
|
51
|
+
readonly design: number
|
|
52
|
+
readonly designEvidence: "benchmark" | "curated" | "observed" | "unverified"
|
|
53
|
+
readonly tier: 1 | 2 | 3
|
|
54
|
+
readonly approved: boolean
|
|
55
|
+
readonly notes: string
|
|
56
|
+
/**
|
|
57
|
+
* Per-kind capability evidence. An absent axis means "not measured", never
|
|
58
|
+
* zero, and each entry's provenance is named alongside it.
|
|
59
|
+
*/
|
|
60
|
+
readonly capabilities?: {
|
|
61
|
+
/** Agentic coding benchmark, percent. */
|
|
62
|
+
readonly coding?: number
|
|
63
|
+
/** Complex-debugging / automation benchmark, percent. */
|
|
64
|
+
readonly debugging?: number
|
|
65
|
+
/** Long-horizon autonomous-execution benchmark, percent. */
|
|
66
|
+
readonly agentic?: number
|
|
67
|
+
/** Curated architectural-reasoning score, same 0-100 scale. */
|
|
68
|
+
readonly architecture?: number
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const cost = (input: number, output: number, read: number, write = 0): CostTier[] => [
|
|
73
|
+
{ input, output, cache: { read, write } },
|
|
74
|
+
]
|
|
75
|
+
|
|
76
|
+
const tieredCost = (
|
|
77
|
+
base: CostTier,
|
|
78
|
+
size: number,
|
|
79
|
+
high: { input: number; output: number; read: number; write: number },
|
|
80
|
+
): CostTier[] => [
|
|
81
|
+
base,
|
|
82
|
+
{
|
|
83
|
+
input: high.input,
|
|
84
|
+
output: high.output,
|
|
85
|
+
cache: { read: high.read, write: high.write },
|
|
86
|
+
tier: { type: "context" as const, size },
|
|
87
|
+
},
|
|
88
|
+
]
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Conservative fallbacks used when the gateway does not report a context or
|
|
92
|
+
* output budget. A model with missing metadata is never treated as if it
|
|
93
|
+
* could accept an unbounded request.
|
|
94
|
+
*/
|
|
95
|
+
export const OPENDESIGN_FALLBACK_CONTEXT = 232_000
|
|
96
|
+
export const OPENDESIGN_FALLBACK_OUTPUT = 32_000
|
|
97
|
+
|
|
98
|
+
const spec = (
|
|
99
|
+
modelID: string,
|
|
100
|
+
name: string,
|
|
101
|
+
extra: Omit<OpenDesignModelSpec, "modelID" | "name" | "creditMultiplier" | "multiplierEvidence"> &
|
|
102
|
+
Partial<Pick<OpenDesignModelSpec, "creditMultiplier" | "multiplierEvidence">>,
|
|
103
|
+
): OpenDesignModelSpec => {
|
|
104
|
+
const inDesignPlan = OPENDESIGN_DESIGN_PLAN_MODELS.has(modelID)
|
|
105
|
+
const published = OPENDESIGN_CREDIT_MULTIPLIERS[modelID]
|
|
106
|
+
const hasPublished = typeof published === "number"
|
|
107
|
+
return {
|
|
108
|
+
modelID,
|
|
109
|
+
name,
|
|
110
|
+
creditMultiplier: extra.creditMultiplier ?? published ?? 1,
|
|
111
|
+
multiplierEvidence:
|
|
112
|
+
extra.multiplierEvidence ??
|
|
113
|
+
(inDesignPlan ? (hasPublished ? "published" : "unverified") : "not-applicable"),
|
|
114
|
+
context: extra.context,
|
|
115
|
+
maxOutput: extra.maxOutput,
|
|
116
|
+
input: extra.input,
|
|
117
|
+
cost: extra.cost,
|
|
118
|
+
intelligence: extra.intelligence,
|
|
119
|
+
design: extra.design,
|
|
120
|
+
designEvidence: extra.designEvidence,
|
|
121
|
+
tier: extra.tier,
|
|
122
|
+
approved: extra.approved,
|
|
123
|
+
notes: extra.notes,
|
|
124
|
+
...(extra.capabilities ? { capabilities: extra.capabilities } : {}),
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* The models the gateway serves for this account.
|
|
130
|
+
*
|
|
131
|
+
* Entitlement is confirmed at runtime from `GET /v1/models`; a model missing
|
|
132
|
+
* from that response is not plan-eligible even if it appears here.
|
|
133
|
+
*/
|
|
134
|
+
export const OPENDESIGN_MODELS: ReadonlyArray<OpenDesignModelSpec> = [
|
|
135
|
+
// ---------------------------------------------------------------------------
|
|
136
|
+
// Design Plan models. Charged at their published multiplier.
|
|
137
|
+
// ---------------------------------------------------------------------------
|
|
138
|
+
spec("deepseek-v4.1-flash", "DeepSeek V4.1 Flash", {
|
|
139
|
+
context: 1_048_000,
|
|
140
|
+
maxOutput: 128_000,
|
|
141
|
+
input: ["text", "image"],
|
|
142
|
+
cost: cost(0.3, 1.2, 0.006),
|
|
143
|
+
intelligence: 39.5,
|
|
144
|
+
design: 65,
|
|
145
|
+
designEvidence: "observed",
|
|
146
|
+
tier: 2,
|
|
147
|
+
approved: true,
|
|
148
|
+
notes:
|
|
149
|
+
"0.5x Design Plan credits. Gateway default. Served as DeepSeek-V4.1-Flash-1017 (2026-10-17 checkpoint). Native image input. The gateway advertises context_budget 328,000 but does not enforce it: measured on 2026-10-30 at 1,043,337 input tokens with HTTP 200, and rejected only above the 1,048,000 vendor limit. The seed carries the measured window.",
|
|
150
|
+
}),
|
|
151
|
+
spec("claude-haiku-5.5", "Claude Haiku 5.5", {
|
|
152
|
+
context: 228_000,
|
|
153
|
+
maxOutput: 128_000,
|
|
154
|
+
input: ["text", "image", "pdf"],
|
|
155
|
+
cost: tieredCost(cost(0.1, 0.5, 0.01, 0.125)[0]!, 100_000, {
|
|
156
|
+
input: 0.5,
|
|
157
|
+
output: 2.5,
|
|
158
|
+
read: 0.05,
|
|
159
|
+
write: 0.625,
|
|
160
|
+
}),
|
|
161
|
+
intelligence: 43.4,
|
|
162
|
+
design: 70,
|
|
163
|
+
designEvidence: "curated",
|
|
164
|
+
tier: 2,
|
|
165
|
+
approved: true,
|
|
166
|
+
notes: "2x Design Plan credits. Highest design score inside the Design Plan group.",
|
|
167
|
+
}),
|
|
168
|
+
spec("glm-5.3-flash", "GLM-5.3-Flash", {
|
|
169
|
+
context: 232_000,
|
|
170
|
+
maxOutput: 32_000,
|
|
171
|
+
input: ["text", "image", "video"],
|
|
172
|
+
cost: cost(0.075, 0.25, 0.015),
|
|
173
|
+
intelligence: 41.8,
|
|
174
|
+
design: 65,
|
|
175
|
+
designEvidence: "curated",
|
|
176
|
+
tier: 2,
|
|
177
|
+
approved: true,
|
|
178
|
+
notes: "1x Design Plan credits. Native image and video input.",
|
|
179
|
+
}),
|
|
180
|
+
spec("minimax-m3.1-flash", "MiniMax M3.1 Flash", {
|
|
181
|
+
context: 1_000_000,
|
|
182
|
+
maxOutput: OPENDESIGN_FALLBACK_OUTPUT,
|
|
183
|
+
input: ["text", "image", "video"],
|
|
184
|
+
cost: cost(0.15, 0.6, 0.015),
|
|
185
|
+
intelligence: 42.7,
|
|
186
|
+
design: 60,
|
|
187
|
+
designEvidence: "curated",
|
|
188
|
+
tier: 2,
|
|
189
|
+
approved: true,
|
|
190
|
+
notes:
|
|
191
|
+
"The gateway reports a 1M vendor limit but no context_budget for this model, so the vendor limit is used. Confirmed against models.dev (1,000,000) and by 475 successful calls with no context-length error. The gateway also serves this model outside the Design Plan group; OpenDesign has not published which group or multiplier applies, so the neutral 1x rate is used and the uncertainty is reported.",
|
|
192
|
+
}),
|
|
193
|
+
spec("mimo-v2.6-pro", "MiMo-V2.6-Pro", {
|
|
194
|
+
context: 232_000,
|
|
195
|
+
maxOutput: 32_000,
|
|
196
|
+
input: ["text", "image", "audio", "video"],
|
|
197
|
+
cost: cost(0.435, 0.87, 0.0036),
|
|
198
|
+
intelligence: 46.3,
|
|
199
|
+
design: 62,
|
|
200
|
+
designEvidence: "curated",
|
|
201
|
+
tier: 2,
|
|
202
|
+
approved: true,
|
|
203
|
+
notes: "1x Design Plan credits. Highest intelligence score inside the Design Plan group.",
|
|
204
|
+
}),
|
|
205
|
+
spec("mimo-v2.6-flash", "MiMo-V2.6-Flash", {
|
|
206
|
+
context: 232_000,
|
|
207
|
+
maxOutput: 32_000,
|
|
208
|
+
input: ["text", "image", "audio", "video"],
|
|
209
|
+
cost: cost(0.14, 0.28, 0.0028),
|
|
210
|
+
intelligence: 37.9,
|
|
211
|
+
design: 50,
|
|
212
|
+
designEvidence: "curated",
|
|
213
|
+
tier: 1,
|
|
214
|
+
approved: true,
|
|
215
|
+
notes: "1x Design Plan credits. Economy tier; below the standard intelligence floor.",
|
|
216
|
+
}),
|
|
217
|
+
spec("gpt-6-luna", "GPT-6 Luna", {
|
|
218
|
+
context: 400_000,
|
|
219
|
+
maxOutput: 128_000,
|
|
220
|
+
input: ["text", "image", "pdf"],
|
|
221
|
+
cost: tieredCost(cost(0.1, 0.5, 0.01, 0.125)[0]!, 272_000, {
|
|
222
|
+
input: 0.2,
|
|
223
|
+
output: 0.75,
|
|
224
|
+
read: 0.02,
|
|
225
|
+
write: 0.25,
|
|
226
|
+
}),
|
|
227
|
+
intelligence: 38.1,
|
|
228
|
+
design: 55,
|
|
229
|
+
designEvidence: "curated",
|
|
230
|
+
tier: 1,
|
|
231
|
+
approved: true,
|
|
232
|
+
notes: "4x Design Plan credits, the most expensive Design Plan route. 400k usable input window.",
|
|
233
|
+
}),
|
|
234
|
+
spec("deepseek-v4-pro", "DeepSeek V4 Pro", {
|
|
235
|
+
context: 328_000,
|
|
236
|
+
maxOutput: 128_000,
|
|
237
|
+
input: ["text"],
|
|
238
|
+
cost: cost(1.32, 3.96, 0.044),
|
|
239
|
+
intelligence: 36,
|
|
240
|
+
design: 55,
|
|
241
|
+
designEvidence: "curated",
|
|
242
|
+
tier: 2,
|
|
243
|
+
approved: false,
|
|
244
|
+
notes: "Text only and below the standard intelligence floor. Requires explicit approval.",
|
|
245
|
+
}),
|
|
246
|
+
spec("deepseek-v4-flash", "DeepSeek V4 Flash", {
|
|
247
|
+
context: 232_000,
|
|
248
|
+
maxOutput: 32_000,
|
|
249
|
+
input: ["text"],
|
|
250
|
+
cost: cost(0.44, 1.32, 0.014),
|
|
251
|
+
intelligence: 0,
|
|
252
|
+
design: 0,
|
|
253
|
+
designEvidence: "unverified",
|
|
254
|
+
tier: 2,
|
|
255
|
+
approved: false,
|
|
256
|
+
notes:
|
|
257
|
+
"Served upstream by DeepSeek-V4.1-Flash-1017 (DeepSeek retired the legacy name but still accepts and bills it). Unscored under this id; the price is a conservative upper bound borrowed from V4 Pro. Set an explicit price in models.definitions before approving.",
|
|
258
|
+
}),
|
|
259
|
+
spec("deepseek-v4-flash-vision-exp", "DeepSeek V4 Flash Vision Exp", {
|
|
260
|
+
context: 232_000,
|
|
261
|
+
maxOutput: 32_000,
|
|
262
|
+
input: ["text", "image"],
|
|
263
|
+
cost: cost(0.44, 1.32, 0.014),
|
|
264
|
+
intelligence: 0,
|
|
265
|
+
design: 0,
|
|
266
|
+
designEvidence: "unverified",
|
|
267
|
+
tier: 2,
|
|
268
|
+
approved: false,
|
|
269
|
+
notes:
|
|
270
|
+
"Unscored. Conservative upper-bound price; set an explicit price in models.definitions before approving.",
|
|
271
|
+
}),
|
|
272
|
+
spec("glm-5.3-flashx", "GLM-5.3-Flash-X", {
|
|
273
|
+
context: 232_000,
|
|
274
|
+
maxOutput: 32_000,
|
|
275
|
+
input: ["text", "image", "pdf", "video"],
|
|
276
|
+
cost: cost(0.37, 1.25, 0.075),
|
|
277
|
+
intelligence: 0,
|
|
278
|
+
design: 0,
|
|
279
|
+
designEvidence: "unverified",
|
|
280
|
+
tier: 2,
|
|
281
|
+
approved: false,
|
|
282
|
+
notes:
|
|
283
|
+
"2x Design Plan credits. Unscored; conservative upper-bound price borrowed from GLM-5.3. Set an explicit price in models.definitions before approving.",
|
|
284
|
+
}),
|
|
285
|
+
spec("hy4-preview", "Hunyuan H4 Preview", {
|
|
286
|
+
context: 232_000,
|
|
287
|
+
maxOutput: 32_000,
|
|
288
|
+
input: ["text"],
|
|
289
|
+
cost: cost(0.834, 2.501, 0.042),
|
|
290
|
+
intelligence: 0,
|
|
291
|
+
design: 0,
|
|
292
|
+
designEvidence: "unverified",
|
|
293
|
+
tier: 1,
|
|
294
|
+
approved: false,
|
|
295
|
+
notes: "Unscored and text only. Requires explicit approval.",
|
|
296
|
+
}),
|
|
297
|
+
spec("kimi-k2.7-code", "Kimi K2.7 Code", {
|
|
298
|
+
context: 262_000,
|
|
299
|
+
maxOutput: 32_000,
|
|
300
|
+
input: ["text", "image"],
|
|
301
|
+
cost: cost(0.95, 4, 0.19),
|
|
302
|
+
intelligence: 0,
|
|
303
|
+
design: 0,
|
|
304
|
+
designEvidence: "unverified",
|
|
305
|
+
tier: 2,
|
|
306
|
+
approved: false,
|
|
307
|
+
notes:
|
|
308
|
+
"Unscored. Conservative upper-bound price borrowed from Kimi K3; set an explicit price in models.definitions before approving.",
|
|
309
|
+
}),
|
|
310
|
+
|
|
311
|
+
// ---------------------------------------------------------------------------
|
|
312
|
+
// Plan models. Funded from the separate plan model pool, which has no usage
|
|
313
|
+
// windows. Only available on Plus, Pro and Max.
|
|
314
|
+
// ---------------------------------------------------------------------------
|
|
315
|
+
spec("claude-sonnet-5.5", "Claude Sonnet 5.5", {
|
|
316
|
+
// Probed 2026-11-06: one request with 819,383 random-filler prompt tokens
|
|
317
|
+
// returned 200, finish stop, all three mid-document sentinels retrieved,
|
|
318
|
+
// $1.62. The catalog is raised to the smallest probed-verified figure,
|
|
319
|
+
// rounded down; the advertised 1M is NOT assumed from an 800K pass.
|
|
320
|
+
context: 800_000,
|
|
321
|
+
maxOutput: 128_000,
|
|
322
|
+
input: ["text", "image", "pdf"],
|
|
323
|
+
cost: cost(2, 10, 0.2, 2.5),
|
|
324
|
+
intelligence: 56,
|
|
325
|
+
design: 90,
|
|
326
|
+
designEvidence: "curated",
|
|
327
|
+
tier: 3,
|
|
328
|
+
approved: true,
|
|
329
|
+
capabilities: { coding: 64, debugging: 72, agentic: 42, architecture: 88 },
|
|
330
|
+
notes:
|
|
331
|
+
"Plan model. Premier design and architecture quality. Funded from plan model credits, so routing here consumes escalation capacity rather than routine allowance. Capabilities: Terminal-Bench 4.0 64 percent, AutomationBench 72 percent, FrontierCode 2.0 42 percent (Artificial Analysis v5.0.1, 2026-11-06, max reasoning; independent evaluations, not guarantees); architecture 88 curated. Auto-approved for tier-3 escalation by owner instruction 2026-11-06. Context probed 2026-11-06: 800K verified end-to-end (819,383 prompt tokens accepted, sentinels at start/middle/end retrieved, no truncation, $1.62); advertised 1M remains unverified.",
|
|
332
|
+
}),
|
|
333
|
+
spec("gpt-6-sol", "GPT-6 Sol", {
|
|
334
|
+
context: 304_000,
|
|
335
|
+
maxOutput: 32_000,
|
|
336
|
+
input: ["text", "image", "pdf"],
|
|
337
|
+
cost: tieredCost(cost(2, 10, 0.2, 2.5)[0]!, 272_000, { input: 4, output: 15, read: 0.4, write: 5 }),
|
|
338
|
+
intelligence: 0,
|
|
339
|
+
design: 88,
|
|
340
|
+
designEvidence: "unverified",
|
|
341
|
+
tier: 3,
|
|
342
|
+
approved: false,
|
|
343
|
+
notes: "Plan model. Unscored in the router's curated set. Explicit approval required.",
|
|
344
|
+
}),
|
|
345
|
+
spec("gpt-6.1-sol", "GPT-6.1 Sol", {
|
|
346
|
+
// Probed 2026-11-06: one request with 820,701 prompt tokens returned 200,
|
|
347
|
+
// finish stop, all three sentinels retrieved, $2.74 - and the long-context
|
|
348
|
+
// surcharge (input $4/M above 272K) was billed, confirming tiered pricing
|
|
349
|
+
// applies exactly as cataloged. Raised to 800K (verified), not 1M.
|
|
350
|
+
context: 800_000,
|
|
351
|
+
maxOutput: 128_000,
|
|
352
|
+
input: ["text", "image", "pdf"],
|
|
353
|
+
cost: tieredCost(cost(2, 10, 0.1, 2.5)[0]!, 272_000, { input: 4, output: 15, read: 0.2, write: 5 }),
|
|
354
|
+
intelligence: 55,
|
|
355
|
+
design: 88,
|
|
356
|
+
designEvidence: "unverified",
|
|
357
|
+
tier: 3,
|
|
358
|
+
approved: true,
|
|
359
|
+
capabilities: { coding: 56, debugging: 65, agentic: 41, architecture: 86 },
|
|
360
|
+
notes:
|
|
361
|
+
"Plan model. Intelligence 55 on Artificial Analysis v5.0.1 (2026-11-06), tied with Sonnet 5.5 on that index; the per-kind capabilities break the tie toward Sonnet for agentic coding. Sol used far fewer generated tokens on the same suite, so it stays the cheaper tier-3 route on short fresh contexts. Capabilities: Terminal-Bench 4.0 56 percent, AutomationBench 65 percent, FrontierCode 2.0 41 percent, same index and configuration. Architecture 86 curated. Long-context tier doubles input to 4 and raises output to 15 above 272K. Auto-approved for tier-3 escalation by owner instruction 2026-11-06. Context probed 2026-11-06: 800K verified end-to-end (820,701 prompt tokens accepted with sentinels retrieved, no truncation, $2.74 billed at the tiered long-context rate); advertised 1M remains unverified.",
|
|
362
|
+
}),
|
|
363
|
+
spec("gpt-6-astra", "GPT-6 Astra", {
|
|
364
|
+
context: 400_000,
|
|
365
|
+
maxOutput: 128_000,
|
|
366
|
+
input: ["text", "image", "pdf"],
|
|
367
|
+
cost: tieredCost(cost(10, 50, 1, 12.5)[0]!, 272_000, { input: 20, output: 75, read: 2, write: 25 }),
|
|
368
|
+
intelligence: 0,
|
|
369
|
+
design: 88,
|
|
370
|
+
designEvidence: "unverified",
|
|
371
|
+
tier: 3,
|
|
372
|
+
approved: false,
|
|
373
|
+
notes: "Plan model, frontier-priced. Never selected automatically without explicit approval.",
|
|
374
|
+
}),
|
|
375
|
+
spec("claude-opus-5.5", "Claude Opus 5.5", {
|
|
376
|
+
context: 328_000,
|
|
377
|
+
maxOutput: 128_000,
|
|
378
|
+
input: ["text", "image", "pdf"],
|
|
379
|
+
cost: cost(4, 20, 0.2, 5),
|
|
380
|
+
intelligence: 0,
|
|
381
|
+
design: 92,
|
|
382
|
+
designEvidence: "unverified",
|
|
383
|
+
tier: 3,
|
|
384
|
+
approved: false,
|
|
385
|
+
notes: "Plan model. Unscored. Explicit approval required.",
|
|
386
|
+
}),
|
|
387
|
+
spec("claude-opus-5", "Claude Opus 5", {
|
|
388
|
+
context: 232_000,
|
|
389
|
+
maxOutput: 32_000,
|
|
390
|
+
input: ["text", "image", "pdf"],
|
|
391
|
+
cost: cost(5, 25, 0.5, 6.25),
|
|
392
|
+
intelligence: 0,
|
|
393
|
+
design: 91,
|
|
394
|
+
designEvidence: "unverified",
|
|
395
|
+
tier: 3,
|
|
396
|
+
approved: false,
|
|
397
|
+
notes: "Plan model. Unscored. Explicit approval required.",
|
|
398
|
+
}),
|
|
399
|
+
spec("claude-opus-4.8", "Claude Opus 4.8", {
|
|
400
|
+
context: 232_000,
|
|
401
|
+
maxOutput: 32_000,
|
|
402
|
+
input: ["text", "image", "pdf"],
|
|
403
|
+
cost: cost(5, 25, 0.5, 6.25),
|
|
404
|
+
intelligence: 0,
|
|
405
|
+
design: 90,
|
|
406
|
+
designEvidence: "unverified",
|
|
407
|
+
tier: 3,
|
|
408
|
+
approved: false,
|
|
409
|
+
notes: "Plan model. Unscored. Explicit approval required.",
|
|
410
|
+
}),
|
|
411
|
+
spec("claude-sonnet-5", "Claude Sonnet 5", {
|
|
412
|
+
context: 232_000,
|
|
413
|
+
maxOutput: 32_000,
|
|
414
|
+
input: ["text", "image", "pdf"],
|
|
415
|
+
cost: cost(2, 10, 0.2, 2.5),
|
|
416
|
+
intelligence: 0,
|
|
417
|
+
design: 88,
|
|
418
|
+
designEvidence: "unverified",
|
|
419
|
+
tier: 3,
|
|
420
|
+
approved: false,
|
|
421
|
+
notes: "Plan model. Unscored. Explicit approval required.",
|
|
422
|
+
}),
|
|
423
|
+
spec("claude-fable-5.1", "Claude Fable 5.1", {
|
|
424
|
+
context: 328_000,
|
|
425
|
+
maxOutput: 128_000,
|
|
426
|
+
input: ["text", "image", "pdf"],
|
|
427
|
+
cost: cost(10, 50, 0.25, 12.5),
|
|
428
|
+
intelligence: 0,
|
|
429
|
+
design: 90,
|
|
430
|
+
designEvidence: "unverified",
|
|
431
|
+
tier: 3,
|
|
432
|
+
approved: false,
|
|
433
|
+
notes: "Plan model, frontier-priced. Never selected automatically without explicit approval.",
|
|
434
|
+
}),
|
|
435
|
+
spec("claude-fable-5", "Claude Fable 5", {
|
|
436
|
+
context: 232_000,
|
|
437
|
+
maxOutput: 32_000,
|
|
438
|
+
input: ["text", "image", "pdf"],
|
|
439
|
+
cost: cost(10, 50, 1, 12.5),
|
|
440
|
+
intelligence: 0,
|
|
441
|
+
design: 89,
|
|
442
|
+
designEvidence: "unverified",
|
|
443
|
+
tier: 3,
|
|
444
|
+
approved: false,
|
|
445
|
+
notes: "Plan model, frontier-priced. Never selected automatically without explicit approval.",
|
|
446
|
+
}),
|
|
447
|
+
spec("muse-spark-1.3", "Muse Spark 1.3", {
|
|
448
|
+
context: 1_048_000,
|
|
449
|
+
maxOutput: 32_000,
|
|
450
|
+
input: ["text", "image", "video", "pdf", "audio"],
|
|
451
|
+
cost: cost(1.25, 4.25, 0.15),
|
|
452
|
+
intelligence: 48.1,
|
|
453
|
+
design: 82,
|
|
454
|
+
designEvidence: "curated",
|
|
455
|
+
tier: 3,
|
|
456
|
+
approved: false,
|
|
457
|
+
notes:
|
|
458
|
+
"Plan model. Strong design quality and a 1,048,000-token window. Funded from plan model credits; escalate here deliberately, not by default.",
|
|
459
|
+
}),
|
|
460
|
+
spec("muse-wonder", "Muse Wonder", {
|
|
461
|
+
context: 232_000,
|
|
462
|
+
maxOutput: 32_000,
|
|
463
|
+
input: ["text", "image", "video", "pdf", "audio"],
|
|
464
|
+
cost: cost(4, 20, 0.2),
|
|
465
|
+
intelligence: 0,
|
|
466
|
+
design: 86,
|
|
467
|
+
designEvidence: "unverified",
|
|
468
|
+
tier: 3,
|
|
469
|
+
approved: false,
|
|
470
|
+
notes: "Plan model. Unscored. Explicit approval required.",
|
|
471
|
+
}),
|
|
472
|
+
spec("gemini-4-argon", "Gemini 4 Argon", {
|
|
473
|
+
context: 264_000,
|
|
474
|
+
maxOutput: 64_000,
|
|
475
|
+
input: ["text", "image", "video", "audio", "pdf"],
|
|
476
|
+
cost: cost(2, 10, 0.1),
|
|
477
|
+
intelligence: 0,
|
|
478
|
+
design: 85,
|
|
479
|
+
designEvidence: "unverified",
|
|
480
|
+
tier: 3,
|
|
481
|
+
approved: false,
|
|
482
|
+
notes: "Plan model. Unscored. Explicit approval required.",
|
|
483
|
+
}),
|
|
484
|
+
spec("gemini-3.8-flash", "Gemini 3.8 Flash", {
|
|
485
|
+
context: 264_000,
|
|
486
|
+
maxOutput: 64_000,
|
|
487
|
+
input: ["text", "image", "video", "audio", "pdf"],
|
|
488
|
+
cost: cost(0.75, 3.75, 0.075),
|
|
489
|
+
intelligence: 0,
|
|
490
|
+
design: 78,
|
|
491
|
+
designEvidence: "unverified",
|
|
492
|
+
tier: 3,
|
|
493
|
+
approved: false,
|
|
494
|
+
notes: "Plan model. Unscored. Explicit approval required.",
|
|
495
|
+
}),
|
|
496
|
+
spec("gemini-3.7-flash", "Gemini 3.7 Flash", {
|
|
497
|
+
context: 232_000,
|
|
498
|
+
maxOutput: 32_000,
|
|
499
|
+
input: ["text", "image", "video", "audio", "pdf"],
|
|
500
|
+
cost: cost(0.75, 3.75, 0.075),
|
|
501
|
+
intelligence: 0,
|
|
502
|
+
design: 76,
|
|
503
|
+
designEvidence: "unverified",
|
|
504
|
+
tier: 3,
|
|
505
|
+
approved: false,
|
|
506
|
+
notes: "Plan model. Unscored. Explicit approval required.",
|
|
507
|
+
}),
|
|
508
|
+
spec("kimi-k3", "Kimi K3", {
|
|
509
|
+
context: 232_000,
|
|
510
|
+
maxOutput: 32_000,
|
|
511
|
+
input: ["text", "image", "video"],
|
|
512
|
+
cost: cost(3, 15, 0.3, 3),
|
|
513
|
+
intelligence: 43.6,
|
|
514
|
+
design: 72,
|
|
515
|
+
designEvidence: "curated",
|
|
516
|
+
tier: 3,
|
|
517
|
+
approved: false,
|
|
518
|
+
notes: "Plan model. Strong design quality; funded from plan model credits.",
|
|
519
|
+
}),
|
|
520
|
+
spec("kimi-k3.1-pro", "Kimi K3.1 Pro", {
|
|
521
|
+
context: 232_000,
|
|
522
|
+
maxOutput: 32_000,
|
|
523
|
+
input: ["text", "image", "video"],
|
|
524
|
+
cost: cost(2, 10, 0.2, 2),
|
|
525
|
+
intelligence: 0,
|
|
526
|
+
design: 75,
|
|
527
|
+
designEvidence: "unverified",
|
|
528
|
+
tier: 3,
|
|
529
|
+
approved: false,
|
|
530
|
+
notes: "Plan model. Unscored. Explicit approval required.",
|
|
531
|
+
}),
|
|
532
|
+
spec("grok-4.7", "Grok 4.7", {
|
|
533
|
+
context: 328_000,
|
|
534
|
+
maxOutput: 128_000,
|
|
535
|
+
input: ["text", "image", "pdf"],
|
|
536
|
+
cost: tieredCost(cost(2, 6, 0.5)[0]!, 200_000, { input: 4, output: 12, read: 1, write: 0 }),
|
|
537
|
+
intelligence: 46.4,
|
|
538
|
+
design: 75,
|
|
539
|
+
designEvidence: "curated",
|
|
540
|
+
tier: 3,
|
|
541
|
+
approved: false,
|
|
542
|
+
notes: "Plan model. Funded from plan model credits.",
|
|
543
|
+
}),
|
|
544
|
+
spec("grok-4.6", "Grok 4.6", {
|
|
545
|
+
context: 232_000,
|
|
546
|
+
maxOutput: 32_000,
|
|
547
|
+
input: ["text", "image", "pdf"],
|
|
548
|
+
cost: tieredCost(cost(2, 6, 0.5)[0]!, 200_000, { input: 4, output: 12, read: 1, write: 0 }),
|
|
549
|
+
intelligence: 0,
|
|
550
|
+
design: 74,
|
|
551
|
+
designEvidence: "unverified",
|
|
552
|
+
tier: 3,
|
|
553
|
+
approved: false,
|
|
554
|
+
notes: "Plan model. Unscored. Explicit approval required.",
|
|
555
|
+
}),
|
|
556
|
+
spec("grok-4.5", "Grok 4.5", {
|
|
557
|
+
context: 232_000,
|
|
558
|
+
maxOutput: 32_000,
|
|
559
|
+
input: ["text", "image", "pdf"],
|
|
560
|
+
cost: tieredCost(cost(2, 6, 0.5)[0]!, 200_000, { input: 4, output: 12, read: 0.6, write: 0 }),
|
|
561
|
+
intelligence: 0,
|
|
562
|
+
design: 72,
|
|
563
|
+
designEvidence: "unverified",
|
|
564
|
+
tier: 3,
|
|
565
|
+
approved: false,
|
|
566
|
+
notes: "Plan model. Unscored. Explicit approval required.",
|
|
567
|
+
}),
|
|
568
|
+
spec("gpt-5.6-sol", "GPT-5.6 Sol", {
|
|
569
|
+
context: 304_000,
|
|
570
|
+
maxOutput: 32_000,
|
|
571
|
+
input: ["text", "image", "pdf"],
|
|
572
|
+
cost: tieredCost(cost(4, 20, 0.4, 5)[0]!, 272_000, { input: 8, output: 30, read: 0.8, write: 10 }),
|
|
573
|
+
intelligence: 0,
|
|
574
|
+
design: 85,
|
|
575
|
+
designEvidence: "unverified",
|
|
576
|
+
tier: 3,
|
|
577
|
+
approved: false,
|
|
578
|
+
notes: "Plan model. Unscored. Explicit approval required.",
|
|
579
|
+
}),
|
|
580
|
+
spec("gpt-5.6-terra", "GPT-5.6 Terra", {
|
|
581
|
+
context: 304_000,
|
|
582
|
+
maxOutput: 32_000,
|
|
583
|
+
input: ["text", "image", "pdf"],
|
|
584
|
+
cost: tieredCost(cost(2, 12, 0.2, 2.5)[0]!, 272_000, { input: 4, output: 18, read: 0.4, write: 5 }),
|
|
585
|
+
intelligence: 0,
|
|
586
|
+
design: 84,
|
|
587
|
+
designEvidence: "unverified",
|
|
588
|
+
tier: 3,
|
|
589
|
+
approved: false,
|
|
590
|
+
notes: "Plan model. Unscored. Explicit approval required.",
|
|
591
|
+
}),
|
|
592
|
+
spec("gpt-5.6-luna", "GPT-5.6 Luna", {
|
|
593
|
+
context: 304_000,
|
|
594
|
+
maxOutput: 32_000,
|
|
595
|
+
input: ["text", "image", "pdf"],
|
|
596
|
+
cost: tieredCost(cost(0.2, 1.2, 0.02, 0.25)[0]!, 272_000, { input: 0.4, output: 1.8, read: 0.04, write: 0.5 }),
|
|
597
|
+
intelligence: 0,
|
|
598
|
+
design: 60,
|
|
599
|
+
designEvidence: "unverified",
|
|
600
|
+
tier: 3,
|
|
601
|
+
approved: false,
|
|
602
|
+
notes: "Plan model. Unscored. Explicit approval required.",
|
|
603
|
+
}),
|
|
604
|
+
spec("gpt-6.1-terra", "GPT-6.1 Terra", {
|
|
605
|
+
context: 304_000,
|
|
606
|
+
maxOutput: 32_000,
|
|
607
|
+
input: ["text", "image", "pdf"],
|
|
608
|
+
cost: tieredCost(cost(2, 12, 0.2, 2.5)[0]!, 272_000, { input: 4, output: 18, read: 0.4, write: 5 }),
|
|
609
|
+
intelligence: 0,
|
|
610
|
+
design: 87,
|
|
611
|
+
designEvidence: "unverified",
|
|
612
|
+
tier: 3,
|
|
613
|
+
approved: false,
|
|
614
|
+
notes: "Plan model. Unscored. Explicit approval required.",
|
|
615
|
+
}),
|
|
616
|
+
spec("qwen3.7-max", "Qwen3.7 Max", {
|
|
617
|
+
context: 232_000,
|
|
618
|
+
maxOutput: 32_000,
|
|
619
|
+
input: ["text", "image", "video"],
|
|
620
|
+
cost: cost(2.5, 7.5, 0.5, 3.125),
|
|
621
|
+
intelligence: 0,
|
|
622
|
+
design: 70,
|
|
623
|
+
designEvidence: "unverified",
|
|
624
|
+
tier: 3,
|
|
625
|
+
approved: false,
|
|
626
|
+
notes: "Plan model. Unscored. Explicit approval required.",
|
|
627
|
+
}),
|
|
628
|
+
spec("glm-5.2", "GLM-5.2", {
|
|
629
|
+
context: 232_000,
|
|
630
|
+
maxOutput: 32_000,
|
|
631
|
+
input: ["text"],
|
|
632
|
+
cost: cost(1.4, 4.4, 0.26),
|
|
633
|
+
intelligence: 0,
|
|
634
|
+
design: 78,
|
|
635
|
+
designEvidence: "unverified",
|
|
636
|
+
tier: 3,
|
|
637
|
+
approved: false,
|
|
638
|
+
notes: "Plan model. Unscored and text only. Explicit approval required.",
|
|
639
|
+
}),
|
|
640
|
+
]
|
|
641
|
+
|
|
642
|
+
export const OPEN_DESIGN_MODEL_BY_ID: ReadonlyMap<string, OpenDesignModelSpec> = new Map(
|
|
643
|
+
OPENDESIGN_MODELS.map((model) => [model.modelID, model]),
|
|
644
|
+
)
|
|
645
|
+
|
|
646
|
+
/** Models whose multiplier is not published, exposed for status reporting. */
|
|
647
|
+
export const OPENDESIGN_MODELS_WITHOUT_PUBLISHED_MULTIPLIER: readonly string[] = [
|
|
648
|
+
...OPENDESIGN_UNPUBLISHED_MULTIPLIER_MODELS,
|
|
649
|
+
]
|
|
650
|
+
|
|
651
|
+
/** Models funded from the separate plan model pool. */
|
|
652
|
+
export const OPENDESIGN_PLAN_MODEL_IDS: readonly string[] = OPENDESIGN_MODELS
|
|
653
|
+
.filter((model) => !OPENDESIGN_DESIGN_PLAN_MODELS.has(model.modelID))
|
|
654
|
+
.map((model) => model.modelID)
|