@shop-os/modelkit 0.19.1 → 0.20.0

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 CHANGED
@@ -9,7 +9,34 @@ header in the release PR.
9
9
 
10
10
  ## [Unreleased]
11
11
 
12
- ## [0.19.1] - Unreleased
12
+ ## [0.20.0] - Unreleased
13
+
14
+ ### Added
15
+ - New `alibaba` adapter (ENG-3881): Alibaba Cloud Model Studio direct, US (Virginia) with the
16
+ Global deployment scope. Keys: `DASHSCOPE_API_KEY` plus `DASHSCOPE_WORKSPACE_ID` (the key works
17
+ only on its own workspace endpoint, `https://{WorkspaceId}.us-east-1.maas.aliyuncs.com/api/v1`);
18
+ the pair switches together like Higgsfield key + secret, and the `ENTERPRISE_` / `SLOOSH_`
19
+ prefixes apply. Base-url override: `endpoints.alibaba`. Video runs as an async task
20
+ (`X-DashScope-Async`), polled every 15 s for up to 20 minutes; `resumeVideo` reconnects by task
21
+ id. Not a BYOK provider.
22
+
23
+ ### Changed
24
+ - `wan-3.0` and `wan-3.0-prime` move from fal to `alibaba` (`wan3.0-video`, `wan3.0-video-prime`).
25
+ Same constraints; `safetyChecker` is gone (Model Studio has none). A request with reference
26
+ videos is billed for the input seconds too: the usage event's `quantity` is Alibaba's
27
+ `usage.duration` (input plus output), `durationSeconds` stays the clip length.
28
+ - `happy-horse-1.1` moves from fal to `alibaba` (`happyhorse-1.1-t2v` / `-i2v` / `-r2v`, picked from
29
+ the inputs). Watermark is sent off (Alibaba stamps one by default); `safetyChecker` is gone.
30
+ `happy-horse-video-edit` stays on fal.
31
+ - `qwen-image-3` moves from fal to `alibaba` (`qwen-image-3.0-pro`, whose list price matches fal's
32
+ row). png output only: another `outputFormat` warns `option_ignored`. The usage tier is the one
33
+ Alibaba bills (`output_image_type`). Alibaba also bills each input image; the usage event does
34
+ not carry it yet.
35
+
36
+ ### Removed
37
+ - The fal mappings for Wan 3 / Wan 3 Prime, Happy Horse 1.1 generation and Qwen Image 3.
38
+
39
+ ## [0.19.1] - 2026-11-11
13
40
 
14
41
  ### Added
15
42
  - `seedream-5.5` (ENG-3884): ByteDance Seedream 5.5 on the `ark` adapter
package/README.md CHANGED
@@ -115,7 +115,7 @@ before submit), and `model3dPricingSku(row, options, inputs)` names the flat pri
115
115
  bills under; `model3dSkus(row)` lists them all, and pro-backend keeps a `credit_pricing_flat`
116
116
  row for each. All three are in the browser-safe catalog entry.
117
117
 
118
- Keys come from `process.env` by default: bare names for pro (`OPENAI_API_KEY`, `FAL_KEY`, `BYTEDANCE_API_KEY`, `LUMA_API_KEY` ...), the `ENTERPRISE_` prefix for enterprise and the `SLOOSH_` prefix for sloosh (sloosh reads `SLOOSH_LUMA_API_KEY` for Luma). Pass `keys: { pro, enterprise, sloosh }` to override. `tier: "sloosh"` uses the sloosh keys only: a missing key is a `ModelKitError` with code `auth`, never a fallback to pro.
118
+ Keys come from `process.env` by default: bare names for pro (`OPENAI_API_KEY`, `FAL_KEY`, `BYTEDANCE_API_KEY`, `LUMA_API_KEY` ...), the `ENTERPRISE_` prefix for enterprise and the `SLOOSH_` prefix for sloosh (sloosh reads `SLOOSH_LUMA_API_KEY` for Luma; Alibaba needs `DASHSCOPE_API_KEY` and `DASHSCOPE_WORKSPACE_ID` on each tier). Pass `keys: { pro, enterprise, sloosh }` to override. `tier: "sloosh"` uses the sloosh keys only: a missing key is a `ModelKitError` with code `auth`, never a fallback to pro.
119
119
 
