Skip to content

feat(sync): alibaba provider sync script#2950

Open
nathannli wants to merge 23 commits into
anomalyco:devfrom
nathannli:feat/alibaba-sync-fixes
Open

feat(sync): alibaba provider sync script#2950
nathannli wants to merge 23 commits into
anomalyco:devfrom
nathannli:feat/alibaba-sync-fixes

Conversation

@nathannli

@nathannli nathannli commented Jun 30, 2026

Copy link
Copy Markdown

#2121

Summary

  • add Alibaba sync registration, package script, and docs
  • keep sync report output unchanged by dropping skipped-count changes
  • goal is to only add the international sync script in this PR to keep changes small and easy to ready
    • remaining sync scripts:
      1. china
      2. global
    • remaining additions for another PR to complete the international sync additions:
      • toml file changes from running the sync script
      • new base models

Sources

@nathannli

nathannli commented Jun 30, 2026

Copy link
Copy Markdown
Author

output of running sync manually ( i added the "Skipped creating:" section temporarily)

fsh ➜ bun ./packages/core/script/sync-models.ts alibaba

Syncing Alibaba...
Retaining model missing from source: qwen2-5-7b-instruct.toml
Retaining model missing from source: qwen2-5-14b-instruct.toml
Retaining model missing from source: qwen2-5-72b-instruct.toml
Retaining model missing from source: qwen3-vl-235b-a22b.toml
Retaining model missing from source: qwen2-5-vl-7b-instruct.toml
Retaining model missing from source: qwen2-5-vl-72b-instruct.toml
Retaining model missing from source: qwen2-5-32b-instruct.toml
Retaining model missing from source: qwen3-vl-30b-a3b.toml
Retaining model missing from source: qwen2-5-omni-7b.toml
0 created, 42 updated, 0 removed, 179 skipped creating, 9 unchanged
Skipped creating:
  cosyvoice-v3-flash
  cosyvoice-v3-plus
  deepseek-v3.2
  deepseek-v4-flash
  deepseek-v4-pro
  fun-asr
  fun-asr-2025-08-25
  fun-asr-2025-11-07
  fun-asr-flash-2026-06-15
  fun-asr-mtl
  fun-asr-mtl-2025-08-25
  fun-asr-realtime
  fun-asr-realtime-2025-11-07
  glm-5.1
  glm-5.2
  happyhorse-1.0-i2v
  happyhorse-1.0-r2v
  happyhorse-1.0-t2v
  happyhorse-1.0-video-edit
  happyhorse-1.1-i2v
  happyhorse-1.1-r2v
  happyhorse-1.1-t2v
  kimi-k2.7-code
  qwen-flash-2025-07-28
  qwen-flash-character
  qwen-image
  qwen-image-2.0
  qwen-image-2.0-2026-03-03
  qwen-image-2.0-pro
  qwen-image-2.0-pro-2026-03-03
  qwen-image-2.0-pro-2026-04-22
  qwen-image-2.0-pro-2026-06-22
  qwen-image-edit
  qwen-image-edit-max
  qwen-image-edit-max-2026-01-16
  qwen-image-edit-plus
  qwen-image-edit-plus-2025-10-30
  qwen-image-edit-plus-2025-12-15
  qwen-image-max
  qwen-image-max-2025-12-30
  qwen-image-plus
  qwen-image-plus-2026-01-09
  qwen-mt-flash
  qwen-mt-lite
  qwen-omni-turbo-2025-03-26
  qwen-omni-turbo-latest
  qwen-omni-turbo-realtime-2025-05-08
  qwen-omni-turbo-realtime-latest
  qwen-plus-2025-01-25
  qwen-plus-2025-04-28
  qwen-plus-2025-07-14
  qwen-plus-2025-07-28
  qwen-plus-2025-09-11
  qwen-plus-2025-12-01
  qwen-plus-character
  qwen-plus-latest
  qwen-vl-ocr-2025-11-20
  qwen-voice-design
  qwen-voice-enrollment
  qwen2.5-omni-7b
  qwen3-235b-a22b-instruct-2507
  qwen3-235b-a22b-thinking-2507
  qwen3-30b-a3b
  qwen3-30b-a3b-instruct-2507
  qwen3-30b-a3b-thinking-2507
  qwen3-asr-flash-2025-09-08
  qwen3-asr-flash-2026-02-10
  qwen3-asr-flash-filetrans
  qwen3-asr-flash-filetrans-2025-11-17
  qwen3-asr-flash-realtime
  qwen3-asr-flash-realtime-2025-10-27
  qwen3-asr-flash-realtime-2026-02-10
  qwen3-coder-flash-2025-07-28
  qwen3-coder-next
  qwen3-coder-plus-2025-07-22
  qwen3-coder-plus-2025-09-23
  qwen3-livetranslate-flash
  qwen3-livetranslate-flash-2025-12-01
  qwen3-livetranslate-flash-realtime-2025-09-22
  qwen3-max-2025-09-23
  qwen3-max-2026-01-23
  qwen3-max-preview
  qwen3-omni-30b-a3b-captioner
  qwen3-omni-flash-2025-09-15
  qwen3-omni-flash-2025-12-01
  qwen3-omni-flash-realtime-2025-09-15
  qwen3-omni-flash-realtime-2025-12-01
  qwen3-rerank
  qwen3-tts-flash
  qwen3-tts-flash-2025-09-18
  qwen3-tts-flash-2025-11-27
  qwen3-tts-flash-realtime
  qwen3-tts-flash-realtime-2025-09-18
  qwen3-tts-flash-realtime-2025-11-27
  qwen3-tts-instruct-flash
  qwen3-tts-instruct-flash-2026-01-26
  qwen3-tts-instruct-flash-realtime
  qwen3-tts-instruct-flash-realtime-2026-01-22
  qwen3-tts-vc-2026-01-22
  qwen3-tts-vc-realtime-2025-11-27
  qwen3-tts-vc-realtime-2026-01-15
  qwen3-tts-vd-2026-01-26
  qwen3-tts-vd-realtime-2025-12-16
  qwen3-tts-vd-realtime-2026-01-15
  qwen3-vl-235b-a22b-instruct
  qwen3-vl-235b-a22b-thinking
  qwen3-vl-30b-a3b-instruct
  qwen3-vl-30b-a3b-thinking
  qwen3-vl-32b-instruct
  qwen3-vl-32b-thinking
  qwen3-vl-8b-instruct
  qwen3-vl-8b-thinking
  qwen3-vl-flash
  qwen3-vl-flash-2025-10-15
  qwen3-vl-flash-2026-01-22
  qwen3-vl-plus-2025-09-23
  qwen3-vl-plus-2025-12-19
  qwen3.5-flash
  qwen3.5-flash-2026-02-23
  qwen3.5-livetranslate-flash-realtime
  qwen3.5-livetranslate-flash-realtime-2026-05-19
  qwen3.5-omni-flash
  qwen3.5-omni-flash-2026-03-15
  qwen3.5-omni-flash-realtime
  qwen3.5-omni-flash-realtime-2026-03-15
  qwen3.5-omni-plus
  qwen3.5-omni-plus-2026-03-15
  qwen3.5-omni-plus-realtime
  qwen3.5-omni-plus-realtime-2026-03-15
  qwen3.5-plus-2026-02-15
  qwen3.5-plus-2026-04-20
  qwen3.6-flash-2026-04-16
  qwen3.6-plus-2026-04-02
  qwen3.7-max-2026-05-17
  qwen3.7-max-2026-05-20
  qwen3.7-max-2026-06-08
  qwen3.7-max-preview
  qwen3.7-plus-2026-05-26
  text-embedding-v3
  text-embedding-v4
  tongyi-embedding-vision-flash
  tongyi-embedding-vision-plus
  voice-enrollment
  wan2.1-i2v-plus
  wan2.1-i2v-turbo
  wan2.1-kf2v-plus
  wan2.1-t2i-plus
  wan2.1-t2i-turbo
  wan2.1-t2v-plus
  wan2.1-t2v-turbo
  wan2.1-vace-plus
  wan2.2-animate-mix
  wan2.2-animate-move
  wan2.2-i2v-flash
  wan2.2-i2v-plus
  wan2.2-kf2v-flash
  wan2.2-t2i-flash
  wan2.2-t2i-plus
  wan2.2-t2v-plus
  wan2.5-i2i-preview
  wan2.5-i2v-preview
  wan2.5-t2i-preview
  wan2.5-t2v-preview
  wan2.6-i2v
  wan2.6-i2v-flash
  wan2.6-image
  wan2.6-r2v
  wan2.6-r2v-flash
  wan2.6-t2i
  wan2.6-t2v
  wan2.7-i2v
  wan2.7-i2v-2026-04-25
  wan2.7-image
  wan2.7-image-pro
  wan2.7-r2v
  wan2.7-t2v
  wan2.7-t2v-2026-04-25
  wan2.7-videoedit
  z-image-turbo

