@shop-os/modelkit 0.1.8 → 0.1.10

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 ADDED
@@ -0,0 +1,182 @@
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.10] - unreleased (publish pending)
13
+
14
+ ### Added
15
+ - Vendor logos on the ByteDance rows (Seedream 5 Pro, Seedance 2.0 Fast, Seedance 2.5) and the
16
+ Google rows that lacked one (Omni 1.1, Lyria 3). Rows without a logo are the picker's job to
17
+ cover with a provider mark.
18
+
19
+ ### Fixed
20
+ - `usage.slug: "grok"` sits on the `grok-imagine` row; 0.1.9 shipped it on `kling-2.5` by mistake.
21
+ - **0.1.9 merged the chat stream tuning into every text call.** Text rows carried it as
22
+ `providerOptions` and `defaults.temperature`, which the kit merges under the caller's options, so
23
+ Space Builder text-gen started sending Anthropic thinking budgets and Kimi temperature 1. The
24
+ tuning now lives in `display.chat` (`providerOptions`, `temperature`), which the kit never sends;
25
+ `capabilities.reasoning` stays. Consumers on 0.1.9 should move to 0.1.10.
26
+
27
+ ## [0.1.9] - 2026-09-12
28
+
29
+ ### Added
30
+ - `display.sortOrder`: pickers show lower values first, then catalog order; set it to surface a
31
+ new model at the top.
32
+ - `usage.slug` and `usage.providerLabel`: an app's historic usage-event names for a row, so
33
+ metering continuity no longer needs a per-model table in the app.
34
+ - Text rows carry their stream tuning: `providerOptions` (Anthropic thinking / adaptive, OpenAI
35
+ reasoning summaries, DeepSeek thinking), `capabilities.reasoning`, and `defaults.temperature`
36
+ (Kimi rows).
37
+ - `constraints.exactSizes` on the gpt-image-2 rows: the historic WxH per aspect ratio that Cowork
38
+ sends as `exactSize`.
39
+
40
+ ### Changed
41
+ - `deepseek-flash` (DeepSeek V4.1 Flash) replaces the `deepseek-v4-flash` row; the old id is an
42
+ alias, so stored selections and plan lists keep resolving. DeepSeek retired V4 Flash upstream and
43
+ serves the old id from V4.1 Flash at Flash rates.
44
+ - `resolveVideoOptions` enforces conditioning compatibility: a `sourceVideo` on a row without
45
+ `capabilities.acceptsSourceVideo`, or frames next to references on a row with
46
+ `framesExcludeReferences`, is an `unsupported_option` error, or is dropped with a warning
47
+ under `onUnsupported: "coerce"`.
48
+
49
+ ## [0.1.8] - 2026-09-11
50
+
51
+ ### Added
52
+ - `exposure: "catalog" | "internal"` is required on every row. `catalog` rows are offered in
53
+ product pickers (Creative Studio, chat, Space Builder); `internal` rows are callable by id
54
+ only. 47 rows are `catalog`. A snapshot test pins the set.
55
+ - `display.costTier` (1 to 3) and `display.recommended` on text rows, for the chat picker.
56
+ - `constraints.qualityOptions` on rows that support `quality`; `constraints.durationPresets`
57
+ where the UI offers a short list over a duration range. `resolveOptions` ignores both.
58
+ - `@shop-os/modelkit/catalog`: a browser-safe subpath with `Catalog`, `MODELS`, the per-type
59
+ arrays, `resolveOptions`, the error types and every type. No adapter, client, key handling
60
+ or provider SDK is reachable from it; a test walks the import graph.
61
+ - Alias `meta-muse` on `muse-image-1.0`.
62
+
63
+ ### Changed
64
+ - Labels: `gemini-3.1-flash-image-preview` is "Nano Banana 2" again and `gpt-image-2` is
65
+ "GPT-image-2" (the 0.1.7 labels read as different models in the picker).
66
+ - `Catalog` rejects duplicate ids and aliases across rows.
67
+ - `veo-3.1-lite` offers 720p and 1080p only; Google publishes no 4k rate for it.
68
+
69
+ ## [0.1.7] - 2026-09-10
70
+
71
+ ### Added
72
+ - `display { provider, description, logo? }` and `capabilities` (`imageGenerate`,
73
+ `imageEdit`, `acceptsSourceVideo`, `framesExcludeReferences`, `vision`, `tools`,
74
+ `structuredOutput`, `contextWindow`) on every active row, so a UI can render a picker from
75
+ `kit.catalog.list()` without a hand-written catalog. The nine Cowork picker rows keep their
76
+ descriptions and logos verbatim.
77
+
78
+ ## [0.1.6] - 2026-09-10
79
+
80
+ ### Added
81
+ - `MediaRef.label`: a text part before the media on Gemini image and Omni.
82
+ - `ImageRequest.temperature` (Gemini image) and `ImageRequest.upscale` (Topaz enhance model,
83
+ subject detection, face enhancement with creativity and strength; face enhancement off by
84
+ default).
85
+ - `VideoRequest.watermark` (Seedance) and `VideoRequest.safetyChecker` (fal MiniMax).
86
+ - MiniMax base rows accept `lastFrame`; Seedream 4.5 gets the 4K tier and 9:21.
87
+
88
+ ### Changed
89
+ - `onUnsupported: "error"` now covers aspect ratio and duration as well as size and
90
+ resolution. **Breaking** for callers that relied on silent snapping: pass `"coerce"`.
91
+ - Aborts are never retried and are forwarded to OpenAI, Replicate, Prodia, Ark and reference
92
+ downloads. One retry policy across adapters.
93
+ - Gateway token is required only for vendors that go through the gateway; the
94
+ enterprise-to-pro key fallback is logged.
95
+ - Seedance poll keeps usage, duration, fps and resolution on `raw`; the token split lands on
96
+ the usage event. Grok sends `resolution` only when the caller set it.
97
+ - The unused OpenRouter text route is removed.
98
+
99
+ ## [0.1.5] - 2026-09-10
100
+
101
+ ### Fixed
102
+ - `size: "512"` reaches the adapter (Gemini 3.1 Flash requests were generated at 1K).
103
+ - Every status-less SDK throw is a retryable transport error; five adapters had classified
104
+ them as permanent.
105
+ - Grok `firstFrame` maps to the SDK's first frame (image-to-video); references capped at 7.
106
+ - Omni: `delivery: "uri"` and `store: true`, `firstFrame` runs image-to-video, references run
107
+ reference-to-video, no `resolution` on 1.0, uploads deleted after create.
108
+
109
+ ### Changed
110
+ - `constraints.supports` undefined means "supports nothing"; every row carries an explicit list.
111
+ - `aspectRatio: "adaptive"` means "send no ratio" and is never coerced or defaulted.
112
+ - Usage `unit` comes from the catalog row; adapters supply quantities.
113
+ - Gemini `safetySettings` are per-call opt-in.
114
+ - fal direct video is queue submit plus poll, only the submit is retried; the fal client takes
115
+ the kit's `fetch`. Cloudflare gateway slugs `anthropic/v1` and `grok/v1`.
116
+
117
+ ## [0.1.4] - 2026-09-10
118
+
119
+ ### Added
120
+ - `topaz` row takes references and `scaleFactor` and returns `outputUrl` next to the bytes.
121
+ - Gemini image usage events carry input and output token counts.
122
+ - Aliases `claude-haiku-4` and `claude-sonnet-4-5-20250929`.
123
+
124
+ ## [0.1.3] - 2026-09-10
125
+
126
+ ### Fixed
127
+ - The remaining medium findings from the adoption review.
128
+
129
+ ## [0.1.2] - 2026-09-10
130
+
131
+ ### Added
132
+ - `gpt-image-2.5-sunburst` and `gpt-image-2.5-flare` with the `xhigh` and `max` quality tiers.
133
+ - Aliases `gpt-5.1-mini` and `gpt-5.2-mini` on `gpt-5.4-mini`.
134
+
135
+ ### Changed
136
+ - Google text goes through the gateway at `/google-ai-studio/v1beta`.
137
+ - Reasoning defaults are dropped from the text catalog.
138
+ - Seedance and Kling Omni keep last frames and seeds; Google transport failures retry.
139
+
140
+ ### Fixed
141
+ - The seven blocking findings from the adoption review.
142
+
143
+ ## [0.1.1] - 2026-09-09
144
+
145
+ ### Added
146
+ - `generateText`, `streamText`, `generateObject`, `streamObject` with catalog models. The
147
+ package re-exports every `ai` export, so `from "ai"` becomes `from "@shop-os/modelkit"`.
148
+ - `generateAudio` (Lyria 3, Lyria 2, MMAudio) and `prepareMediaPart` for video understanding.
149
+ - `generateImage` accepts the `upscale` and `bg-remove` catalog types, `n`, exact `WxH` sizes.
150
+ - Catalog rows for every id the apps still sent to direct SDKs; retired Claude 4.0 ids alias to
151
+ Sonnet 4.6 and Opus 4.8; fal passthrough with a gateway-stored key.
152
+
153
+ ### Fixed
154
+ - Text keys fall back per provider; dotted Claude aliases; native DeepSeek, Moonshot and
155
+ Perplexity providers; AI SDK-shaped `providerOptions`.
156
+ - gpt-image-2 edit sent `input_fidelity`, which the API rejects; a filtered Gemini prompt maps
157
+ to `content_blocked`; `@google/genai` no longer switches to Vertex from the host env.
158
+
159
+ ## [0.1.0] - 2026-09-09
160
+
161
+ First publish, renamed from `@shop-os/model-sdk`.
162
+
163
+ - Catalog of 74 models. The id is the pro-backend pricing key; every historical id is an alias.
164
+ - `resolveOptions` fills defaults, snaps the aspect ratio, errors or coerces on unsupported
165
+ size, resolution and duration, trims references.
166
+ - Ten adapters by provider API: AI SDK text, Gemini image, gpt-image-2, Google GenAI (Veo,
167
+ Omni, Lyria 3, video understanding), Ark, fal, Replicate, Prodia, Higgsfield, xAI video.
168
+ - Keys per tier (pro, enterprise with per-provider fallback); one retry classifier, one error
169
+ type, one usage event with the canonical id.
170
+
171
+ [Unreleased]: https://github.com/Shop-OS/shopos-backend-ts/compare/modelkit-0.1.10...dev
172
+ [0.1.10]: https://github.com/Shop-OS/shopos-backend-ts/compare/f17e822e2...dev
173
+ [0.1.9]: https://github.com/Shop-OS/shopos-backend-ts/compare/1958a5615...dev
174
+ [0.1.8]: https://github.com/Shop-OS/shopos-backend-ts/commit/9661a109d
175
+ [0.1.7]: https://github.com/Shop-OS/shopos-backend-ts/commit/2d3d19ac2
176
+ [0.1.6]: https://github.com/Shop-OS/shopos-backend-ts/commit/f67fee08f
177
+ [0.1.5]: https://github.com/Shop-OS/shopos-backend-ts/commit/7f3f745ec
178
+ [0.1.4]: https://github.com/Shop-OS/shopos-backend-ts/commit/a2f3ffcc7
179
+ [0.1.3]: https://github.com/Shop-OS/shopos-backend-ts/commit/785960dbd
180
+ [0.1.2]: https://github.com/Shop-OS/shopos-backend-ts/commit/4581615e6
181
+ [0.1.1]: https://github.com/Shop-OS/shopos-backend-ts/commit/c159c97d3
182
+ [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",
@@ -362,6 +389,7 @@ var IMAGE_MODELS = [
362
389
  pricingKind: "image_size",
363
390
  display: {
364
391
  provider: "bytedance",
392
+ logo: "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/3bba5d81-4e57-4e71-911b-cdfa05acca2c_compressed.png",
365
393
  description: "ByteDance Seedream 5.0 Pro text-to-image and multi-reference image-to-image (up to 10 inputs) with region editing; outputs 1K, 1.5K, or 2K."
366
394
  },
367
395
  capabilities: { ...IMAGE_GENERATE_EDIT }
@@ -567,6 +595,7 @@ var IMAGE_MODELS = [
567
595
  ];
568
596
 
569
597
  // src/catalog/other.ts
598
+ var GOOGLE_LOGO = "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/192485d2-a76a-4657-9c06-930b2c70badd_compressed.png";
570
599
  var OTHER_MODELS = [
571
600
  {
572
601
  id: "lyria-3-clip-preview",
@@ -587,6 +616,7 @@ var OTHER_MODELS = [
587
616
  pricingKind: "flat",
588
617
  display: {
589
618
  provider: "google",
619
+ logo: GOOGLE_LOGO,
590
620
  description: "Google Lyria 3 Clip short music clips, loops, and previews; takes text and up to 10 image prompts and returns a fixed 30-second MP3 plus lyrics."
591
621
  },
592
622
  capabilities: {}
@@ -609,6 +639,7 @@ var OTHER_MODELS = [
609
639
  pricingKind: "flat",
610
640
  display: {
611
641
  provider: "google",
642
+ logo: GOOGLE_LOGO,
612
643
  description: "Google Lyria 3 Pro flagship music model for full-length songs with verses, choruses, and bridges; takes text and up to 10 image prompts and returns MP3 plus lyrics."
613
644
  },
614
645
  capabilities: {}
@@ -748,6 +779,14 @@ function text(id, label, providerModelId, extra) {
748
779
  ...extra
749
780
  };
750
781
  }
782
+ var ANTHROPIC_THINKING = {
783
+ anthropic: { thinking: { type: "enabled", budgetTokens: 4e3 }, sendReasoning: true }
784
+ };
785
+ var ANTHROPIC_ADAPTIVE = {
786
+ anthropic: { thinking: { type: "adaptive", display: "summarized" }, sendReasoning: true }
787
+ };
788
+ var OPENAI_REASONING = { openai: { reasoningEffort: "medium", reasoningSummary: "auto" } };
789
+ var DEEPSEEK_THINKING = { deepseek: { thinking: { type: "enabled" } } };
751
790
  var TEXT_MODELS = [
752
791
  text("gpt-4o", "GPT-4o", "gpt-4o", {
753
792
  exposure: "internal",
@@ -828,11 +867,13 @@ var TEXT_MODELS = [
828
867
  text("gpt-5.6-luna", "GPT-5.6 Luna", "gpt-5.6-luna", {
829
868
  exposure: "catalog",
830
869
  display: {
870
+ chat: { providerOptions: OPENAI_REASONING },
831
871
  provider: "openai",
832
872
  costTier: 1,
833
873
  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
874
  },
835
875
  capabilities: {
876
+ reasoning: true,
836
877
  vision: true,
837
878
  tools: true,
838
879
  structuredOutput: true,
@@ -842,11 +883,13 @@ var TEXT_MODELS = [
842
883
  text("gpt-5.6-terra", "GPT-5.6 Terra", "gpt-5.6-terra", {
843
884
  exposure: "catalog",
844
885
  display: {
886
+ chat: { providerOptions: OPENAI_REASONING },
845
887
  provider: "openai",
846
888
  costTier: 2,
847
889
  description: "OpenAI GPT-5.6 Terra balanced tier of the GPT-5.6 reasoning family; text and image input, 1.05M-token context."
848
890
  },
849
891
  capabilities: {
892
+ reasoning: true,
850
893
  vision: true,
851
894
  tools: true,
852
895
  structuredOutput: true,
@@ -856,11 +899,13 @@ var TEXT_MODELS = [
856
899
  text("gpt-5.6-sol", "GPT-5.6 Sol", "gpt-5.6-sol", {
857
900
  exposure: "catalog",
858
901
  display: {
902
+ chat: { providerOptions: OPENAI_REASONING },
859
903
  provider: "openai",
860
904
  costTier: 3,
861
905
  description: "OpenAI GPT-5.6 Sol flagship tier of the GPT-5.6 reasoning family; text and image input, 1.05M-token context."
862
906
  },
863
907
  capabilities: {
908
+ reasoning: true,
864
909
  vision: true,
865
910
  tools: true,
866
911
  structuredOutput: true,
@@ -888,11 +933,13 @@ var TEXT_MODELS = [
888
933
  "claude-sonnet-4-20250514"
889
934
  ],
890
935
  display: {
936
+ chat: { providerOptions: ANTHROPIC_THINKING },
891
937
  provider: "anthropic",
892
938
  costTier: 2,
893
939
  description: "Anthropic Claude Sonnet 4.6 (legacy) balanced model; text and image input, 1M-token context."
894
940
  },
895
941
  capabilities: {
942
+ reasoning: true,
896
943
  vision: true,
897
944
  tools: true,
898
945
  structuredOutput: true,
@@ -902,11 +949,13 @@ var TEXT_MODELS = [
902
949
  text("claude-sonnet-5", "Claude Sonnet 5", "claude-sonnet-5", {
903
950
  exposure: "catalog",
904
951
  display: {
952
+ chat: { providerOptions: ANTHROPIC_ADAPTIVE },
905
953
  provider: "anthropic",
906
954
  costTier: 3,
907
955
  description: "Anthropic Claude Sonnet 5 current balanced model; text and image input, 1M-token context."
908
956
  },
909
957
  capabilities: {
958
+ reasoning: true,
910
959
  vision: true,
911
960
  tools: true,
912
961
  structuredOutput: true,
@@ -917,11 +966,13 @@ var TEXT_MODELS = [
917
966
  exposure: "catalog",
918
967
  aliases: ["claude-opus-4.8", "claude-opus-4", "claude-opus-4.0", "claude-opus-4-20250514"],
919
968
  display: {
969
+ chat: { providerOptions: ANTHROPIC_ADAPTIVE },
920
970
  provider: "anthropic",
921
971
  costTier: 3,
922
972
  description: "Anthropic Claude Opus 4.8 (legacy) frontier model; text and image input, 1M-token context."
923
973
  },
924
974
  capabilities: {
975
+ reasoning: true,
925
976
  vision: true,
926
977
  tools: true,
927
978
  structuredOutput: true,
@@ -932,11 +983,18 @@ var TEXT_MODELS = [
932
983
  exposure: "catalog",
933
984
  aliases: ["claude-haiku-4.5", "claude-haiku-4-5-20251001", "claude-haiku-4"],
934
985
  display: {
986
+ chat: { providerOptions: ANTHROPIC_THINKING },
935
987
  provider: "anthropic",
936
988
  costTier: 1,
937
989
  description: "Anthropic Claude Haiku 4.5 fast model with near-frontier intelligence; text and image input, 200K-token context."
938
990
  },
939
- capabilities: { vision: true, tools: true, structuredOutput: true, contextWindow: 2e5 }
991
+ capabilities: {
992
+ reasoning: true,
993
+ vision: true,
994
+ tools: true,
995
+ structuredOutput: true,
996
+ contextWindow: 2e5
997
+ }
940
998
  }),
941
999
  text("claude-opus-5", "Claude Opus 5", "claude-opus-5", {
942
1000
  exposure: "internal",
@@ -1128,15 +1186,21 @@ var TEXT_MODELS = [
1128
1186
  contextWindow: 128e3
1129
1187
  }
1130
1188
  }),
1131
- text("deepseek-v4-flash", "DeepSeek V4 Flash", "deepseek-v4-flash", {
1189
+ // DeepSeek retired V4 Flash upstream and routes the old id to V4.1 Flash at
1190
+ // Flash rates (https://api-docs.deepseek.com/news/news260910/); the old id
1191
+ // stays an alias so stored selections keep resolving.
1192
+ text("deepseek-flash", "DeepSeek V4.1 Flash", "deepseek-flash", {
1193
+ aliases: ["deepseek-v4-flash"],
1132
1194
  exposure: "catalog",
1133
1195
  display: {
1196
+ chat: { providerOptions: DEEPSEEK_THINKING },
1134
1197
  provider: "deepseek",
1135
1198
  costTier: 1,
1136
1199
  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."
1200
+ 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
1201
  },
1139
1202
  capabilities: {
1203
+ reasoning: true,
1140
1204
  vision: true,
1141
1205
  tools: true,
1142
1206
  structuredOutput: true,
@@ -1146,11 +1210,13 @@ var TEXT_MODELS = [
1146
1210
  text("deepseek-v4-pro", "DeepSeek V4 Pro", "deepseek-v4-pro", {
1147
1211
  exposure: "catalog",
1148
1212
  display: {
1213
+ chat: { providerOptions: DEEPSEEK_THINKING },
1149
1214
  provider: "deepseek",
1150
1215
  costTier: 2,
1151
1216
  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
1217
  },
1153
1218
  capabilities: {
1219
+ reasoning: true,
1154
1220
  vision: false,
1155
1221
  tools: true,
1156
1222
  structuredOutput: true,
@@ -1176,6 +1242,7 @@ var TEXT_MODELS = [
1176
1242
  text("kimi-k2.5", "Kimi K2.5", "kimi-k2.5", {
1177
1243
  exposure: "catalog",
1178
1244
  display: {
1245
+ chat: { temperature: 1 },
1179
1246
  provider: "moonshot",
1180
1247
  costTier: 2,
1181
1248
  description: "Moonshot Kimi K2.5; the provider retired the model on 2026-08-31 and calls now return a model-not-found error."
@@ -1185,11 +1252,13 @@ var TEXT_MODELS = [
1185
1252
  text("kimi-k3", "Kimi K3", "kimi-k3", {
1186
1253
  exposure: "catalog",
1187
1254
  display: {
1255
+ chat: { temperature: 1 },
1188
1256
  provider: "moonshot",
1189
1257
  costTier: 2,
1190
1258
  description: "Moonshot Kimi K3 flagship model with native visual understanding and always-on thinking; text, image, and video input, 1M-token context."
1191
1259
  },
1192
1260
  capabilities: {
1261
+ reasoning: true,
1193
1262
  vision: true,
1194
1263
  tools: true,
1195
1264
  structuredOutput: true,
@@ -1220,7 +1289,8 @@ var H3_RATIOS = ["21:9", "16:9", "4:3", "1:1", "3:4", "9:16"];
1220
1289
  var H3_REFERENCE_RATIOS = ["adaptive", ...H3_RATIOS];
1221
1290
  var NEGATIVE_PROMPT = "blur, distort, and low quality";
1222
1291
  var FRAMES_EXCLUDE_REFERENCES = { framesExcludeReferences: true };
1223
- var GOOGLE_LOGO = "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/192485d2-a76a-4657-9c06-930b2c70badd_compressed.png";
1292
+ var BYTEDANCE_LOGO = "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/3bba5d81-4e57-4e71-911b-cdfa05acca2c_compressed.png";
1293
+ var GOOGLE_LOGO2 = "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/192485d2-a76a-4657-9c06-930b2c70badd_compressed.png";
1224
1294
  var VIDEO_MODELS = [
1225
1295
  {
1226
1296
  id: "veo-3.1",
@@ -1244,12 +1314,12 @@ var VIDEO_MODELS = [
1244
1314
  supports: ["lastFrame"]
1245
1315
  },
1246
1316
  defaults: { durationSeconds: 8, resolution: "720p", aspectRatio: "16:9" },
1247
- usage: { ...VIDEO_USAGE },
1317
+ usage: { ...VIDEO_USAGE, slug: "veo" },
1248
1318
  pricingKind: "video_per_second",
1249
1319
  display: {
1250
1320
  provider: "google",
1251
1321
  description: "Google's highest-quality video generation model. Supports up to 4K resolution and 8-second clips with reference image conditioning.",
1252
- logo: GOOGLE_LOGO
1322
+ logo: GOOGLE_LOGO2
1253
1323
  },
1254
1324
  capabilities: { ...FRAMES_EXCLUDE_REFERENCES }
1255
1325
  },
@@ -1336,12 +1406,12 @@ var VIDEO_MODELS = [
1336
1406
  supports: []
1337
1407
  },
1338
1408
  defaults: {},
1339
- usage: { ...VIDEO_USAGE },
1409
+ usage: { ...VIDEO_USAGE, slug: "gemini_omni" },
1340
1410
  pricingKind: "video_per_second",
1341
1411
  display: {
1342
1412
  provider: "google",
1343
1413
  description: "Google's conversational video model with native audio, human support, and natural language editing. Aspect ratio only \u2014 resolution and duration are model-determined.",
1344
- logo: GOOGLE_LOGO
1414
+ logo: GOOGLE_LOGO2
1345
1415
  },
1346
1416
  capabilities: { acceptsSourceVideo: true }
1347
1417
  },
@@ -1366,6 +1436,7 @@ var VIDEO_MODELS = [
1366
1436
  pricingKind: "video_per_second",
1367
1437
  display: {
1368
1438
  provider: "google",
1439
+ logo: GOOGLE_LOGO2,
1369
1440
  description: "Google Gemini Omni Flash 1.1 conversational video generation and editing; text, image, and up to 10-second video input, 3-10 second output at up to 4K and 24 FPS."
1370
1441
  },
1371
1442
  capabilities: { acceptsSourceVideo: true }
@@ -1395,12 +1466,12 @@ var VIDEO_MODELS = [
1395
1466
  aspectRatio: "16:9",
1396
1467
  generateAudio: true
1397
1468
  },
1398
- usage: { ...VIDEO_USAGE },
1469
+ usage: { ...VIDEO_USAGE, slug: "seedance2", providerLabel: "byteplus" },
1399
1470
  pricingKind: "video_per_second",
1400
1471
  display: {
1401
1472
  provider: "bytedance",
1402
1473
  description: "High-quality AI video generation with reference image conditioning. Supports 4-15 second clips with human preprocessing.",
1403
- logo: "https://d31vvfpk2ppdyq.cloudfront.net/assets/image/3bba5d81-4e57-4e71-911b-cdfa05acca2c_compressed.png"
1474
+ logo: BYTEDANCE_LOGO
1404
1475
  },
1405
1476
  capabilities: { acceptsSourceVideo: true, ...FRAMES_EXCLUDE_REFERENCES }
1406
1477
  },
@@ -1431,6 +1502,7 @@ var VIDEO_MODELS = [
1431
1502
  pricingKind: "video_per_second",
1432
1503
  display: {
1433
1504
  provider: "bytedance",
1505
+ logo: BYTEDANCE_LOGO,
1434
1506
  description: "Speed- and cost-optimized ByteDance Seedance 2.0 Fast; text plus image, video, and audio references to generate or edit 4-15 second clips."
1435
1507
  },
1436
1508
  capabilities: { acceptsSourceVideo: true, ...FRAMES_EXCLUDE_REFERENCES }
@@ -1463,6 +1535,7 @@ var VIDEO_MODELS = [
1463
1535
  pricingKind: "video_per_second",
1464
1536
  display: {
1465
1537
  provider: "bytedance",
1538
+ logo: BYTEDANCE_LOGO,
1466
1539
  description: "ByteDance Seedance 2.5 for long-form storytelling and omni-reference generation/editing; up to 50 reference assets and 4-30 second clips at up to 1080p."
1467
1540
  },
1468
1541
  capabilities: { acceptsSourceVideo: true, ...FRAMES_EXCLUDE_REFERENCES }
@@ -1487,7 +1560,7 @@ var VIDEO_MODELS = [
1487
1560
  },
1488
1561
  // No resolution default: xAI picks its own unless the caller asks.
1489
1562
  defaults: { durationSeconds: 8, aspectRatio: "16:9" },
1490
- usage: { unit: "reported_cost_usd", modality: "VIDEO" },
1563
+ usage: { unit: "reported_cost_usd", modality: "VIDEO", slug: "grok" },
1491
1564
  pricingKind: "video_per_second",
1492
1565
  display: {
1493
1566
  provider: "xai",
@@ -1968,6 +2041,40 @@ function resolveVideoOptions(model, request, onUnsupported = "error") {
1968
2041
  model: model.id
1969
2042
  });
1970
2043
  }
2044
+ if (merged.sourceVideo !== void 0 && !model.capabilities?.acceptsSourceVideo) {
2045
+ if (onUnsupported === "error") {
2046
+ throw new ModelKitError({
2047
+ code: "unsupported_option",
2048
+ message: `${model.id} does not take a source video`,
2049
+ model: model.id
2050
+ });
2051
+ }
2052
+ warnings.push({
2053
+ code: "option_ignored",
2054
+ field: "sourceVideo",
2055
+ message: `${model.id} does not take a source video; dropped`
2056
+ });
2057
+ delete merged.sourceVideo;
2058
+ }
2059
+ const hasFrames = merged.firstFrame !== void 0 || merged.lastFrame !== void 0;
2060
+ const hasRefs = compact(merged.referenceImages).length + compact(merged.referenceVideos).length + compact(merged.referenceAudios).length > 0;
2061
+ if (hasFrames && hasRefs && model.capabilities?.framesExcludeReferences) {
2062
+ if (onUnsupported === "error") {
2063
+ throw new ModelKitError({
2064
+ code: "unsupported_option",
2065
+ message: `${model.id} takes frames or references, not both`,
2066
+ model: model.id
2067
+ });
2068
+ }
2069
+ warnings.push({
2070
+ code: "option_ignored",
2071
+ field: "referenceImages",
2072
+ message: `${model.id} takes frames or references, not both; references dropped`
2073
+ });
2074
+ delete merged.referenceImages;
2075
+ delete merged.referenceVideos;
2076
+ delete merged.referenceAudios;
2077
+ }
1971
2078
  for (const input of c.ratioIgnoredWith ?? []) {
1972
2079
  if (merged[input] !== void 0 && merged.aspectRatio !== void 0) {
1973
2080
  if (request.aspectRatio !== void 0) {