120
120
  ## Customer keys (BYOK)
121
121
 
@@ -378,7 +378,7 @@ app's secrets, not a Cloudflare gateway token.
378
378
 
379
379
  ## Adapters
380
380
 
381
- `ai-sdk-text`, `google-image`, `openai-image`, `google-genai` (Veo, Omni with `delivery: "uri"`, Lyria 3, Files API media parts), `ark` (Seedream, Seedance), `fal`, `replicate` (images, video, Lyria 2, MMAudio), `prodia`, `higgsfield`, `xai-video`, `luma` (Uni images, Ray 3.2 video via the Agents API; `LUMA_API_KEY`, base-url override `endpoints.luma`), `fish` (Fish Audio speech, `createVoice` / `designVoice` / `deleteVoice`; `FISH_AUDIO_API_KEY`, base-url override `endpoints.fish`), `elevenlabs` (direct ElevenLabs speech, `createVoice` / `deleteVoice`; `ELEVENLABS_API_KEY`, base-url override `endpoints.elevenlabs`). See `src/adapters/`.
381
+ `ai-sdk-text`, `google-image`, `openai-image`, `google-genai` (Veo, Omni with `delivery: "uri"`, Lyria 3, Files API media parts), `ark` (Seedream, Seedance), `fal`, `replicate` (images, video, Lyria 2, MMAudio), `prodia`, `higgsfield`, `xai-video`, `luma` (Uni images, Ray 3.2 video via the Agents API; `LUMA_API_KEY`, base-url override `endpoints.luma`), `alibaba` (Model Studio direct in US Virginia: Wan 3 and Happy Horse 1.1 video, Qwen Image 3; `DASHSCOPE_API_KEY` + `DASHSCOPE_WORKSPACE_ID`, base-url override `endpoints.alibaba`), `fish` (Fish Audio speech, `createVoice` / `designVoice` / `deleteVoice`; `FISH_AUDIO_API_KEY`, base-url override `endpoints.fish`), `elevenlabs` (direct ElevenLabs speech, `createVoice` / `deleteVoice`; `ELEVENLABS_API_KEY`, base-url override `endpoints.elevenlabs`). See `src/adapters/`.
382
382
 
383
383
  ## Not in the package
384
384
 
package/dist/catalog.cjs CHANGED
@@ -349,14 +349,15 @@ var FAL_IMAGE_MODELS = [
349
349
  }
350
350
  },
