@shop-os/modelkit 0.1.8 → 0.1.9
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 +166 -0
- package/README.md +4 -0
- package/dist/catalog.cjs +109 -10
- package/dist/catalog.cjs.map +1 -1
- package/dist/catalog.d.cts +23 -2
- package/dist/catalog.d.ts +23 -2
- package/dist/catalog.js +109 -10
- package/dist/catalog.js.map +1 -1
- package/dist/index.cjs +109 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -2
- package/dist/index.d.ts +23 -2
- package/dist/index.js +109 -10
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `@shop-os/modelkit`. The format follows
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Dates are npm publish dates.
|
|
5
|
+
|
|
6
|
+
A release is a PR that touches only `packages/modelkit/**` and bumps `version`; merging it to
|
|
7
|
+
`dev` publishes. Add an entry under **Unreleased** with the change, and move it under the version
|
|
8
|
+
header in the release PR.
|
|
9
|
+
|
|
10
|
+
## [Unreleased]
|
|
11
|
+
|
|
12
|
+
## [0.1.9] - unreleased (publish pending)
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
- `display.sortOrder`: pickers show lower values first, then catalog order; set it to surface a
|
|
16
|
+
new model at the top.
|
|
17
|
+
- `usage.slug` and `usage.providerLabel`: an app's historic usage-event names for a row, so
|
|
18
|
+
metering continuity no longer needs a per-model table in the app.
|
|
19
|
+
- Text rows carry their stream tuning: `providerOptions` (Anthropic thinking / adaptive, OpenAI
|
|
20
|
+
reasoning summaries, DeepSeek thinking), `capabilities.reasoning`, and `defaults.temperature`
|
|
21
|
+
(Kimi rows).
|
|
22
|
+
- `constraints.exactSizes` on the gpt-image-2 rows: the historic WxH per aspect ratio that Cowork
|
|
23
|
+
sends as `exactSize`.
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
- `deepseek-flash` (DeepSeek V4.1 Flash) replaces the `deepseek-v4-flash` row; the old id is an
|
|
27
|
+
alias, so stored selections and plan lists keep resolving. DeepSeek retired V4 Flash upstream and
|
|
28
|
+
serves the old id from V4.1 Flash at Flash rates.
|
|
29
|
+
- `resolveVideoOptions` enforces conditioning compatibility: a `sourceVideo` on a row without
|
|
30
|
+
`capabilities.acceptsSourceVideo`, or frames next to references on a row with
|
|
31
|
+
`framesExcludeReferences`, is an `unsupported_option` error, or is dropped with a warning
|
|
32
|
+
under `onUnsupported: "coerce"`.
|
|
33
|
+
|
|
34
|
+
## [0.1.8] - 2026-09-11
|
|
35
|
+
|
|
36
|
+
### Added
|
|
37
|
+
- `exposure: "catalog" | "internal"` is required on every row. `catalog` rows are offered in
|
|
38
|
+
product pickers (Creative Studio, chat, Space Builder); `internal` rows are callable by id
|
|
39
|
+
only. 47 rows are `catalog`. A snapshot test pins the set.
|
|
40
|
+
- `display.costTier` (1 to 3) and `display.recommended` on text rows, for the chat picker.
|
|
41
|
+
- `constraints.qualityOptions` on rows that support `quality`; `constraints.durationPresets`
|
|
42
|
+
where the UI offers a short list over a duration range. `resolveOptions` ignores both.
|
|
43
|
+
- `@shop-os/modelkit/catalog`: a browser-safe subpath with `Catalog`, `MODELS`, the per-type
|
|
44
|
+
arrays, `resolveOptions`, the error types and every type. No adapter, client, key handling
|
|
45
|
+
or provider SDK is reachable from it; a test walks the import graph.
|
|
46
|
+
- Alias `meta-muse` on `muse-image-1.0`.
|
|
47
|
+
|
|
48
|
+
### Changed
|
|
49
|
+
- Labels: `gemini-3.1-flash-image-preview` is "Nano Banana 2" again and `gpt-image-2` is
|
|
50
|
+
"GPT-image-2" (the 0.1.7 labels read as different models in the picker).
|
|
51
|
+
- `Catalog` rejects duplicate ids and aliases across rows.
|
|
52
|
+
- `veo-3.1-lite` offers 720p and 1080p only; Google publishes no 4k rate for it.
|
|
53
|
+
|
|
54
|
+
## [0.1.7] - 2026-09-10
|
|
55
|
+
|
|
56
|
+
### Added
|
|
57
|
+
- `display { provider, description, logo? }` and `capabilities` (`imageGenerate`,
|
|
58
|
+
`imageEdit`, `acceptsSourceVideo`, `framesExcludeReferences`, `vision`, `tools`,
|
|
59
|
+
`structuredOutput`, `contextWindow`) on every active row, so a UI can render a picker from
|
|
60
|
+
`kit.catalog.list()` without a hand-written catalog. The nine Cowork picker rows keep their
|
|
61
|
+
descriptions and logos verbatim.
|
|
62
|
+
|
|
63
|
+
## [0.1.6] - 2026-09-10
|
|
64
|
+
|
|
65
|
+
### Added
|
|
66
|
+
- `MediaRef.label`: a text part before the media on Gemini image and Omni.
|
|
67
|
+
- `ImageRequest.temperature` (Gemini image) and `ImageRequest.upscale` (Topaz enhance model,
|
|
68
|
+
subject detection, face enhancement with creativity and strength; face enhancement off by
|
|
69
|
+
default).
|
|
70
|
+
- `VideoRequest.watermark` (Seedance) and `VideoRequest.safetyChecker` (fal MiniMax).
|
|
71
|
+
- MiniMax base rows accept `lastFrame`; Seedream 4.5 gets the 4K tier and 9:21.
|
|
72
|
+
|
|
73
|
+
### Changed
|
|
74
|
+
- `onUnsupported: "error"` now covers aspect ratio and duration as well as size and
|
|
75
|
+
resolution. **Breaking** for callers that relied on silent snapping: pass `"coerce"`.
|
|
76
|
+
- Aborts are never retried and are forwarded to OpenAI, Replicate, Prodia, Ark and reference
|
|
77
|
+
downloads. One retry policy across adapters.
|
|
78
|
+
- Gateway token is required only for vendors that go through the gateway; the
|
|
79
|
+
enterprise-to-pro key fallback is logged.
|
|
80
|
+
- Seedance poll keeps usage, duration, fps and resolution on `raw`; the token split lands on
|
|
81
|
+
the usage event. Grok sends `resolution` only when the caller set it.
|
|
82
|
+
- The unused OpenRouter text route is removed.
|
|
83
|
+
|
|
84
|
+
## [0.1.5] - 2026-09-10
|
|
85
|
+
|
|
86
|
+
### Fixed
|
|
87
|
+
- `size: "512"` reaches the adapter (Gemini 3.1 Flash requests were generated at 1K).
|
|
88
|
+
- Every status-less SDK throw is a retryable transport error; five adapters had classified
|
|
89
|
+
them as permanent.
|
|
90
|
+
- Grok `firstFrame` maps to the SDK's first frame (image-to-video); references capped at 7.
|
|
91
|
+
- Omni: `delivery: "uri"` and `store: true`, `firstFrame` runs image-to-video, references run
|
|
92
|
+
reference-to-video, no `resolution` on 1.0, uploads deleted after create.
|
|
93
|
+
|
|
94
|
+
### Changed
|
|
95
|
+
- `constraints.supports` undefined means "supports nothing"; every row carries an explicit list.
|
|
96
|
+
- `aspectRatio: "adaptive"` means "send no ratio" and is never coerced or defaulted.
|
|
97
|
+
- Usage `unit` comes from the catalog row; adapters supply quantities.
|
|
98
|
+
- Gemini `safetySettings` are per-call opt-in.
|
|
99
|
+
- fal direct video is queue submit plus poll, only the submit is retried; the fal client takes
|
|
100
|
+
the kit's `fetch`. Cloudflare gateway slugs `anthropic/v1` and `grok/v1`.
|
|
101
|
+
|
|
102
|
+
## [0.1.4] - 2026-09-10
|
|
103
|
+
|
|
104
|
+
### Added
|
|
105
|
+
- `topaz` row takes references and `scaleFactor` and returns `outputUrl` next to the bytes.
|
|
106
|
+
- Gemini image usage events carry input and output token counts.
|
|
107
|
+
- Aliases `claude-haiku-4` and `claude-sonnet-4-5-20250929`.
|
|
108
|
+
|
|
109
|
+
## [0.1.3] - 2026-09-10
|
|
110
|
+
|
|
111
|
+
### Fixed
|
|
112
|
+
- The remaining medium findings from the adoption review.
|
|
113
|
+
|
|
114
|
+
## [0.1.2] - 2026-09-10
|
|
115
|
+
|
|
116
|
+
### Added
|
|
117
|
+
- `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare` with the `xhigh` and `max` quality tiers.
|
|
118
|
+
- Aliases `gpt-5.1-mini` and `gpt-5.2-mini` on `gpt-5.4-mini`.
|
|
119
|
+
|
|
120
|
+
### Changed
|
|
121
|
+
- Google text goes through the gateway at `/google-ai-studio/v1beta`.
|
|
122
|
+
- Reasoning defaults are dropped from the text catalog.
|
|
123
|
+
- Seedance and Kling Omni keep last frames and seeds; Google transport failures retry.
|
|
124
|
+
|
|
125
|
+
### Fixed
|
|
126
|
+
- The seven blocking findings from the adoption review.
|
|
127
|
+
|
|
128
|
+
## [0.1.1] - 2026-09-09
|
|
129
|
+
|
|
130
|
+
### Added
|
|
131
|
+
- `generateText`, `streamText`, `generateObject`, `streamObject` with catalog models. The
|
|
132
|
+
package re-exports every `ai` export, so `from "ai"` becomes `from "@shop-os/modelkit"`.
|
|
133
|
+
- `generateAudio` (Lyria 3, Lyria 2, MMAudio) and `prepareMediaPart` for video understanding.
|
|
134
|
+
- `generateImage` accepts the `upscale` and `bg-remove` catalog types, `n`, exact `WxH` sizes.
|
|
135
|
+
- Catalog rows for every id the apps still sent to direct SDKs; retired Claude 4.0 ids alias to
|
|
136
|
+
Sonnet 4.6 and Opus 4.8; fal passthrough with a gateway-stored key.
|
|
137
|
+
|
|
138
|
+
### Fixed
|
|
139
|
+
- Text keys fall back per provider; dotted Claude aliases; native DeepSeek, Moonshot and
|
|
140
|
+
Perplexity providers; AI SDK-shaped `providerOptions`.
|
|
141
|
+
- gpt-image-2 edit sent `input_fidelity`, which the API rejects; a filtered Gemini prompt maps
|
|
142
|
+
to `content_blocked`; `@google/genai` no longer switches to Vertex from the host env.
|
|
143
|
+
|
|
144
|
+
## [0.1.0] - 2026-09-09
|
|
145
|
+
|
|
146
|
+
First publish, renamed from `@shop-os/model-sdk`.
|
|
147
|
+
|
|
148
|
+
- Catalog of 74 models. The id is the pro-backend pricing key; every historical id is an alias.
|
|
149
|
+
- `resolveOptions` fills defaults, snaps the aspect ratio, errors or coerces on unsupported
|
|
150
|
+
size, resolution and duration, trims references.
|
|
151
|
+
- Ten adapters by provider API: AI SDK text, Gemini image, gpt-image-2, Google GenAI (Veo,
|
|
152
|
+
Omni, Lyria 3, video understanding), Ark, fal, Replicate, Prodia, Higgsfield, xAI video.
|
|
153
|
+
- Keys per tier (pro, enterprise with per-provider fallback); one retry classifier, one error
|
|
154
|
+
type, one usage event with the canonical id.
|
|
155
|
+
|
|
156
|
+
[Unreleased]: https://github.com/Shop-OS/shopos-backend-ts/compare/modelkit-0.1.9...dev
|
|
157
|
+
[0.1.9]: https://github.com/Shop-OS/shopos-backend-ts/compare/modelkit-0.1.8...dev
|
|
158
|
+
[0.1.8]: https://github.com/Shop-OS/shopos-backend-ts/commit/9661a109d
|
|
159
|
+
[0.1.7]: https://github.com/Shop-OS/shopos-backend-ts/commit/2d3d19ac2
|
|
160
|
+
[0.1.6]: https://github.com/Shop-OS/shopos-backend-ts/commit/f67fee08f
|
|
161
|
+
[0.1.5]: https://github.com/Shop-OS/shopos-backend-ts/commit/7f3f745ec
|
|
162
|
+
[0.1.4]: https://github.com/Shop-OS/shopos-backend-ts/commit/a2f3ffcc7
|
|
163
|
+
[0.1.3]: https://github.com/Shop-OS/shopos-backend-ts/commit/785960dbd
|
|
164
|
+
[0.1.2]: https://github.com/Shop-OS/shopos-backend-ts/commit/4581615e6
|
|
165
|
+
[0.1.1]: https://github.com/Shop-OS/shopos-backend-ts/commit/c159c97d3
|
|
166
|
+
[0.1.0]: https://github.com/Shop-OS/shopos-backend-ts/commit/6b70c91cf
|
package/README.md
CHANGED
|
@@ -181,3 +181,7 @@ Prompt construction, agent tools, node schemas and UI, S3 upload, credit reserve
|
|
|
181
181
|
## Live smoke test
|
|
182
182
|
|
|
183
183
|
`pnpm smoke [filter...]` runs one cheap real call per adapter (about $5 for the full matrix, 15 minutes, mostly video polling). Keys load from the `trigger-workflows`, `cowork`, and `vibe-triggers` env files next to this monorepo. Outputs land in `scripts/smoke-out/`. Run it before every release and after any adapter change. Never wire it into CI.
|
|
184
|
+
|
|
185
|
+
## Changelog
|
|
186
|
+
|
|
187
|
+
See [CHANGELOG.md](./CHANGELOG.md). Add an entry under Unreleased with every change; the release PR moves it under the version header.
|
package/dist/catalog.cjs
CHANGED
|
@@ -165,7 +165,7 @@ function geminiImage(id, label, aliases, sizes, display, exposure) {
|
|
|
165
165
|
supports: ["safetySettings", "temperature"]
|
|
166
166
|
},
|
|
167
167
|
defaults: { size: "1K", aspectRatio: "1:1" },
|
|
168
|
-
usage: { ...IMAGE_USAGE },
|
|
168
|
+
usage: { ...IMAGE_USAGE, slug: "gemini" },
|
|
169
169
|
pricingKind: "image_size",
|
|
170
170
|
display,
|
|
171
171
|
capabilities: { ...IMAGE_GENERATE_EDIT }
|
|
@@ -233,6 +233,15 @@ var IMAGE_MODELS = [
|
|
|
233
233
|
lifecycle: "active",
|
|
234
234
|
exposure: "catalog",
|
|
235
235
|
constraints: {
|
|
236
|
+
exactSizes: {
|
|
237
|
+
"1:1": "1024x1024",
|
|
238
|
+
"3:2": "1536x1024",
|
|
239
|
+
"2:3": "1024x1536",
|
|
240
|
+
"16:9": "2048x1152",
|
|
241
|
+
"9:16": "1152x2048",
|
|
242
|
+
"4:5": "1024x1280",
|
|
243
|
+
"5:4": "1280x1024"
|
|
244
|
+
},
|
|
236
245
|
aspectRatios: ["1:1", "3:2", "2:3", "16:9", "9:16", "4:5", "5:4", "adaptive"],
|
|
237
246
|
sizes: ["1K", "2K", "4K"],
|
|
238
247
|
qualityOptions: ["auto", "low", "medium", "high"],
|
|
@@ -240,7 +249,7 @@ var IMAGE_MODELS = [
|
|
|
240
249
|
supports: ["quality", "count"]
|
|
241
250
|
},
|
|
242
251
|
defaults: { size: "1K", aspectRatio: "adaptive", quality: "auto" },
|
|
243
|
-
usage: { ...IMAGE_USAGE },
|
|
252
|
+
usage: { ...IMAGE_USAGE, slug: "gpt" },
|
|
244
253
|
pricingKind: "image_size",
|
|
245
254
|
display: {
|
|
246
255
|
provider: "openai",
|
|
@@ -260,6 +269,15 @@ var IMAGE_MODELS = [
|
|
|
260
269
|
lifecycle: "active",
|
|
261
270
|
exposure: "internal",
|
|
262
271
|
constraints: {
|
|
272
|
+
exactSizes: {
|
|
273
|
+
"1:1": "1024x1024",
|
|
274
|
+
"3:2": "1536x1024",
|
|
275
|
+
"2:3": "1024x1536",
|
|
276
|
+
"16:9": "2048x1152",
|
|
277
|
+
"9:16": "1152x2048",
|
|
278
|
+
"4:5": "1024x1280",
|
|
279
|
+
"5:4": "1280x1024"
|
|
280
|
+
},
|
|
263
281
|
aspectRatios: ["1:1", "3:2", "2:3", "16:9", "9:16", "4:5", "5:4", "adaptive"],
|
|
264
282
|
sizes: ["1K", "2K", "4K"],
|
|
265
283
|
qualityOptions: ["auto", "low", "medium", "high"],
|
|
@@ -286,6 +304,15 @@ var IMAGE_MODELS = [
|
|
|
286
304
|
lifecycle: "active",
|
|
287
305
|
exposure: "internal",
|
|
288
306
|
constraints: {
|
|
307
|
+
exactSizes: {
|
|
308
|
+
"1:1": "1024x1024",
|
|
309
|
+
"3:2": "1536x1024",
|
|
310
|
+
"2:3": "1024x1536",
|
|
311
|
+
"16:9": "2048x1152",
|
|
312
|
+
"9:16": "1152x2048",
|
|
313
|
+
"4:5": "1024x1280",
|
|
314
|
+
"5:4": "1280x1024"
|
|
315
|
+
},
|
|
289
316
|
aspectRatios: ["1:1", "3:2", "2:3", "16:9", "9:16", "4:5", "5:4", "adaptive"],
|
|
290
317
|
sizes: ["1K", "2K", "4K"],
|
|
291
318
|
qualityOptions: ["auto", "low", "medium", "high"],
|
|
@@ -331,7 +358,7 @@ var IMAGE_MODELS = [
|
|
|
331
358
|
supports: ["count", "outputFormat"]
|
|
332
359
|
},
|
|
333
360
|
defaults: { size: "1K", aspectRatio: "1:1", outputFormat: "png", count: 1 },
|
|
334
|
-
usage: { ...IMAGE_USAGE },
|
|
361
|
+
usage: { ...IMAGE_USAGE, slug: "muse" },
|
|
335
362
|
pricingKind: "image_size",
|
|
336
363
|
display: {
|
|
337
364
|
provider: "meta",
|
|
@@ -748,6 +775,14 @@ function text(id, label, providerModelId, extra) {
|
|
|
748
775
|
...extra
|
|
749
776
|
};
|
|
750
777
|
}
|
|
778
|
+
var ANTHROPIC_THINKING = {
|
|
779
|
+
anthropic: { thinking: { type: "enabled", budgetTokens: 4e3 }, sendReasoning: true }
|
|
780
|
+
};
|
|
781
|
+
var ANTHROPIC_ADAPTIVE = {
|
|
782
|
+
anthropic: { thinking: { type: "adaptive", display: "summarized" }, sendReasoning: true }
|
|
783
|
+
};
|
|
784
|
+
var OPENAI_REASONING = { openai: { reasoningEffort: "medium", reasoningSummary: "auto" } };
|
|
785
|
+
var DEEPSEEK_THINKING = { deepseek: { thinking: { type: "enabled" } } };
|
|
751
786
|
var TEXT_MODELS = [
|
|
752
787
|
text("gpt-4o", "GPT-4o", "gpt-4o", {
|
|
753
788
|
exposure: "internal",
|
|
@@ -826,6 +861,7 @@ var TEXT_MODELS = [
|
|
|
826
861
|
}
|
|
827
862
|
}),
|
|
828
863
|
text("gpt-5.6-luna", "GPT-5.6 Luna", "gpt-5.6-luna", {
|
|
864
|
+
providerOptions: OPENAI_REASONING,
|
|
829
865
|
exposure: "catalog",
|
|
830
866
|
display: {
|
|
831
867
|
provider: "openai",
|
|
@@ -833,6 +869,7 @@ var TEXT_MODELS = [
|
|
|
833
869
|
description: "OpenAI GPT-5.6 Luna cost-optimized tier of the GPT-5.6 reasoning family; text and image input, 1.05M-token context."
|
|
834
870
|
},
|
|
835
871
|
capabilities: {
|
|
872
|
+
reasoning: true,
|
|
836
873
|
vision: true,
|
|
837
874
|
tools: true,
|
|
838
875
|
structuredOutput: true,
|
|
@@ -840,6 +877,7 @@ var TEXT_MODELS = [
|
|
|
840
877
|
}
|
|
841
878
|
}),
|
|
842
879
|
text("gpt-5.6-terra", "GPT-5.6 Terra", "gpt-5.6-terra", {
|
|
880
|
+
providerOptions: OPENAI_REASONING,
|
|
843
881
|
exposure: "catalog",
|
|
844
882
|
display: {
|
|
845
883
|
provider: "openai",
|
|
@@ -847,6 +885,7 @@ var TEXT_MODELS = [
|
|
|
847
885
|
description: "OpenAI GPT-5.6 Terra balanced tier of the GPT-5.6 reasoning family; text and image input, 1.05M-token context."
|
|
848
886
|
},
|
|
849
887
|
capabilities: {
|
|
888
|
+
reasoning: true,
|
|
850
889
|
vision: true,
|
|
851
890
|
tools: true,
|
|
852
891
|
structuredOutput: true,
|
|
@@ -854,6 +893,7 @@ var TEXT_MODELS = [
|
|
|
854
893
|
}
|
|
855
894
|
}),
|
|
856
895
|
text("gpt-5.6-sol", "GPT-5.6 Sol", "gpt-5.6-sol", {
|
|
896
|
+
providerOptions: OPENAI_REASONING,
|
|
857
897
|
exposure: "catalog",
|
|
858
898
|
display: {
|
|
859
899
|
provider: "openai",
|
|
@@ -861,6 +901,7 @@ var TEXT_MODELS = [
|
|
|
861
901
|
description: "OpenAI GPT-5.6 Sol flagship tier of the GPT-5.6 reasoning family; text and image input, 1.05M-token context."
|
|
862
902
|
},
|
|
863
903
|
capabilities: {
|
|
904
|
+
reasoning: true,
|
|
864
905
|
vision: true,
|
|
865
906
|
tools: true,
|
|
866
907
|
structuredOutput: true,
|
|
@@ -880,6 +921,7 @@ var TEXT_MODELS = [
|
|
|
880
921
|
}),
|
|
881
922
|
// Anthropic retired the dated 4.0 ids; callers that still send them get 4.6.
|
|
882
923
|
text("claude-sonnet-4-6", "Claude Sonnet 4.6", "claude-sonnet-4-6", {
|
|
924
|
+
providerOptions: ANTHROPIC_THINKING,
|
|
883
925
|
exposure: "catalog",
|
|
884
926
|
aliases: [
|
|
885
927
|
"claude-sonnet-4.6",
|
|
@@ -893,6 +935,7 @@ var TEXT_MODELS = [
|
|
|
893
935
|
description: "Anthropic Claude Sonnet 4.6 (legacy) balanced model; text and image input, 1M-token context."
|
|
894
936
|
},
|
|
895
937
|
capabilities: {
|
|
938
|
+
reasoning: true,
|
|
896
939
|
vision: true,
|
|
897
940
|
tools: true,
|
|
898
941
|
structuredOutput: true,
|
|
@@ -900,6 +943,7 @@ var TEXT_MODELS = [
|
|
|
900
943
|
}
|
|
901
944
|
}),
|
|
902
945
|
text("claude-sonnet-5", "Claude Sonnet 5", "claude-sonnet-5", {
|
|
946
|
+
providerOptions: ANTHROPIC_ADAPTIVE,
|
|
903
947
|
exposure: "catalog",
|
|
904
948
|
display: {
|
|
905
949
|
provider: "anthropic",
|
|
@@ -907,6 +951,7 @@ var TEXT_MODELS = [
|
|
|
907
951
|
description: "Anthropic Claude Sonnet 5 current balanced model; text and image input, 1M-token context."
|
|
908
952
|
},
|
|
909
953
|
capabilities: {
|
|
954
|
+
reasoning: true,
|
|
910
955
|
vision: true,
|
|
911
956
|
tools: true,
|
|
912
957
|
structuredOutput: true,
|
|
@@ -914,6 +959,7 @@ var TEXT_MODELS = [
|
|
|
914
959
|
}
|
|
915
960
|
}),
|
|
916
961
|
text("claude-opus-4-8", "Claude Opus 4.8", "claude-opus-4-8", {
|
|
962
|
+
providerOptions: ANTHROPIC_ADAPTIVE,
|
|
917
963
|
exposure: "catalog",
|
|
918
964
|
aliases: ["claude-opus-4.8", "claude-opus-4", "claude-opus-4.0", "claude-opus-4-20250514"],
|
|
919
965
|
display: {
|
|
@@ -922,6 +968,7 @@ var TEXT_MODELS = [
|
|
|
922
968
|
description: "Anthropic Claude Opus 4.8 (legacy) frontier model; text and image input, 1M-token context."
|
|
923
969
|
},
|
|
924
970
|
capabilities: {
|
|
971
|
+
reasoning: true,
|
|
925
972
|
vision: true,
|
|
926
973
|
tools: true,
|
|
927
974
|
structuredOutput: true,
|
|
@@ -929,6 +976,7 @@ var TEXT_MODELS = [
|
|
|
929
976
|
}
|
|
930
977
|
}),
|
|
931
978
|
text("claude-haiku-4-5", "Claude Haiku 4.5", "claude-haiku-4-5", {
|
|
979
|
+
providerOptions: ANTHROPIC_THINKING,
|
|
932
980
|
exposure: "catalog",
|
|
933
981
|
aliases: ["claude-haiku-4.5", "claude-haiku-4-5-20251001", "claude-haiku-4"],
|
|
934
982
|
display: {
|
|
@@ -936,7 +984,13 @@ var TEXT_MODELS = [
|
|
|
936
984
|
costTier: 1,
|
|
937
985
|
description: "Anthropic Claude Haiku 4.5 fast model with near-frontier intelligence; text and image input, 200K-token context."
|
|
938
986
|
},
|
|
939
|
-
capabilities: {
|
|
987
|
+
capabilities: {
|
|
988
|
+
reasoning: true,
|
|
989
|
+
vision: true,
|
|
990
|
+
tools: true,
|
|
991
|
+
structuredOutput: true,
|
|
992
|
+
contextWindow: 2e5
|
|
993
|
+
}
|
|
940
994
|
}),
|
|
941
995
|
text("claude-opus-5", "Claude Opus 5", "claude-opus-5", {
|
|
942
996
|
exposure: "internal",
|
|
@@ -1128,15 +1182,21 @@ var TEXT_MODELS = [
|
|
|
1128
1182
|
contextWindow: 128e3
|
|
1129
1183
|
}
|
|
1130
1184
|
}),
|
|
1131
|
-
|
|
1185
|
+
// DeepSeek retired V4 Flash upstream and routes the old id to V4.1 Flash at
|
|
1186
|
+
// Flash rates (https://api-docs.deepseek.com/news/news260910/); the old id
|
|
1187
|
+
// stays an alias so stored selections keep resolving.
|
|
1188
|
+
text("deepseek-flash", "DeepSeek V4.1 Flash", "deepseek-flash", {
|
|
1189
|
+
providerOptions: DEEPSEEK_THINKING,
|
|
1190
|
+
aliases: ["deepseek-v4-flash"],
|
|
1132
1191
|
exposure: "catalog",
|
|
1133
1192
|
display: {
|
|
1134
1193
|
provider: "deepseek",
|
|
1135
1194
|
costTier: 1,
|
|
1136
1195
|
recommended: true,
|
|
1137
|
-
description: "DeepSeek V4 Flash thinking/non-thinking model with vision, tool calls, and JSON output; 1M-token context and up to 384K output tokens."
|
|
1196
|
+
description: "DeepSeek V4.1 Flash thinking/non-thinking model with vision, tool calls, and JSON output; 1M-token context and up to 384K output tokens."
|
|
1138
1197
|
},
|
|
1139
1198
|
capabilities: {
|
|
1199
|
+
reasoning: true,
|
|
1140
1200
|
vision: true,
|
|
1141
1201
|
tools: true,
|
|
1142
1202
|
structuredOutput: true,
|
|
@@ -1144,6 +1204,7 @@ var TEXT_MODELS = [
|
|
|
1144
1204
|
}
|
|
1145
1205
|
}),
|
|
1146
1206
|
text("deepseek-v4-pro", "DeepSeek V4 Pro", "deepseek-v4-pro", {
|
|
1207
|
+
providerOptions: DEEPSEEK_THINKING,
|
|
1147
1208
|
exposure: "catalog",
|
|
1148
1209
|
display: {
|
|
1149
1210
|
provider: "deepseek",
|
|
@@ -1151,6 +1212,7 @@ var TEXT_MODELS = [
|
|
|
1151
1212
|
description: "DeepSeek V4 Pro thinking/non-thinking text model with tool calls and JSON output (no vision); 1M-token context and up to 384K output tokens."
|
|
1152
1213
|
},
|
|
1153
1214
|
capabilities: {
|
|
1215
|
+
reasoning: true,
|
|
1154
1216
|
vision: false,
|
|
1155
1217
|
tools: true,
|
|
1156
1218
|
structuredOutput: true,
|
|
@@ -1174,6 +1236,7 @@ var TEXT_MODELS = [
|
|
|
1174
1236
|
}),
|
|
1175
1237
|
// Moonshot retired kimi-k2.5 on 2026-08-31 and no longer publishes its specs.
|
|
1176
1238
|
text("kimi-k2.5", "Kimi K2.5", "kimi-k2.5", {
|
|
1239
|
+
defaults: { temperature: 1 },
|
|
1177
1240
|
exposure: "catalog",
|
|
1178
1241
|
display: {
|
|
1179
1242
|
provider: "moonshot",
|
|
@@ -1183,6 +1246,7 @@ var TEXT_MODELS = [
|
|
|
1183
1246
|
capabilities: {}
|
|
1184
1247
|
}),
|
|
1185
1248
|
text("kimi-k3", "Kimi K3", "kimi-k3", {
|
|
1249
|
+
defaults: { temperature: 1 },
|
|
1186
1250
|
exposure: "catalog",
|
|
1187
1251
|
display: {
|
|
1188
1252
|
provider: "moonshot",
|
|
@@ -1190,6 +1254,7 @@ var TEXT_MODELS = [
|
|
|
1190
1254
|
description: "Moonshot Kimi K3 flagship model with native visual understanding and always-on thinking; text, image, and video input, 1M-token context."
|
|
1191
1255
|
},
|
|
1192
1256
|
capabilities: {
|
|
1257
|
+
reasoning: true,
|
|
1193
1258
|
vision: true,
|
|
1194
1259
|
tools: true,
|
|
1195
1260
|
structuredOutput: true,
|
|
@@ -1244,7 +1309,7 @@ var VIDEO_MODELS = [
|
|
|
1244
1309
|
supports: ["lastFrame"]
|
|
1245
1310
|
},
|
|
1246
1311
|
defaults: { durationSeconds: 8, resolution: "720p", aspectRatio: "16:9" },
|
|
1247
|
-
usage: { ...VIDEO_USAGE },
|
|
1312
|
+
usage: { ...VIDEO_USAGE, slug: "veo" },
|
|
1248
1313
|
pricingKind: "video_per_second",
|
|
1249
1314
|
display: {
|
|
1250
1315
|
provider: "google",
|
|
@@ -1336,7 +1401,7 @@ var VIDEO_MODELS = [
|
|
|
1336
1401
|
supports: []
|
|
1337
1402
|
},
|
|
1338
1403
|
defaults: {},
|
|
1339
|
-
usage: { ...VIDEO_USAGE },
|
|
1404
|
+
usage: { ...VIDEO_USAGE, slug: "gemini_omni" },
|
|
1340
1405
|
pricingKind: "video_per_second",
|
|
1341
1406
|
display: {
|
|
1342
1407
|
provider: "google",
|
|
@@ -1395,7 +1460,7 @@ var VIDEO_MODELS = [
|
|
|
1395
1460
|
aspectRatio: "16:9",
|
|
1396
1461
|
generateAudio: true
|
|
1397
1462
|
},
|
|
1398
|
-
usage: { ...VIDEO_USAGE },
|
|
1463
|
+
usage: { ...VIDEO_USAGE, slug: "seedance2", providerLabel: "byteplus" },
|
|
1399
1464
|
pricingKind: "video_per_second",
|
|
1400
1465
|
display: {
|
|
1401
1466
|
provider: "bytedance",
|
|
@@ -1517,7 +1582,7 @@ var VIDEO_MODELS = [
|
|
|
1517
1582
|
cfgScale: 0.5,
|
|
1518
1583
|
negativePrompt: NEGATIVE_PROMPT
|
|
1519
1584
|
},
|
|
1520
|
-
usage: { ...VIDEO_USAGE },
|
|
1585
|
+
usage: { ...VIDEO_USAGE, slug: "grok" },
|
|
1521
1586
|
pricingKind: "video_per_second",
|
|
1522
1587
|
display: {
|
|
1523
1588
|
provider: "kuaishou",
|
|
@@ -1968,6 +2033,40 @@ function resolveVideoOptions(model, request, onUnsupported = "error") {
|
|
|
1968
2033
|
model: model.id
|
|
1969
2034
|
});
|
|
1970
2035
|
}
|
|
2036
|
+
if (merged.sourceVideo !== void 0 && !model.capabilities?.acceptsSourceVideo) {
|
|
2037
|
+
if (onUnsupported === "error") {
|
|
2038
|
+
throw new ModelKitError({
|
|
2039
|
+
code: "unsupported_option",
|
|
2040
|
+
message: `${model.id} does not take a source video`,
|
|
2041
|
+
model: model.id
|
|
2042
|
+
});
|
|
2043
|
+
}
|
|
2044
|
+
warnings.push({
|
|
2045
|
+
code: "option_ignored",
|
|
2046
|
+
field: "sourceVideo",
|
|
2047
|
+
message: `${model.id} does not take a source video; dropped`
|
|
2048
|
+
});
|
|
2049
|
+
delete merged.sourceVideo;
|
|
2050
|
+
}
|
|
2051
|
+
const hasFrames = merged.firstFrame !== void 0 || merged.lastFrame !== void 0;
|
|
2052
|
+
const hasRefs = compact(merged.referenceImages).length + compact(merged.referenceVideos).length + compact(merged.referenceAudios).length > 0;
|
|
2053
|
+
if (hasFrames && hasRefs && model.capabilities?.framesExcludeReferences) {
|
|
2054
|
+
if (onUnsupported === "error") {
|
|
2055
|
+
throw new ModelKitError({
|
|
2056
|
+
code: "unsupported_option",
|
|
2057
|
+
message: `${model.id} takes frames or references, not both`,
|
|
2058
|
+
model: model.id
|
|
2059
|
+
});
|
|
2060
|
+
}
|
|
2061
|
+
warnings.push({
|
|
2062
|
+
code: "option_ignored",
|
|
2063
|
+
field: "referenceImages",
|
|
2064
|
+
message: `${model.id} takes frames or references, not both; references dropped`
|
|
2065
|
+
});
|
|
2066
|
+
delete merged.referenceImages;
|
|
2067
|
+
delete merged.referenceVideos;
|
|
2068
|
+
delete merged.referenceAudios;
|
|
2069
|
+
}
|
|
1971
2070
|
for (const input of c.ratioIgnoredWith ?? []) {
|
|
1972
2071
|
if (merged[input] !== void 0 && merged.aspectRatio !== void 0) {
|
|
1973
2072
|
if (request.aspectRatio !== void 0) {
|