Sync summary
Alibaba: 0 created, 42 updated, 0 deleted, 179 skipped creating
fsh ➜ gs
On branch feat/alibaba-sync-fixes
Your branch is up to date with 'origin/feat/alibaba-sync-fixes'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   providers/alibaba/models/qvq-max.toml
	modified:   providers/alibaba/models/qwen-flash.toml
	modified:   providers/alibaba/models/qwen-max.toml
	modified:   providers/alibaba/models/qwen-mt-plus.toml
	modified:   providers/alibaba/models/qwen-mt-turbo.toml
	modified:   providers/alibaba/models/qwen-omni-turbo-realtime.toml
	modified:   providers/alibaba/models/qwen-omni-turbo.toml
	modified:   providers/alibaba/models/qwen-plus-character-ja.toml
	modified:   providers/alibaba/models/qwen-plus.toml
	modified:   providers/alibaba/models/qwen-turbo.toml
	modified:   providers/alibaba/models/qwen-vl-max.toml
	modified:   providers/alibaba/models/qwen-vl-ocr.toml
	modified:   providers/alibaba/models/qwen-vl-plus.toml
	modified:   providers/alibaba/models/qwen3-14b.toml
	modified:   providers/alibaba/models/qwen3-235b-a22b.toml
	modified:   providers/alibaba/models/qwen3-32b.toml
	modified:   providers/alibaba/models/qwen3-8b.toml
	modified:   providers/alibaba/models/qwen3-asr-flash.toml
	modified:   providers/alibaba/models/qwen3-coder-30b-a3b-instruct.toml
	modified:   providers/alibaba/models/qwen3-coder-480b-a35b-instruct.toml
	modified:   providers/alibaba/models/qwen3-coder-flash.toml
	modified:   providers/alibaba/models/qwen3-coder-plus.toml
	modified:   providers/alibaba/models/qwen3-livetranslate-flash-realtime.toml
	modified:   providers/alibaba/models/qwen3-max.toml
	modified:   providers/alibaba/models/qwen3-next-80b-a3b-instruct.toml
	modified:   providers/alibaba/models/qwen3-next-80b-a3b-thinking.toml
	modified:   providers/alibaba/models/qwen3-omni-flash-realtime.toml
	modified:   providers/alibaba/models/qwen3-omni-flash.toml
	modified:   providers/alibaba/models/qwen3-vl-plus.toml
	modified:   providers/alibaba/models/qwen3.5-122b-a10b.toml
	modified:   providers/alibaba/models/qwen3.5-27b.toml
	modified:   providers/alibaba/models/qwen3.5-35b-a3b.toml
	modified:   providers/alibaba/models/qwen3.5-397b-a17b.toml
	modified:   providers/alibaba/models/qwen3.5-plus.toml
	modified:   providers/alibaba/models/qwen3.6-27b.toml
	modified:   providers/alibaba/models/qwen3.6-35b-a3b.toml
	modified:   providers/alibaba/models/qwen3.6-flash.toml
	modified:   providers/alibaba/models/qwen3.6-max-preview.toml
	modified:   providers/alibaba/models/qwen3.6-plus.toml
	modified:   providers/alibaba/models/qwen3.7-max.toml
	modified:   providers/alibaba/models/qwen3.7-plus.toml
	modified:   providers/alibaba/models/qwq-plus.toml