351
351
  {
352
- // alibaba/qwen-image-3/text-to-image; references switch to .../edit (1-3 images, addressed
353
- // as "image 1".."image 3"). $0.04 per image at 1K, $0.075 at 2K.
352
+ // Alibaba Model Studio direct (qwen-image-3.0-pro; fal's qwen-image-3 bills its prices).
353
+ // 1-3 input images make it an edit, addressed as "image 1".."image 3". png output only.
354
+ // https://www.alibabacloud.com/help/en/model-studio/qwen-image-generation-and-editing-api-reference
354
355
  id: "qwen-image-3",
355
356
  aliases: [],
356
357
  label: "Qwen Image 3",
357
358
  type: "image",
358
- adapter: "fal",
359
- providerModelId: "alibaba/qwen-image-3/text-to-image",
359
+ adapter: "alibaba",
360
+ providerModelId: "qwen-image-3.0-pro",
360
361
  lifecycle: "active",
361
362
  exposure: EXPOSURE,
362
363
  constraints: {
@@ -5723,14 +5724,15 @@ var VIDEO_FAMILY_MODELS = [
5723
5724
  capabilities: { acceptsSourceVideo: true, videoEdit: true }
5724
5725
  },
5725
5726
  {
5726
- // https://fal.ai/models/alibaba/happy-horse/v1.1/text-to-video/api (+ /image-to-video,
5727
- // /reference-to-video): one row; references, else a start frame, else text.
5727
+ // Alibaba Model Studio direct: one row for happyhorse-1.1-t2v / -i2v / -r2v; references,
5728
+ // else a start frame, else text. 480P exists too, unpriced, so it stays out.
5729
+ // https://www.alibabacloud.com/help/en/model-studio/happyhorse-reference-to-video-api-reference
5728
5730
  id: "happy-horse-1.1",
5729
5731
  aliases: ["happy-horse"],
5730
5732
  label: "Happy Horse 1.1",
5731
5733
  type: "video",
5732
- adapter: "fal",
5733
- providerModelId: "alibaba/happy-horse/v1.1",
5734
+ adapter: "alibaba",
5735
+ providerModelId: "happyhorse-1.1",
5734
5736
  lifecycle: "active",
5735
5737
  exposure: ["cowork", "space_builder"],
5736
5738
  constraints: {
@@ -5739,7 +5741,7 @@ var VIDEO_FAMILY_MODELS = [
5739
5741
  durations: range(3, 15),
5740
5742
  ratioIgnoredWith: ["firstFrame"],
5741
5743
  references: { ...NO_REFERENCES, images: 9 },
5742
- supports: ["seed", "safetyChecker"],
5744
+ supports: ["seed"],
5743
5745
  prompt: { referenceSyntax: "numbered", maxChars: 2500 },
5744
5746
  audio: "always"
5745
5747
  },
@@ -6688,15 +6690,15 @@ var VIDEO_MODELS = [
6688
6690
  capabilities: { ...FRAMES_EXCLUDE_REFERENCES }
6689
6691
  },
6690
6692
  {
6691
- // One row for fal's three Wan 3.0 endpoints; the adapter picks text-, image- or
6692
- // reference-to-video from the inputs. Each takes aspect_ratio, so none is ignored.
6693
- // https://fal.ai/models/alibaba/wan-3.0/reference-to-video/api
6693
+ // Alibaba Model Studio direct, one model id for text-, image- (first/last frame) and
6694
+ // reference-to-video. Reference-video seconds bill on top of the output seconds.
6695
+ // https://www.alibabacloud.com/help/en/model-studio/wan3-video-generation-api-reference
6694
6696
  id: "wan-3.0",
6695
6697
  aliases: ["wan-3", "wan3"],
6696
6698
  label: "Wan 3",
6697
6699
  type: "video",
6698
- adapter: "fal",
6699
- providerModelId: "alibaba/wan-3.0",
6700
+ adapter: "alibaba",
6701
+ providerModelId: "wan3.0-video",
6700
6702
  lifecycle: "active",
6701
6703
  exposure: ["cowork", "space_builder"],
6702
6704
  constraints: {
@@ -6711,7 +6713,7 @@ var VIDEO_MODELS = [
6711
6713
  videoSeconds: { total: 15 },
6712
6714
  audioSeconds: { total: 15 }
6713
6715
  },
6714
- supports: ["seed", "lastFrame", "generateAudio", "safetyChecker"],
6716
+ supports: ["seed", "lastFrame", "generateAudio"],
6715
6717
  prompt: WAN_PROMPT,
6716
6718
  audio: "optional"
6717
6719
  },
@@ -6730,15 +6732,14 @@ var VIDEO_MODELS = [
6730
6732
  capabilities: { ...FRAMES_EXCLUDE_REFERENCES, lastFrameRequiresFirstFrame: true }
6731
6733
  },
6732
6734
  {
6733
- // fal's Wan 3.0 Prime endpoints share Wan 3.0's input schemas field for field but bill
6734
- // more per second, so Prime is its own row (the id is the pricing key).
6735
- // https://fal.ai/models/alibaba/wan-3.0-prime/reference-to-video/api
6735
+ // Wan 3.0 Prime takes Wan 3.0's request field for field but bills more per second, so
6736
+ // Prime is its own row (the id is the pricing key).
6736
6737
  id: "wan-3.0-prime",
6737
6738
  aliases: ["wan-3-prime", "wan3-prime"],
6738
6739
  label: "Wan 3 Prime",
6739
6740
  type: "video",
6740
- adapter: "fal",
6741
- providerModelId: "alibaba/wan-3.0-prime",
6741
+ adapter: "alibaba",
6742
+ providerModelId: "wan3.0-video-prime",
6742
6743
  lifecycle: "active",
6743
6744
  exposure: ["cowork", "space_builder"],
6744
6745
  constraints: {
@@ -6753,7 +6754,7 @@ var VIDEO_MODELS = [
6753
6754
  videoSeconds: { total: 15 },
6754
6755
  audioSeconds: { total: 15 }
6755
6756
  },
6756
- supports: ["seed", "lastFrame", "generateAudio", "safetyChecker"],
6757
+ supports: ["seed", "lastFrame", "generateAudio"],
6757
6758
  prompt: WAN_PROMPT,
6758
6759
  audio: "optional"
6759
6760
  },
@@ -8072,6 +8073,7 @@ var ADAPTER_IDS = [
8072
8073
  "higgsfield",
8073
8074
  "xai-video",
8074
8075
  "luma",
8076
+ "alibaba",
8075
8077
  "fish",
8076
8078
  "elevenlabs"
8077
8079
  ];
@@ -9330,7 +9332,8 @@ var QWEN_EXACT = {
9330
9332
  maxSide: 14142,
9331
9333
  minArea: 512 * 512,
9332
9334
  maxArea: 2048 * 2048,
9333
- multipleOf: 1
9335
+ multipleOf: 1,
9336
+ maxAspect: 8
9334
9337
  };
9335
9338
  var MINIMAX_H3_IMAGE_EXACT = {
9336
9339
  minSide: 1,
@@ -9382,7 +9385,8 @@ var FAL_IMAGE_SPECS = /* @__PURE__ */ new Map([
9382
9385
  }
9383
9386
  ],
9384
9387
  [
9385
- "alibaba/qwen-image-3/text-to-image",
9388
+ // Alibaba direct (adapters/alibaba-image.ts); png only, which the adapter warns about.
9389
+ "qwen-image-3.0-pro",
9386
9390
  {
9387
9391
  label: "Qwen Image 3",
9388
9392
  maxReferences: 3,
@@ -9549,7 +9553,7 @@ function falExactSize(spec, req) {
9549
9553
  return check.ok ? check.size : void 0;
9550
9554
  }
9551
9555
  function applyFalImageRules(model, req, callerSize, warnings) {
9552
- if (model.adapter !== "fal") return;
9556
+ if (model.adapter !== "fal" && model.adapter !== "alibaba") return;
9553
9557
  const spec = falImageSpec(model.providerModelId);
9554
9558
  if (spec === void 0) return;
9555
9559
  const problem = falImageProblem(spec, withPromptForResolve(req));
@@ -9612,7 +9616,7 @@ var KLING_V4_FLASH_EDIT = "kling/v4/flash/video-to-video";
9612
9616
  var H3_TURBO = "minimax/h3-max-turbo";
9613
9617
  var H3_RECAST = "minimax/h3-max/recast";
9614
9618
  var H3_RELIGHT = "minimax/h3-max/relight";
9615
- var HAPPY_HORSE = "alibaba/happy-horse/v1.1";
9619
+ var HAPPY_HORSE = "happyhorse-1.1";
9616
9620
  var HAPPY_HORSE_EDIT = "alibaba/happy-horse/video-edit";
9617
9621
  var VIDU_Q4 = "fal-ai/vidu/q4";
9618
9622
  var OMNIHUMAN_V2 = "bytedance/omnihuman/v2";
@@ -9817,7 +9821,7 @@ function fillKlingModeResolution(model, req) {
9817
9821
  }
9818
9822
  }
9819
9823
  function applyFalVideoRules(model, req, callerRatio, warnings) {
9820
- if (model.adapter !== "fal") return;
9824
+ if (model.adapter !== "fal" && model.adapter !== "alibaba") return;
9821
9825
  const problem = falVideoProblem(model.providerModelId, withPromptForResolve(req));
9822
9826
  if (problem !== void 0) throw ruleRefusal(model, problem.message, problem.code);
9823
9827
  const id = model.providerModelId.toLowerCase();