no changes added to commit (use "git add" and/or "git commit -a")

@nathannli

Copy link
Copy Markdown
Author

spot checked a few via https://modelstudio.console.alibabacloud.com/ap-southeast-1?spm=a2ty_o05.31384571.0.0.5e7d9f6bAkjBB4&tab=doc#/doc/?type=model&url=prices and prices match up

fsh ➜ bun run compare:migrations
$ bun ./packages/core/script/compare-model-migrations.ts
--- providers/alibaba/models/qvq-max.toml (before)
+++ providers/alibaba/models/qvq-max.toml (after)
@@ -15,7 +15,9 @@
   "modalities": {
     "input": [
       "text",
-      "image"
+      "image",
+      "video",
+      "pdf"
     ],
     "output": [
       "text"
@@ -26,6 +28,7 @@
   "reasoning": true,
   "reasoning_options": [],
   "release_date": "2025-03-25",
+  "structured_output": false,
   "temperature": true,
   "tool_call": true
 }
--- providers/alibaba/models/qwen-flash.toml (before)
+++ providers/alibaba/models/qwen-flash.toml (after)
@@ -1,8 +1,28 @@
 {
   "attachment": false,
   "cost": {
+    "cache_read": 0.01,
+    "cache_write": 0.063,
+    "context_over_200k": {
+      "cache_read": 0.05,
+      "cache_write": 0.313,
+      "input": 0.25,
+      "output": 2
+    },
     "input": 0.05,
-    "output": 0.4
+    "output": 0.4,
+    "tiers": [
+      {
+        "cache_read": 0.05,
+        "cache_write": 0.313,
+        "input": 0.25,
+        "output": 2,
+        "tier": {
+          "size": 256000,
+          "type": "context"
+        }
+      }
+    ]
   },
   "family": "qwen",
   "id": "qwen-flash",
--- providers/alibaba/models/qwen-max.toml (before)
+++ providers/alibaba/models/qwen-max.toml (after)
@@ -1,6 +1,7 @@
 {
   "attachment": false,
   "cost": {
+    "cache_read": 0.32,
     "input": 1.6,
     "output": 6.4
   },
--- providers/alibaba/models/qwen-mt-plus.toml (before)
+++ providers/alibaba/models/qwen-mt-plus.toml (after)
@@ -9,8 +9,8 @@
   "knowledge": "2024-04",
   "last_updated": "2025-01",
   "limit": {
-    "context": 16384,
-    "output": 8192
+    "context": 4096,
+    "output": 2048
   },
   "modalities": {
     "input": [
@@ -24,6 +24,7 @@
   "open_weights": false,
   "reasoning": false,
   "release_date": "2025-01",
+  "structured_output": false,
   "temperature": true,
   "tool_call": false
 }
--- providers/alibaba/models/qwen-mt-turbo.toml (before)
+++ providers/alibaba/models/qwen-mt-turbo.toml (after)
@@ -9,8 +9,8 @@
   "knowledge": "2024-04",
   "last_updated": "2025-01",
   "limit": {
-    "context": 16384,
-    "output": 8192
+    "context": 4096,
+    "output": 2048
   },
   "modalities": {
     "input": [
@@ -24,6 +24,7 @@
   "open_weights": false,
   "reasoning": false,
   "release_date": "2025-01",
+  "structured_output": false,
   "temperature": true,
   "tool_call": false
 }
--- providers/alibaba/models/qwen-omni-turbo-realtime.toml (before)
+++ providers/alibaba/models/qwen-omni-turbo-realtime.toml (after)
@@ -29,6 +29,7 @@
   "open_weights": false,
   "reasoning": false,
   "release_date": "2025-05-08",
+  "structured_output": false,
   "temperature": true,
   "tool_call": true
 }
--- providers/alibaba/models/qwen-plus-character-ja.toml (before)
+++ providers/alibaba/models/qwen-plus-character-ja.toml (after)
@@ -1,6 +1,7 @@
 {
   "attachment": false,
   "cost": {
+    "cache_read": 0.1,
     "input": 0.5,
     "output": 1.4
   },
@@ -24,6 +25,7 @@
   "open_weights": false,
   "reasoning": false,
   "release_date": "2024-01",
+  "structured_output": false,
   "temperature": true,
   "tool_call": true
 }
--- providers/alibaba/models/qwen-plus.toml (before)
+++ providers/alibaba/models/qwen-plus.toml (after)
@@ -1,9 +1,31 @@
 {
   "attachment": false,
   "cost": {
+    "cache_read": 0.08,
+    "cache_write": 0.5,
+    "context_over_200k": {
+      "cache_read": 0.24,
+      "cache_write": 1.5,
+      "input": 1.2,
+      "output": 3.6,
+      "reasoning": 12
+    },
     "input": 0.4,
     "output": 1.2,
-    "reasoning": 4
+    "reasoning": 4,
+    "tiers": [
+      {
+        "cache_read": 0.24,
+        "cache_write": 1.5,
+        "input": 1.2,
+        "output": 3.6,
+        "reasoning": 12,
+        "tier": {
+          "size": 256000,
+          "type": "context"
+        }
+      }
+    ]
   },
   "family": "qwen",
   "id": "qwen-plus",
--- providers/alibaba/models/qwen-turbo.toml (before)
+++ providers/alibaba/models/qwen-turbo.toml (after)
@@ -1,6 +1,7 @@
 {
   "attachment": false,
   "cost": {
+    "cache_read": 0.01,
     "input": 0.05,
     "output": 0.2,
     "reasoning": 0.5
@@ -10,8 +11,8 @@
   "knowledge": "2024-04",
   "last_updated": "2025-04-28",
   "limit": {
-    "context": 1000000,
-    "output": 16384
+    "context": 131072,
+    "output": 8192
   },
   "modalities": {
     "input": [
--- providers/alibaba/models/qwen-vl-max.toml (before)
+++ providers/alibaba/models/qwen-vl-max.toml (after)
@@ -1,6 +1,7 @@
 {
   "attachment": false,
   "cost": {
+    "cache_read": 0.16,
     "input": 0.8,
     "output": 3.2
   },
@@ -10,12 +11,14 @@
   "last_updated": "2025-08-13",
   "limit": {
     "context": 131072,
-    "output": 8192
+    "output": 32768
   },
   "modalities": {
     "input": [
       "text",
-      "image"
+      "image",
+      "video",
+      "pdf"
     ],
     "output": [
       "text"
--- providers/alibaba/models/qwen-vl-ocr.toml (before)
+++ providers/alibaba/models/qwen-vl-ocr.toml (after)
@@ -1,21 +1,21 @@
 {
   "attachment": false,
   "cost": {
-    "input": 0.72,
-    "output": 0.72
+    "input": 0.07,
+    "output": 0.16
   },
   "family": "qwen",
   "id": "qwen-vl-ocr",
   "knowledge": "2024-04",
   "last_updated": "2025-04-13",
   "limit": {
-    "context": 34096,
-    "output": 4096
+    "context": 38192,
+    "output": 8192
   },
   "modalities": {
     "input": [
-      "text",
-      "image"
+      "image",
+      "pdf"
     ],
     "output": [
       "text"
@@ -25,6 +25,7 @@
   "open_weights": false,
   "reasoning": false,
   "release_date": "2024-10-28",
+  "structured_output": false,
   "temperature": true,
   "tool_call": false
 }
--- providers/alibaba/models/qwen-vl-plus.toml (before)
+++ providers/alibaba/models/qwen-vl-plus.toml (after)
@@ -1,6 +1,7 @@
 {
   "attachment": false,
   "cost": {
+    "cache_read": 0.042,
     "input": 0.21,
     "output": 0.63
   },
@@ -15,7 +16,9 @@
   "modalities": {
     "input": [
       "text",
-      "image"
+      "image",
+      "video",
+      "pdf"
     ],
     "output": [
       "text"
--- providers/alibaba/models/qwen3-14b.toml (before)
+++ providers/alibaba/models/qwen3-14b.toml (after)
@@ -33,6 +33,7 @@
     }
   ],
   "release_date": "2025-04",
+  "structured_output": true,
   "temperature": true,
   "tool_call": true
 }
--- providers/alibaba/models/qwen3-235b-a22b.toml (before)
+++ providers/alibaba/models/qwen3-235b-a22b.toml (after)
@@ -11,7 +11,7 @@
   "last_updated": "2025-04",
   "limit": {
     "context": 131072,
-    "output": 16384
+    "output": 8192
   },
   "modalities": {
     "input": [
--- providers/alibaba/models/qwen3-32b.toml (before)
+++ providers/alibaba/models/qwen3-32b.toml (after)
@@ -1,9 +1,9 @@
 {
   "attachment": false,
   "cost": {
-    "input": 0.7,
-    "output": 2.8,
-    "reasoning": 8.4
+    "input": 0.16,
+    "output": 0.64,
+    "reasoning": 0.64
   },
   "family": "qwen",
   "id": "qwen3-32b",
@@ -11,7 +11,7 @@
   "last_updated": "2025-04",
   "limit": {
     "context": 131072,
-    "output": 16384
+    "output": 8192
   },
   "modalities": {
     "input": [
--- providers/alibaba/models/qwen3-8b.toml (before)
+++ providers/alibaba/models/qwen3-8b.toml (after)
@@ -33,6 +33,7 @@
     }
   ],
   "release_date": "2025-04",
+  "structured_output": true,
   "temperature": true,
   "tool_call": true
 }
--- providers/alibaba/models/qwen3-asr-flash.toml (before)
+++ providers/alibaba/models/qwen3-asr-flash.toml (after)
@@ -24,6 +24,7 @@
   "open_weights": false,
   "reasoning": false,
   "release_date": "2025-09-08",
+  "structured_output": false,
   "temperature": false,
   "tool_call": false
 }
--- providers/alibaba/models/qwen3-coder-30b-a3b-instruct.toml (before)
+++ providers/alibaba/models/qwen3-coder-30b-a3b-instruct.toml (after)
@@ -2,7 +2,33 @@
   "attachment": false,
   "cost": {
     "input": 0.45,
-    "output": 2.25
+    "output": 2.25,
+    "tiers": [
+      {
+        "input": 0.75,
+        "output": 3.75,
+        "tier": {
+          "size": 32000,
+          "type": "context"
+        }
+      },
+      {
+        "input": 1.2,
+        "output": 6,
+        "tier": {
+          "size": 128000,
+          "type": "context"
+        }
+      },
+      {
+        "input": 2.4,
+        "output": 14.4,
+        "tier": {
+          "size": 256000,
+          "type": "context"
+        }
+      }
+    ]
   },
   "family": "qwen",
   "id": "qwen3-coder-30b-a3b-instruct",
--- providers/alibaba/models/qwen3-coder-480b-a35b-instruct.toml (before)
+++ providers/alibaba/models/qwen3-coder-480b-a35b-instruct.toml (after)
@@ -2,7 +2,33 @@
   "attachment": false,
   "cost": {
     "input": 1.5,
-    "output": 7.5
+    "output": 7.5,
+    "tiers": [
+      {
+        "input": 2.7,
+        "output": 13.5,
+        "tier": {
+          "size": 32000,
+          "type": "context"
+        }
+      },
+      {
+        "input": 4.5,
+        "output": 22.5,
+        "tier": {
+          "size": 128000,
+          "type": "context"
+        }
+      },
+      {
+        "input": 9,
+        "output": 90,
+        "tier": {
+          "size": 256000,
+          "type": "context"
+        }
+      }
+    ]
   },
   "family": "qwen",
   "id": "qwen3-coder-480b-a35b-instruct",
--- providers/alibaba/models/qwen3-coder-flash.toml (before)
+++ providers/alibaba/models/qwen3-coder-flash.toml (after)
@@ -1,8 +1,42 @@
 {
   "attachment": false,
   "cost": {
+    "cache_read": 0.06,
+    "cache_write": 0.375,
     "input": 0.3,
-    "output": 1.5
+    "output": 1.5,
+    "tiers": [
+      {
+        "cache_read": 0.1,
+        "cache_write": 0.625,
+        "input": 0.5,
+        "output": 2.5,
+        "tier": {
+          "size": 32000,
+          "type": "context"
+        }
+      },
+      {
+        "cache_read": 0.16,
+        "cache_write": 1,
+        "input": 0.8,
+        "output": 4,
+        "tier": {
+          "size": 128000,
+          "type": "context"
+        }
+      },
+      {
+        "cache_read": 0.32,
+        "cache_write": 2,
+        "input": 1.6,
+        "output": 9.6,
+        "tier": {
+          "size": 256000,
+          "type": "context"
+        }
+      }
+    ]
   },
   "family": "qwen",
   "id": "qwen3-coder-flash",
--- providers/alibaba/models/qwen3-coder-plus.toml (before)
+++ providers/alibaba/models/qwen3-coder-plus.toml (after)
@@ -1,15 +1,49 @@
 {
   "attachment": false,
   "cost": {
+    "cache_read": 0.2,
+    "cache_write": 1.25,
     "input": 1,
-    "output": 5
+    "output": 5,
+    "tiers": [
+      {
+        "cache_read": 0.36,
+        "cache_write": 2.25,
+        "input": 1.8,
+        "output": 9,
+        "tier": {
+          "size": 32000,
+          "type": "context"
+        }
+      },
+      {
+        "cache_read": 0.6,
+        "cache_write": 3.75,
+        "input": 3,
+        "output": 15,
+        "tier": {
+          "size": 128000,
+          "type": "context"
+        }
+      },
+      {
+        "cache_read": 1.2,
+        "cache_write": 7.5,
+        "input": 6,
+        "output": 60,
+        "tier": {
+          "size": 256000,
+          "type": "context"
+        }
+      }
+    ]
   },
   "family": "qwen",
   "id": "qwen3-coder-plus",
   "knowledge": "2025-04",
   "last_updated": "2025-07-23",
   "limit": {
-    "context": 1048576,
+    "context": 1000000,
     "output": 65536
   },
   "modalities": {
--- providers/alibaba/models/qwen3-livetranslate-flash-realtime.toml (before)
+++ providers/alibaba/models/qwen3-livetranslate-flash-realtime.toml (after)
@@ -1,7 +1,7 @@
 {
   "attachment": false,
   "cost": {
-    "input": 10,
+    "input": 1.3,
     "input_audio": 10,
     "output": 10,
     "output_audio": 38
@@ -16,10 +16,8 @@
   },
   "modalities": {
     "input": [
-      "text",
       "image",
-      "audio",
-      "video"
+      "audio"
     ],
     "output": [
       "text",
@@ -30,6 +28,7 @@
   "open_weights": false,
   "reasoning": false,
   "release_date": "2025-09-22",
+  "structured_output": false,
   "temperature": true,
   "tool_call": false
 }
--- providers/alibaba/models/qwen3-max.toml (before)
+++ providers/alibaba/models/qwen3-max.toml (after)
@@ -1,8 +1,32 @@
 {
   "attachment": false,
   "cost": {
+    "cache_read": 0.24,
+    "cache_write": 1.5,
     "input": 1.2,
-    "output": 6
+    "output": 6,
+    "tiers": [
+      {
+        "cache_read": 0.48,
+        "cache_write": 3,
+        "input": 2.4,
+        "output": 12,
+        "tier": {
+          "size": 32000,
+          "type": "context"
+        }
+      },
+      {
+        "cache_read": 0.6,
+        "cache_write": 3.75,
+        "input": 3,
+        "output": 15,
+        "tier": {
+          "size": 128000,
+          "type": "context"
+        }
+      }
+    ]
   },
   "family": "qwen",
   "id": "qwen3-max",
--- providers/alibaba/models/qwen3-next-80b-a3b-instruct.toml (before)
+++ providers/alibaba/models/qwen3-next-80b-a3b-instruct.toml (after)
@@ -1,8 +1,8 @@
 {
   "attachment": false,
   "cost": {
-    "input": 0.5,
-    "output": 2
+    "input": 0.15,
+    "output": 1.2
   },
   "family": "qwen",
   "id": "qwen3-next-80b-a3b-instruct",
--- providers/alibaba/models/qwen3-omni-flash-realtime.toml (before)
+++ providers/alibaba/models/qwen3-omni-flash-realtime.toml (after)
@@ -11,8 +11,8 @@
   "knowledge": "2024-04",
   "last_updated": "2025-09-15",
   "limit": {
-    "context": 65536,
-    "output": 16384
+    "context": 64000,
+    "output": 8000
   },
   "modalities": {
     "input": [
@@ -30,6 +30,7 @@
   "open_weights": false,
   "reasoning": false,
   "release_date": "2025-09-15",
+  "structured_output": false,
   "temperature": true,
   "tool_call": true
 }
--- providers/alibaba/models/qwen3-omni-flash.toml (before)
+++ providers/alibaba/models/qwen3-omni-flash.toml (after)
@@ -35,6 +35,7 @@
     }
   ],
   "release_date": "2025-09-15",
+  "structured_output": false,
   "temperature": true,
   "tool_call": true
 }
--- providers/alibaba/models/qwen3-vl-plus.toml (before)
+++ providers/alibaba/models/qwen3-vl-plus.toml (after)
@@ -1,9 +1,35 @@
 {
   "attachment": false,
   "cost": {
+    "cache_read": 0.04,
+    "cache_write": 0.25,
     "input": 0.2,
     "output": 1.6,
-    "reasoning": 4.8
+    "reasoning": 4.8,
+    "tiers": [
+      {
+        "cache_read": 0.06,
+        "cache_write": 0.375,
+        "input": 0.3,
+        "output": 2.4,
+        "reasoning": 4.8,
+        "tier": {
+          "size": 32000,
+          "type": "context"
+        }
+      },
+      {
+        "cache_read": 0.12,
+        "cache_write": 0.75,
+        "input": 0.6,
+        "output": 4.8,
+        "reasoning": 4.8,
+        "tier": {
+          "size": 128000,
+          "type": "context"
+        }
+      }
+    ]
   },
   "family": "qwen",
   "id": "qwen3-vl-plus",
@@ -16,7 +42,9 @@
   "modalities": {
     "input": [
       "text",
-      "image"
+      "image",
+      "video",
+      "pdf"
     ],
     "output": [
       "text"
--- providers/alibaba/models/qwen3.5-122b-a10b.toml (before)
+++ providers/alibaba/models/qwen3.5-122b-a10b.toml (after)
@@ -16,7 +16,7 @@
       "text",
       "image",
       "video",
-      "audio"
+      "pdf"
     ],
     "output": [
       "text"
--- providers/alibaba/models/qwen3.5-27b.toml (before)
+++ providers/alibaba/models/qwen3.5-27b.toml (after)
@@ -16,7 +16,7 @@
       "text",
       "image",
       "video",
-      "audio"
+      "pdf"
     ],
     "output": [
       "text"
--- providers/alibaba/models/qwen3.5-35b-a3b.toml (before)
+++ providers/alibaba/models/qwen3.5-35b-a3b.toml (after)
@@ -16,7 +16,7 @@
       "text",
       "image",
       "video",
-      "audio"
+      "pdf"
     ],
     "output": [
       "text"
--- providers/alibaba/models/qwen3.5-397b-a17b.toml (before)
+++ providers/alibaba/models/qwen3.5-397b-a17b.toml (after)
@@ -16,7 +16,7 @@
       "text",
       "image",
       "video",
-      "audio"
+      "pdf"
     ],
     "output": [
       "text"
--- providers/alibaba/models/qwen3.5-plus.toml (before)
+++ providers/alibaba/models/qwen3.5-plus.toml (after)
@@ -1,9 +1,31 @@
 {
   "attachment": false,
   "cost": {
+    "cache_read": 0.04,
+    "cache_write": 0.5,
+    "context_over_200k": {
+      "cache_read": 0.05,
+      "cache_write": 0.625,
+      "input": 0.5,
+      "output": 3,
+      "reasoning": 2.4
+    },
     "input": 0.4,
     "output": 2.4,
-    "reasoning": 2.4
+    "reasoning": 2.4,
+    "tiers": [
+      {
+        "cache_read": 0.05,
+        "cache_write": 0.625,
+        "input": 0.5,
+        "output": 3,
+        "reasoning": 2.4,
+        "tier": {
+          "size": 256000,
+          "type": "context"
+        }
+      }
+    ]
   },
   "family": "qwen",
   "id": "qwen3.5-plus",
@@ -17,7 +39,8 @@
     "input": [
       "text",
       "image",
-      "video"
+      "video",
+      "pdf"
     ],
     "output": [
       "text"
--- providers/alibaba/models/qwen3.6-27b.toml (before)
+++ providers/alibaba/models/qwen3.6-27b.toml (after)
@@ -13,10 +13,10 @@
   },
   "modalities": {
     "input": [
-      "text",
       "image",
+      "text",
       "video",
-      "audio"
+      "pdf"
     ],
     "output": [
       "text"
--- providers/alibaba/models/qwen3.6-35b-a3b.toml (before)
+++ providers/alibaba/models/qwen3.6-35b-a3b.toml (after)
@@ -1,8 +1,8 @@
 {
   "attachment": true,
   "cost": {
-    "input": 0.248,
-    "output": 1.485
+    "input": 0.375,
+    "output": 2.25
   },
   "family": "qwen",
   "id": "qwen3.6-35b-a3b",
@@ -13,10 +13,10 @@
   },
   "modalities": {
     "input": [
-      "text",
       "image",
+      "text",
       "video",
-      "audio"
+      "pdf"
     ],
     "output": [
       "text"
--- providers/alibaba/models/qwen3.6-flash.toml (before)
+++ providers/alibaba/models/qwen3.6-flash.toml (after)
@@ -1,9 +1,28 @@
 {
   "attachment": true,
   "cost": {
-    "cache_write": 0.234375,
-    "input": 0.1875,
-    "output": 1.125
+    "cache_read": 0.025,
+    "cache_write": 0.3125,
+    "context_over_200k": {
+      "cache_read": 0.1,
+      "cache_write": 1.25,
+      "input": 1,
+      "output": 4
+    },
+    "input": 0.25,
+    "output": 1.5,
+    "tiers": [
+      {
+        "cache_read": 0.1,
+        "cache_write": 1.25,
+        "input": 1,
+        "output": 4,
+        "tier": {
+          "size": 256000,
+          "type": "context"
+        }
+      }
+    ]
   },
   "family": "qwen3.6",
   "id": "qwen3.6-flash",
@@ -14,9 +33,10 @@
   },
   "modalities": {
     "input": [
-      "text",
       "image",
-      "video"
+      "text",
+      "video",
+      "pdf"
     ],
     "output": [
       "text"
--- providers/alibaba/models/qwen3.6-max-preview.toml (before)
+++ providers/alibaba/models/qwen3.6-max-preview.toml (after)
@@ -4,7 +4,19 @@
     "cache_read": 0.13,
     "cache_write": 1.625,
     "input": 1.3,
-    "output": 7.8
+    "output": 7.8,
+    "tiers": [
+      {
+        "cache_read": 0.2,
+        "cache_write": 2.5,
+        "input": 2,
+        "output": 12,
+        "tier": {
+          "size": 128000,
+          "type": "context"
+        }
+      }
+    ]
   },
   "family": "qwen",
   "id": "qwen3.6-max-preview",
--- providers/alibaba/models/qwen3.6-plus.toml (before)
+++ providers/alibaba/models/qwen3.6-plus.toml (after)
@@ -34,9 +34,10 @@
   },
   "modalities": {
     "input": [
-      "text",
       "image",
-      "video"
+      "text",
+      "video",
+      "pdf"
     ],
     "output": [
       "text"
--- providers/alibaba/models/qwen3.7-plus.toml (before)
+++ providers/alibaba/models/qwen3.7-plus.toml (after)
@@ -1,22 +1,22 @@
 {
   "attachment": false,
   "cost": {
-    "cache_read": 0.05,
-    "cache_write": 0.625,
+    "cache_read": 0.08,
+    "cache_write": 0.5,
     "context_over_200k": {
-      "cache_read": 0.2,
-      "cache_write": 2.5,
-      "input": 2,
-      "output": 6
+      "cache_read": 0.24,
+      "cache_write": 1.5,
+      "input": 1.2,
+      "output": 4.8
     },
-    "input": 0.5,
-    "output": 3,
+    "input": 0.4,
+    "output": 1.6,
     "tiers": [
       {
-        "cache_read": 0.2,
-        "cache_write": 2.5,
-        "input": 2,
-        "output": 6,
+        "cache_read": 0.24,
+        "cache_write": 1.5,
+        "input": 1.2,
+        "output": 4.8,
         "tier": {
           "size": 256000,
           "type": "context"
@@ -34,9 +34,10 @@
   },
   "modalities": {
     "input": [
-      "text",
       "image",
-      "video"
+      "text",
+      "video",
+      "pdf"
     ],
     "output": [
       "text"

@nathannli

Copy link
Copy Markdown
Author

waiting for automated review to trigger..

@nathannli nathannli changed the title [alibaba] | Sync Script feat(sync) | alibaba sync script Jul 2, 2026
@nathannli nathannli changed the title feat(sync) | alibaba sync script feat(sync): alibaba provider sync script Jul 2, 2026
nathannli and others added 23 commits July 2, 2026 20:17
DashScope's inference_metadata.request_modality never surfaces pdf, but
vision-understanding models accept PDF inputs (the underlying VL stack
parses document pages as images). Push pdf into modalities.input only
for models with the VU capability instead of fabricating it for every
image-input model.

Refs: alibabacloud.com/model-studio vision-model docs
The cost.output chain was falling back to image_number, content_duration*1000,
and cosy_tts_number when no output_token was present. Those fields are per-image,
per-second, and per-character respectively — writing them into cost.output
silently corrupts the per-token semantic for image-gen, ASR, and TTS models
(e.g. qwen3-asr-flash's hand-curated output would be overwritten on next sync).

Match google.ts: preserve existing.cost for models without a token output price.
The sync script perpetuated existing.reasoning_options verbatim, leaving 5
reasoning models (qvq-max, qwen3-next-80b-a3b-thinking, qwen3-vl-235b-a22b,
qwen3-vl-30b-a3b, qwq-plus) without a reasoning_options block on every sync.

Default to [] when reasoning is true and the TOML has no existing options.
Hand-curated values (qwen3.5-plus et al.) are preserved. DashScope's catalog
blob has no signal for reasoning controls, so [] is the honest default.
DashScope renamed the text/image/video input bucket to
omni_no_audio_input_token and the text-only output bucket to
omni_no_audio_output_token in the qwen3.5 omni series
(qwen3.5-omni-flash, qwen3.5-omni-plus, +realtime). Add them
to the input/output lookup lists so sync captures the rates
instead of falling through to 0.

Old omni models still report text_input_token / purein_text_output_token
and match those first, so no behavior change for them.
DashScope exposes tiered pricing with named ranges (e.g.
'Input<=128k', '128k<Input<=256k'). The catalog schema's
context_over_200k is a sync-only convenience field that lets
consumers read the 200k+ rate directly without walking the
tiers array. Without this, models with a base tier ending below
200k silently misreport their 200k+ cost (qwen3.6-max-preview
shows the 128k base rate 1.3/7.8 at 200k+ context instead of
the correct 2.0/12.0).

Find the tier with the largest lowerBound that is still < 200,000.
That tier covers the 200k+ range (its upper bound is the next tier
or the model's context_window). If only the base covers 200k+
(no non-base tier below 200k), omit the field so consumers fall
back to cost.input/cost.output.

Affects 7 intl models whose tier structure crosses 200k:
qwen3.6-max-preview and the qwen3-coder-{plus,flash,30b-a3b-instruct,
480b-a35b-instruct,plus-2025-09-23,plus-2025-07-22,flash-2025-07-28} family.

The as unknown as Cost cast widens the return type: SyncedFullModel
is typed as AuthoredCost (forbids context_over_200k) but the
catalog validates the synced output as OutputCost (allows it).
The previous code rebuilt tiers from the API via ranges.slice(1),
silently overwriting any hand-curated tiers in the TOML even when
the team had curated additional tiers (e.g. per-tier cache_read
values the API doesn't expose).

Now compare apiTiers.length vs existingTiers.length:
- API has at least as many tiers as the TOML: API wins (up to date)
- TOML has more tiers: preserve the TOML's (hand-curated, the API
  is behind)
- API has no ranges: return existing.cost wholesale (unchanged)

The base rate is still spread into the top-level cost so consumers
can read the default rate without indexing into tiers[0]. Each
tier carries its lowerBound as size — a tier with size: N covers
N < context <= (next tier's size, or model context_window).
- context_over_200k is owned by generate.ts (derived from tiers at
  build time). Sync output validates as AuthoredCost which forbids
  it; writing it crashes safeParse when tiers exist. Drop the
  computation, the field, and the `as unknown as Cost` cast.
- Tiers: API is the source of truth; hand-curated TOML tiers are
  never preserved.
equivalent_snapshot and inference_provider are declared in
AlibabaModel but never read. .passthrough() preserves them at
runtime if a use ever appears.
- cache_read/cache_write: API-only, no `?? existing` fallback.
  DashScope reliably exposes cache price types; omission is
  intentional. Differs from reasoning/input_audio/output_audio
  which keep the fallback (less reliable API exposure).
- imageOutput/duration/tts: guard-only. The Cost schema has no
  field for per-image/per-second/per-char pricing; the arms
  suppress early-return so `?? existing` preserves curated token
  cost for non-token models (qwen3-asr-flash, content_duration
  only — without the arm, requireExisting("cost") throws).
When a model has base metadata (models/<id>/<model>.toml) but no
provider TOML, mint a thin stub (base_model + reasoning default +
API cost) via factorBaseModel inheritance. Skip if no base
metadata or no API pricing. 0 candidates today — forward-looking
for future base-metadata additions.

L4: replace `requireExisting(...) as cast` (factorBaseModel's
required 3rd arg feeds baseModelOmit, crashes on undefined) with
limitForOmit = translatedLimit ?? baseLimit, matching all other
factorBaseModel callers.

L1: reasoning base_model models default reasoning_options to []
when neither provider nor base metadata supply them; inherited
options left to factorBaseModel.

Helpers baseModelMetadata/baseModelMetadataExists read base
metadata locally (MODELS_DIR 5 levels up). openrouter.ts and
other vendor sync scripts untouched.
Implements the auto-create shape from d0f3203's intent commit:
skipCreates defaults to false, and translateModel returns undefined
only when both existing and base are missing. New models with a
models/alibaba/<id>.toml base match are minted as thin stubs via
factorBaseModel; required inline fields (family, temperature,
open_weights, knowledge) are passed as undefined so the base is the
sole authority and the API's empty signals can't override true base
values with false.

L1: drop the unreachable baseModelMetadataExists create-branch from
the original PR; replace with resolveAlibabaBaseModel walking the
models/<id>/ directory. New-model + base-matched path routes through
buildAlibabaModel's thin-stub branch (which already factored
limitForOmit correctly).

L2: cost/limit/modalities now accept ExistingModel | undefined so the
new-model path can call them without throwing on undefined.

L3: reasoning_options guard restored — default to [] only when the
base has no options of its own, otherwise leave undefined so any
future curated base options inherit cleanly.

L4: buildAlibabaModel signature takes baseModel as the third arg,
defaulting to existing?.base_model ?? resolveAlibabaBaseModel(id).
Existing-model callers are unchanged; new-model callers pass the
resolved base explicitly.

Verified: bun validate exit 0 (51 existing TOMLs round-trip),
bun models:sync alibaba --dry-run exit 0 (0 created, 42 updated,
9 unchanged, 9 retained via missingNotice), and a targeted
buildAlibabaModel check confirms the new-model + base-matched
path emits a thin stub with no fabricated overrides and refuses
the unreachable (existing=undefined, baseModel=undefined) state.
Match the shape of google.ts / xai.ts / chutes.ts / ovhcloud.ts /
baseten.ts / venice.ts. Drops the AlibabaProviderOptions interface
and createAlibabaProvider factory; the alibaba provider is now a
single object literal that hardcodes the intl deployment config
(DASHSCOPE_API_KEY, INTL_API_ENDPOINT, international prose).

Net: 80 inserts, 104 deletes (-24 lines). No behavior change.
Verified: bun validate, bun models:sync alibaba --dry-run, and the
targeted buildAlibabaModel check all stay green.
The intl API has 7 unique range_name values, all English with
ASCII <=; the Chinese (输入) alternative is never used. Verified
via live API curl.

  $ jq -rs '[.[] | .output.models[] | .prices[]? | .range_name] | unique' ...
  [
    "128k<Input<=256k",
    "256k<Input<=1m",
    "32k<Input<=128k",
    "Default",
    "Input<=128k",
    "Input<=256k",
    "Input<=32k"
  ]

The Chinese branch was speculative scaffolding for the China
deployment, which we don't sync. A China sync would need its own
tierLowerBound (different API, different locale conventions)
anyway — keeping the 输入 handling in the intl version conflates
two deployments.

Verified: bun validate, bun models:sync alibaba --dry-run, and the
targeted buildAlibabaModel check all stay green. The cleanup
produces identical results on all 221 intl models.
The pdf modality fudge relied solely on the (undocumented) VU
capability. Live intl catalog has 2 VL models where DashScope
omits VU despite the vl-segment in the model id:

  $ jq -rs '[.[] | .output.models[] | select(((.capabilities // [])
      | contains(["VU"])) | not) | select(((.model | ascii_downcase)
      | contains("vl"))) | .model]' …
  [
    "qwen3-vl-32b-instruct",
    "qwen3-vl-32b-thinking"
  ]

Add a second signal: a segment regex matching vl as a delimited
token (qwen3-vl-32b, qwen-vl-max). Avoids false positives from
arbitrary substrings containing vl (e.g. a hypothetical 'evolve-7b'
would not match because there's no leading delimiter before vl).

Behavior:
- 16 models with both VU and vl-substring: pdf added via VU
  (existing behavior preserved).
- 21 models with VU only (qwen3.5-plus, qvq-max, wan2.2-kf2v-flash,
  kimi-k2.7-code, etc.): pdf added via VU (existing behavior).
- 2 models with vl-substring only (qwen3-vl-32b-*): pdf now added
  via the segment regex. Without this fix, pdf was silently missing
  for these models.
- 182 models with neither: no pdf (unchanged).

Verified: bun validate, bun models:sync alibaba --dry-run, and the
targeted buildAlibabaModel check all stay green.
Match chutes/openrouter; file used tabs.
existsSync is case-insensitive on macOS; a wrong-case base file would mint a stub locally but skip on Linux CI. Mirror chutes' canonicalExists.
fetchModelsPage and parseModels both ran AlibabaCatalogResponse.parse, validating every model twice. fetchModelsPage now uses a light AlibabaCatalogPage envelope; parseModels does the single full model parse.
@nathannli nathannli force-pushed the feat/alibaba-sync-fixes branch from a3592d5 to f420bb1 Compare July 3, 2026 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant