Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

model-meta.ts

1,158 lines38.1 KB

1/**
2 * BytePlus ModelArk model metadata.
3 *
4 * Every hand-written Ark model id in this file — chat, video and image — was
5 * verified live against `https://ark.ap-southeast.bytepluses.com/api/v3` on
6 * 2026-07-31. Two kinds of id are the exception. The two Seed Speech ids live
7 * on the voice host, which needs a separate key that was not available, so
8 * they are docs-derived. Chat ids added by `scripts/sync-provider-models.ts`
9 * come from the modelschemas catalog and were not live-probed; the sync never
10 * adds them to the structured-output or thinking-summary lists below.
11 * Capability metadata is a mix of probed and docs-derived facts; anything not
12 * confirmed against the live API is annotated as such at its declaration.
13 * BytePlus
14 * deactivates model ids aggressively (the whole `seedance-1-0-lite-*` family,
15 * `seed-1-6-lite-*`, `seedream-3-0-*`, and the `doubao-`/`skylark-` names are
16 * all 404s internationally), so only dated, probe-confirmed ids are shipped.
17 *
18 * Prefix rules, also probe-confirmed:
19 * - `dola-seed-2-1-turbo-260628` and `dola-seedream-5-0-pro-260628` are the
20 * canonical ids; the bare forms resolve as aliases but the API echoes the
21 * prefixed id back.
22 * - The Seedance 2.0 family *requires* the `dreamina-` prefix.
23 * - Older models reject the `dola-` prefix outright.
24 */
25import type { Modality, ModelReasoning } from '@tanstack/ai'
26import type { ModelReasoningCapability } from '@tanstack/ai/adapter-internals'
27import type { DurationOptions } from '@tanstack/ai/adapters'
28import type { BytePlusTextProviderOptions } from './text/text-provider-options'
29​
30// Reasoning shapes: the levels a model has for `chat({ reasoning })`, and
31// the provider value to send for each. Each model points at one of them.
32const EFFORT_DISABLED_ENABLED = {
33 levels: { off: 'disabled', high: 'enabled' },
34 budget: false,
35} as const
36const EFFORT_DISABLED_HIGH_MAX = {
37 levels: { off: 'disabled', high: 'high', max: 'max' },
38 budget: false,
39} as const
40const EFFORT_LOW_TO_HIGH = {
41 levels: { low: 'low', medium: 'medium', high: 'high' },
42 budget: false,
43} as const
44const EFFORT_MINIMAL_TO_HIGH = {
45 levels: { minimal: 'minimal', low: 'low', medium: 'medium', high: 'high' },
46 budget: false,
47} as const
48const EFFORT_NONE_MINIMAL_TO_HIGH = {
49 levels: {
50 off: 'none',
51 minimal: 'minimal',
52 low: 'low',
53 medium: 'medium',
54 high: 'high',
55 },
56 budget: false,
57} as const
58​
59const DEEPSEEK_V4_1_FLASH_260910 = {
60 name: 'deepseek-v4-1-flash-260910',
61 context_window: 1_048_576,
62 max_output_tokens: 393_216,
63 supports: {
64 input: ['text'],
65 output: ['text'],
66 capabilities: ['reasoning', 'tool_calling'],
67 tools: [] as const,
68 },
69} as const satisfies ModelMeta
70​
71const DEEPSEEK_V4_FLASH_GA_260731 = {
72 name: 'deepseek-v4-flash-ga-260731',
73 context_window: 1_048_576,
74 max_output_tokens: 393_216,
75 supports: {
76 input: ['text'],
77 output: ['text'],
78 capabilities: ['reasoning', 'tool_calling'],
79 tools: [] as const,
80 },
81} as const satisfies ModelMeta
82​
83const DEEPSEEK_V4_PRO_GA_260813 = {
84 name: 'deepseek-v4-pro-ga-260813',
85 context_window: 1_048_576,
86 max_output_tokens: 393_216,
87 supports: {
88 input: ['text'],
89 output: ['text'],
90 capabilities: ['reasoning', 'tool_calling'],
91 tools: [] as const,
92 },
93} as const satisfies ModelMeta
94​
95const GLM_5_3_FLASH_260828 = {
96 name: 'glm-5-3-flash-260828',
97 context_window: 1_048_576,
98 max_output_tokens: 131_072,
99 supports: {
100 input: ['text'],
101 output: ['text'],
102 capabilities: ['reasoning', 'tool_calling'],
103 tools: [] as const,
104 },
105} as const satisfies ModelMeta
106​
107/**
108 * BytePlus exposes no server-side provider tools (no hosted web search, code
109 * interpreter, …) on the international Ark endpoint, so every chat model
110 * advertises an empty tool set. Typing it as `never` makes passing another
111 * provider's `ProviderTool` to a BytePlus adapter a compile-time error.
112 */
113export type BytePlusProviderToolKind = never
114​
115/**
116 * Internal metadata structure describing a BytePlus model.
117 */
118interface ModelMeta {
119 name: string
120 supports: {
121 input: ReadonlyArray<'text' | 'image' | 'audio' | 'video' | 'document'>
122 output: ReadonlyArray<'text' | 'image' | 'audio' | 'video'>
123 capabilities?: ReadonlyArray<
124 'reasoning' | 'tool_calling' | 'structured_outputs'
125 >
126 tools?: ReadonlyArray<BytePlusProviderToolKind>
127 }
128 context_window?: number
129 max_input_tokens?: number
130 max_output_tokens?: number
131 /** The model's data for `chat({ reasoning })`. None: it does not reason. */
132 reasoning?: ModelReasoning
134​
135// ============================================================================
136// Chat models (Seed / GLM / DeepSeek / gpt-oss on Ark)
137// ============================================================================
138​
139const DOLA_SEED_2_1_TURBO = {
140 name: 'dola-seed-2-1-turbo-260628',
141 context_window: 256_000,
142 max_input_tokens: 256_000,
143 max_output_tokens: 256_000,
144 supports: {
145 input: ['text', 'image', 'video'],
146 output: ['text'],
147 capabilities: ['reasoning', 'tool_calling', 'structured_outputs'],
148 tools: [] as const,
149 },
150 reasoning: EFFORT_MINIMAL_TO_HIGH,
151} as const satisfies ModelMeta
152​
153const SEED_2_0_LITE_260428 = {
154 name: 'seed-2-0-lite-260428',
155 context_window: 256_000,
156 max_input_tokens: 256_000,
157 max_output_tokens: 128_000,
158 supports: {
159 input: ['text', 'image', 'video', 'audio'],
160 output: ['text'],
161 // Live-probed 2026-07-31: rejects both json_schema and json_object.
162 capabilities: ['reasoning', 'tool_calling'],
163 tools: [] as const,
164 },
165 reasoning: EFFORT_MINIMAL_TO_HIGH,
166} as const satisfies ModelMeta
167​
168const SEED_2_0_MINI_260428 = {
169 name: 'seed-2-0-mini-260428',
170 context_window: 256_000,
171 max_input_tokens: 256_000,
172 max_output_tokens: 128_000,
173 supports: {
174 input: ['text', 'image', 'video', 'audio'],
175 output: ['text'],
176 // Live-probed 2026-07-31: rejects both json_schema and json_object.
177 capabilities: ['reasoning', 'tool_calling'],
178 tools: [] as const,
179 },
180 reasoning: EFFORT_MINIMAL_TO_HIGH,
181} as const satisfies ModelMeta
182​
183const SEED_2_0_PRO_260328 = {
184 name: 'seed-2-0-pro-260328',
185 context_window: 256_000,
186 max_input_tokens: 224_000,
187 max_output_tokens: 128_000,
188 supports: {
189 input: ['text', 'image', 'video'],
190 output: ['text'],
191 // Live-probed 2026-07-31: accepts json_schema, despite the docs table
192 // saying otherwise.
193 capabilities: ['reasoning', 'tool_calling', 'structured_outputs'],
194 tools: [] as const,
195 },
196 reasoning: EFFORT_MINIMAL_TO_HIGH,
197} as const satisfies ModelMeta
198​
199const SEED_2_0_LITE_260228 = {
200 name: 'seed-2-0-lite-260228',
201 context_window: 256_000,
202 max_input_tokens: 224_000,
203 max_output_tokens: 128_000,
204 supports: {
205 input: ['text', 'image', 'video'],
206 output: ['text'],
207 capabilities: ['reasoning', 'tool_calling', 'structured_outputs'],
208 tools: [] as const,
209 },
210 reasoning: EFFORT_MINIMAL_TO_HIGH,
211} as const satisfies ModelMeta
212​
213const SEED_2_0_MINI_260215 = {
214 name: 'seed-2-0-mini-260215',
215 context_window: 256_000,
216 max_input_tokens: 224_000,
217 max_output_tokens: 128_000,
218 supports: {
219 input: ['text', 'image', 'video'],
220 output: ['text'],
221 capabilities: ['reasoning', 'tool_calling', 'structured_outputs'],
222 tools: [] as const,
223 },
224 reasoning: EFFORT_MINIMAL_TO_HIGH,
225} as const satisfies ModelMeta
226​
227const SEED_2_0_CODE_PREVIEW_260328 = {
228 name: 'seed-2-0-code-preview-260328',
229 context_window: 256_000,
230 max_input_tokens: 224_000,
231 max_output_tokens: 128_000,
232 supports: {
233 input: ['text', 'image', 'video'],
234 output: ['text'],
235 capabilities: ['reasoning', 'tool_calling'],
236 tools: [] as const,
237 },
238 reasoning: EFFORT_MINIMAL_TO_HIGH,
239} as const satisfies ModelMeta
240​
241const SEED_1_8_251228 = {
242 name: 'seed-1-8-251228',
243 context_window: 256_000,
244 max_input_tokens: 224_000,
245 max_output_tokens: 64_000,
246 supports: {
247 input: ['text', 'image', 'video'],
248 output: ['text'],
249 capabilities: ['reasoning', 'tool_calling', 'structured_outputs'],
250 tools: [] as const,
251 },
252 reasoning: EFFORT_MINIMAL_TO_HIGH,
253} as const satisfies ModelMeta
254​
255const SEED_1_6_250915 = {
256 name: 'seed-1-6-250915',
257 context_window: 256_000,
258 max_input_tokens: 224_000,
259 max_output_tokens: 32_000,
260 supports: {
261 input: ['text', 'image', 'video'],
262 output: ['text'],
263 capabilities: ['reasoning', 'tool_calling', 'structured_outputs'],
264 tools: [] as const,
265 },
266 reasoning: EFFORT_MINIMAL_TO_HIGH,
267} as const satisfies ModelMeta
268​
269const SEED_1_6_250615 = {
270 name: 'seed-1-6-250615',
271 context_window: 256_000,
272 max_input_tokens: 224_000,
273 max_output_tokens: 32_000,
274 supports: {
275 input: ['text', 'image', 'video'],
276 output: ['text'],
277 capabilities: ['reasoning', 'tool_calling', 'structured_outputs'],
278 tools: [] as const,
279 },
280 reasoning: EFFORT_MINIMAL_TO_HIGH,
281} as const satisfies ModelMeta
282​
283const SEED_1_6_FLASH_250715 = {
284 name: 'seed-1-6-flash-250715',
285 context_window: 256_000,
286 max_input_tokens: 224_000,
287 max_output_tokens: 32_000,
288 supports: {
289 input: ['text', 'image', 'video'],
290 output: ['text'],
291 capabilities: ['reasoning', 'tool_calling', 'structured_outputs'],
292 tools: [] as const,
293 },
294 reasoning: EFFORT_MINIMAL_TO_HIGH,
295} as const satisfies ModelMeta
296​
297const SEED_1_6_FLASH_250615 = {
298 name: 'seed-1-6-flash-250615',
299 context_window: 256_000,
300 max_input_tokens: 224_000,
301 max_output_tokens: 32_000,
302 supports: {
303 input: ['text', 'image', 'video'],
304 output: ['text'],
305 capabilities: ['reasoning', 'tool_calling', 'structured_outputs'],
306 tools: [] as const,
307 },
308 reasoning: EFFORT_MINIMAL_TO_HIGH,
309} as const satisfies ModelMeta
310​
311const GLM_5_2_260617 = {
312 name: 'glm-5-2-260617',
313 context_window: 1_024_000,
314 max_input_tokens: 1_024_000,
315 max_output_tokens: 128_000,
316 supports: {
317 input: ['text'],
318 output: ['text'],
319 // Live-probed 2026-07-31: accepts json_schema, despite the docs table
320 // saying otherwise.
321 capabilities: ['reasoning', 'tool_calling', 'structured_outputs'],
322 tools: [] as const,
323 },
324 reasoning: EFFORT_NONE_MINIMAL_TO_HIGH,
325} as const satisfies ModelMeta
326​
327const GLM_4_7_251222 = {
328 name: 'glm-4-7-251222',
329 context_window: 256_000,
330 max_input_tokens: 224_000,
331 max_output_tokens: 128_000,
332 supports: {
333 input: ['text'],
334 output: ['text'],
335 // Adherence-probed 2026-07-31: ACCEPTS a json_schema with 200 but ignores
336 // it and answers in prose, so it is not a structured-output model. A
337 // status-code-only probe reads this as support — see the note on
338 // BYTEPLUS_STRUCTURED_OUTPUT_CHAT_MODELS.
339 capabilities: ['reasoning', 'tool_calling'],
340 tools: [] as const,
341 },
342 reasoning: EFFORT_DISABLED_ENABLED,
343} as const satisfies ModelMeta
344​
345const DEEPSEEK_V4_PRO_260425 = {
346 name: 'deepseek-v4-pro-260425',
347 context_window: 1_024_000,
348 max_input_tokens: 1_024_000,
349 max_output_tokens: 384_000,
350 supports: {
351 input: ['text'],
352 output: ['text'],
353 capabilities: ['reasoning', 'tool_calling'],
354 tools: [] as const,
355 },
356 reasoning: EFFORT_DISABLED_HIGH_MAX,
357} as const satisfies ModelMeta
358​
359const DEEPSEEK_V4_FLASH_260425 = {
360 name: 'deepseek-v4-flash-260425',
361 context_window: 1_024_000,
362 max_input_tokens: 1_024_000,
363 max_output_tokens: 384_000,
364 supports: {
365 input: ['text'],
366 output: ['text'],
367 capabilities: ['reasoning', 'tool_calling'],
368 tools: [] as const,
369 },
370 reasoning: EFFORT_DISABLED_HIGH_MAX,
371} as const satisfies ModelMeta
372​
373// The one model on Ark that defaults to `thinking: disabled`.
374const DEEPSEEK_V3_2_251201 = {
375 name: 'deepseek-v3-2-251201',
376 context_window: 128_000,
377 max_input_tokens: 128_000,
378 max_output_tokens: 32_000,
379 supports: {
380 input: ['text'],
381 output: ['text'],
382 // Live-probed 2026-07-31: rejects both json_schema and json_object.
383 capabilities: ['reasoning', 'tool_calling'],
384 tools: [] as const,
385 },
386 reasoning: EFFORT_DISABLED_ENABLED,
387} as const satisfies ModelMeta
388​
389// The only model accepting `thinking: {type: 'auto'}`. Tool calling is
390// undocumented on Ark and unverified, so it is not advertised.
391const GPT_OSS_120B_250805 = {
392 name: 'gpt-oss-120b-250805',
393 context_window: 128_000,
394 max_input_tokens: 96_000,
395 max_output_tokens: 64_000,
396 supports: {
397 input: ['text'],
398 output: ['text'],
399 capabilities: ['reasoning'],
400 tools: [] as const,
401 },
402 reasoning: EFFORT_LOW_TO_HIGH,
403} as const satisfies ModelMeta
404​
405/**
406 * All supported BytePlus chat model identifiers.
407 */
408export const BYTEPLUS_CHAT_MODELS = [
409 DEEPSEEK_V4_1_FLASH_260910.name,
410 DEEPSEEK_V4_FLASH_GA_260731.name,
411 DEEPSEEK_V4_PRO_GA_260813.name,
412 GLM_5_3_FLASH_260828.name,
413 DOLA_SEED_2_1_TURBO.name,
414 SEED_2_0_LITE_260428.name,
415 SEED_2_0_MINI_260428.name,
416 SEED_2_0_PRO_260328.name,
417 SEED_2_0_LITE_260228.name,
418 SEED_2_0_MINI_260215.name,
419 SEED_2_0_CODE_PREVIEW_260328.name,
420 SEED_1_8_251228.name,
421 SEED_1_6_250915.name,
422 SEED_1_6_250615.name,
423 SEED_1_6_FLASH_250715.name,
424 SEED_1_6_FLASH_250615.name,
425 GLM_5_2_260617.name,
426 GLM_4_7_251222.name,
427 DEEPSEEK_V4_PRO_260425.name,
428 DEEPSEEK_V4_FLASH_260425.name,
429 DEEPSEEK_V3_2_251201.name,
430 GPT_OSS_120B_250805.name,
431] as const
432​
433/**
434 * Union of all supported BytePlus chat model names.
435 */
436export type BytePlusChatModel = (typeof BYTEPLUS_CHAT_MODELS)[number]
437​
438/**
439 * Chat models that emit a `encrypted_content` blob alongside
440 * `reasoning_content` when thinking is enabled ("thinking summary" models).
441 *
442 * The blob is an opaque signature over the reasoning trace: when it is
443 * present it must be echoed back verbatim on the assistant message in the
444 * next turn. Live probing showed omitting it did *not* fail a simple tool
445 * round-trip, so adapters preserve and replay it when present but must never
446 * treat its absence as an error.
447 */
448export const BYTEPLUS_THINKING_SUMMARY_MODELS = [
449 DOLA_SEED_2_1_TURBO.name,
450 SEED_2_0_LITE_260428.name,
451 SEED_2_0_MINI_260428.name,
452 SEED_2_0_PRO_260328.name,
453] as const
454​
455/**
456 * Union of chat models that emit `encrypted_content`.
457 */
458export type BytePlusThinkingSummaryModel =
459 (typeof BYTEPLUS_THINKING_SUMMARY_MODELS)[number]
460​
461const THINKING_SUMMARY_MODEL_SET: ReadonlySet<string> = new Set(
462 BYTEPLUS_THINKING_SUMMARY_MODELS,
464​
465/**
466 * True when the model emits `encrypted_content` that should be round-tripped
467 * on subsequent turns.
468 */
469export function emitsEncryptedContent(model: string): boolean {
470 return THINKING_SUMMARY_MODEL_SET.has(model)
472​
473/**
474 * Chat models that accept `response_format: {type: 'json_schema'}`.
475 *
476 * Live-probed against all 18 chat models on 2026-07-31, not docs-derived — the
477 * BytePlus capability tables are wrong here in both directions.
478 *
479 * Membership needs TWO things, because the API has both failure modes:
480 * 1. The request is accepted. Seven models (`seed-2-0-lite-260428`,
481 * `seed-2-0-mini-260428`, `seed-2-0-code-preview-260328`, both
482 * `deepseek-v4-*`, `deepseek-v3-2-251201`, `gpt-oss-120b-250805`) answer a
483 * JSON schema with 400 InvalidParameter — and reject
484 * `{type: 'json_object'}` too, so there is no JSON-mode fallback.
485 * 2. The schema is actually honoured. `glm-4-7-251222` accepts the request
486 * with 200 and then ignores the schema, answering in prose (reproduced
487 * twice by the adherence probe). A status-code-only probe wrongly reads
488 * that as support, so it is excluded.
489 *
490 * Models that fail either check need tool-shaped extraction instead.
491 *
492 * Note that the default chat model `seed-2-0-lite-260428` is one of the
493 * rejecting models: structured-output work needs `seed-2-0-lite-260228` or
494 * `dola-seed-2-1-turbo-260628`.
495 */
496export const BYTEPLUS_STRUCTURED_OUTPUT_CHAT_MODELS = [
497 DOLA_SEED_2_1_TURBO.name,
498 SEED_2_0_PRO_260328.name,
499 SEED_2_0_LITE_260228.name,
500 SEED_2_0_MINI_260215.name,
501 SEED_1_8_251228.name,
502 SEED_1_6_250915.name,
503 SEED_1_6_250615.name,
504 SEED_1_6_FLASH_250715.name,
505 SEED_1_6_FLASH_250615.name,
506 GLM_5_2_260617.name,
507] as const
508​
509const STRUCTURED_OUTPUT_MODEL_SET: ReadonlySet<string> = new Set(
510 BYTEPLUS_STRUCTURED_OUTPUT_CHAT_MODELS,
512​
513/**
514 * True when the model supports native JSON-schema structured output.
515 */
516export function supportsStructuredOutput(model: string): boolean {
517 return STRUCTURED_OUTPUT_MODEL_SET.has(model)
519​
520/**
521 * Type-only map from chat model name to whether it supports native
522 * JSON-schema structured output.
523 */
524export type BytePlusChatModelStructuredOutputByName = {
525 [K in BytePlusChatModel]: K extends BytePlusStructuredOutputChatModel
526 ? true
527 : false
529​
530/**
531 * Union of chat models supporting native JSON-schema structured output.
532 */
533export type BytePlusStructuredOutputChatModel =
534 (typeof BYTEPLUS_STRUCTURED_OUTPUT_CHAT_MODELS)[number]
535​
536/**
537 * Type-only map from chat model name to its supported input modalities.
538 * Used for type inference when constructing multimodal messages.
539 */
540export type BytePlusModelInputModalitiesByName = {
541 [DOLA_SEED_2_1_TURBO.name]: typeof DOLA_SEED_2_1_TURBO.supports.input
542 [SEED_2_0_LITE_260428.name]: typeof SEED_2_0_LITE_260428.supports.input
543 [SEED_2_0_MINI_260428.name]: typeof SEED_2_0_MINI_260428.supports.input
544 [SEED_2_0_PRO_260328.name]: typeof SEED_2_0_PRO_260328.supports.input
545 [SEED_2_0_LITE_260228.name]: typeof SEED_2_0_LITE_260228.supports.input
546 [SEED_2_0_MINI_260215.name]: typeof SEED_2_0_MINI_260215.supports.input
547 [SEED_2_0_CODE_PREVIEW_260328.name]: typeof SEED_2_0_CODE_PREVIEW_260328.supports.input
548 [SEED_1_8_251228.name]: typeof SEED_1_8_251228.supports.input
549 [SEED_1_6_250915.name]: typeof SEED_1_6_250915.supports.input
550 [SEED_1_6_250615.name]: typeof SEED_1_6_250615.supports.input
551 [SEED_1_6_FLASH_250715.name]: typeof SEED_1_6_FLASH_250715.supports.input
552 [SEED_1_6_FLASH_250615.name]: typeof SEED_1_6_FLASH_250615.supports.input
553 [GLM_5_2_260617.name]: typeof GLM_5_2_260617.supports.input
554 [GLM_4_7_251222.name]: typeof GLM_4_7_251222.supports.input
555 [DEEPSEEK_V4_PRO_260425.name]: typeof DEEPSEEK_V4_PRO_260425.supports.input
556 [DEEPSEEK_V4_FLASH_260425.name]: typeof DEEPSEEK_V4_FLASH_260425.supports.input
557 [DEEPSEEK_V3_2_251201.name]: typeof DEEPSEEK_V3_2_251201.supports.input
558 [GPT_OSS_120B_250805.name]: typeof GPT_OSS_120B_250805.supports.input
559 [DEEPSEEK_V4_1_FLASH_260910.name]: typeof DEEPSEEK_V4_1_FLASH_260910.supports.input
560 [DEEPSEEK_V4_FLASH_GA_260731.name]: typeof DEEPSEEK_V4_FLASH_GA_260731.supports.input
561 [DEEPSEEK_V4_PRO_GA_260813.name]: typeof DEEPSEEK_V4_PRO_GA_260813.supports.input
562 [GLM_5_3_FLASH_260828.name]: typeof GLM_5_3_FLASH_260828.supports.input
564​
565/**
566 * Runtime map from chat model name to its supported input modalities, for the
567 * text adapter's `inputModalities`. `satisfies` keeps it equal to
568 * {@link BytePlusModelInputModalitiesByName}. An unknown name gives `undefined`.
569 */
570export const BYTEPLUS_MODEL_INPUT_MODALITIES: Readonly<
571 Record<string, ReadonlyArray<Modality>>
572> = {
573 [DOLA_SEED_2_1_TURBO.name]: DOLA_SEED_2_1_TURBO.supports.input,
574 [SEED_2_0_LITE_260428.name]: SEED_2_0_LITE_260428.supports.input,
575 [SEED_2_0_MINI_260428.name]: SEED_2_0_MINI_260428.supports.input,
576 [SEED_2_0_PRO_260328.name]: SEED_2_0_PRO_260328.supports.input,
577 [SEED_2_0_LITE_260228.name]: SEED_2_0_LITE_260228.supports.input,
578 [SEED_2_0_MINI_260215.name]: SEED_2_0_MINI_260215.supports.input,
579 [SEED_2_0_CODE_PREVIEW_260328.name]:
580 SEED_2_0_CODE_PREVIEW_260328.supports.input,
581 [SEED_1_8_251228.name]: SEED_1_8_251228.supports.input,
582 [SEED_1_6_250915.name]: SEED_1_6_250915.supports.input,
583 [SEED_1_6_250615.name]: SEED_1_6_250615.supports.input,
584 [SEED_1_6_FLASH_250715.name]: SEED_1_6_FLASH_250715.supports.input,
585 [SEED_1_6_FLASH_250615.name]: SEED_1_6_FLASH_250615.supports.input,
586 [GLM_5_2_260617.name]: GLM_5_2_260617.supports.input,
587 [GLM_4_7_251222.name]: GLM_4_7_251222.supports.input,
588 [DEEPSEEK_V4_PRO_260425.name]: DEEPSEEK_V4_PRO_260425.supports.input,
589 [DEEPSEEK_V4_FLASH_260425.name]: DEEPSEEK_V4_FLASH_260425.supports.input,
590 [DEEPSEEK_V3_2_251201.name]: DEEPSEEK_V3_2_251201.supports.input,
591 [GPT_OSS_120B_250805.name]: GPT_OSS_120B_250805.supports.input,
592 [DEEPSEEK_V4_1_FLASH_260910.name]: DEEPSEEK_V4_1_FLASH_260910.supports.input,
593 [DEEPSEEK_V4_FLASH_GA_260731.name]:
594 DEEPSEEK_V4_FLASH_GA_260731.supports.input,
595 [DEEPSEEK_V4_PRO_GA_260813.name]: DEEPSEEK_V4_PRO_GA_260813.supports.input,
596 [GLM_5_3_FLASH_260828.name]: GLM_5_3_FLASH_260828.supports.input,
597} satisfies BytePlusModelInputModalitiesByName
598​
599/**
600 * Type-only map from chat model name to its supported provider tools.
601 * BytePlus exposes no provider-tool factories, so every model gets an empty
602 * tuple — passing another provider's tool is then a compile-time error.
603 */
604export type BytePlusChatModelToolCapabilitiesByName = {
605 [K in BytePlusChatModel]: ReadonlyArray<BytePlusProviderToolKind>
607​
608/**
609 * Type-only map from chat model name to its provider options type.
610 */
611export type BytePlusChatModelProviderOptionsByName = {
612 [K in BytePlusChatModel]: BytePlusTextProviderOptions
614​
615// ============================================================================
616// Video models (Seedance, async task API)
617// ============================================================================
618​
619/**
620 * Output aspect ratios accepted by the Seedance task API. `adaptive` is only
621 * meaningful for image-to-video, where the ratio follows the input frame.
622 */
623export type BytePlusVideoRatio =
624 | '16:9'
625 | '9:16'
626 | '4:3'
627 | '3:4'
628 | '1:1'
629 | '21:9'
630 | 'adaptive'
631​
632/**
633 * Resolution tiers accepted by the Seedance task API.
634 *
635 * Resolution tiers are model-specific (see
636 * {@link BytePlusVideoModelResolutionByName}). Two findings that still
637 * contradict older BytePlus prose: there is **no 2K tier on any Seedance
638 * model**, and `4k` exists only on `dreamina-seedance-2-0-260128`. Seedance
639 * 2.5 accepts 480p/720p/1080p (ModelArk + fal spec, 2026-08-19).
640 *
641 * The API matches this field case-insensitively (`4K`, `4k` and `1080P` are
642 * all accepted), so this package standardizes on the lowercase spelling.
643 */
644export type BytePlusVideoResolution = '480p' | '720p' | '1080p' | '4k'
645​
646/**
647 * Generic `size` template for Seedance models: either a bare aspect ratio
648 * ("16:9") or `ratio_resolution` ("16:9_720p"). The Seedance API takes the
649 * two as separate `ratio` / `resolution` fields; the adapter splits this
650 * template back apart.
651 */
652export type BytePlusVideoSize<
653 TResolution extends BytePlusVideoResolution = BytePlusVideoResolution,
654> = BytePlusVideoRatio | `${BytePlusVideoRatio}_${TResolution}`
655​
656// Multimodal reference-media capabilities (reference images / video / audio)
657// are docs-derived from the ModelArk create-task page. Model ids and the
658// resolution / duration tables for 2.0 were also live-probed on 2026-07-31;
659// 2.5 lands from the public docs once the model was fully opened (2026-08-07).
660const DREAMINA_SEEDANCE_2_5 = {
661 name: 'dreamina-seedance-2-5-260628',
662 supports: {
663 input: ['text', 'image', 'video', 'audio'],
664 output: ['video', 'audio'],
665 },
666} as const satisfies ModelMeta
667​
668const DREAMINA_SEEDANCE_2_0 = {
669 name: 'dreamina-seedance-2-0-260128',
670 supports: {
671 input: ['text', 'image', 'video', 'audio'],
672 output: ['video', 'audio'],
673 },
674} as const satisfies ModelMeta
675​
676const DREAMINA_SEEDANCE_2_0_FAST = {
677 name: 'dreamina-seedance-2-0-fast-260128',
678 supports: {
679 input: ['text', 'image', 'video', 'audio'],
680 output: ['video', 'audio'],
681 },
682} as const satisfies ModelMeta
683​
684const DREAMINA_SEEDANCE_2_0_MINI = {
685 name: 'dreamina-seedance-2-0-mini-260615',
686 supports: {
687 input: ['text', 'image', 'video', 'audio'],
688 output: ['video', 'audio'],
689 },
690} as const satisfies ModelMeta
691​
692const SEEDANCE_1_5_PRO = {
693 name: 'seedance-1-5-pro-251215',
694 supports: {
695 input: ['text', 'image'],
696 output: ['video', 'audio'],
697 },
698} as const satisfies ModelMeta
699​
700const SEEDANCE_1_0_PRO = {
701 name: 'seedance-1-0-pro-250528',
702 supports: {
703 input: ['text', 'image'],
704 output: ['video'],
705 },
706} as const satisfies ModelMeta
707​
708const SEEDANCE_1_0_PRO_FAST = {
709 name: 'seedance-1-0-pro-fast-251015',
710 supports: {
711 input: ['text', 'image'],
712 output: ['video'],
713 },
714} as const satisfies ModelMeta
715​
716/**
717 * All supported Seedance video model identifiers.
718 */
719export const BYTEPLUS_VIDEO_MODELS = [
720 DREAMINA_SEEDANCE_2_5.name,
721 DREAMINA_SEEDANCE_2_0.name,
722 DREAMINA_SEEDANCE_2_0_FAST.name,
723 DREAMINA_SEEDANCE_2_0_MINI.name,
724 SEEDANCE_1_5_PRO.name,
725 SEEDANCE_1_0_PRO.name,
726 SEEDANCE_1_0_PRO_FAST.name,
727] as const
728​
729/**
730 * Union of all supported Seedance video model names.
731 */
732export type BytePlusVideoModel = (typeof BYTEPLUS_VIDEO_MODELS)[number]
733​
734/**
735 * Type-only map from video model name to the non-text prompt modalities it
736 * accepts. Seedance 2.5 and the 2.0 family take multimodal references
737 * (start/end frames, reference images, reference video and audio); the 1.x
738 * models take start/end frames only.
739 */
740export type BytePlusVideoModelInputModalitiesByName = {
741 [DREAMINA_SEEDANCE_2_5.name]: readonly ['image', 'video', 'audio']
742 [DREAMINA_SEEDANCE_2_0.name]: readonly ['image', 'video', 'audio']
743 [DREAMINA_SEEDANCE_2_0_FAST.name]: readonly ['image', 'video', 'audio']
744 [DREAMINA_SEEDANCE_2_0_MINI.name]: readonly ['image', 'video', 'audio']
745 [SEEDANCE_1_5_PRO.name]: readonly ['image']
746 [SEEDANCE_1_0_PRO.name]: readonly ['image']
747 [SEEDANCE_1_0_PRO_FAST.name]: readonly ['image']
749​
750/**
751 * Type-only map from video model name to the resolutions it accepts.
752 *
753 * 2.0 / 1.x cells were probe-verified on 2026-07-31; 2.5 comes from the
754 * public ModelArk create-task docs, refreshed 2026-08-19 when native 1080p
755 * shipped. Note `seedance-1-0-pro-fast-251015` does accept `1080p`, despite
756 * older BytePlus prose listing it as 480p/720p.
757 */
758export type BytePlusVideoModelResolutionByName = {
759 [DREAMINA_SEEDANCE_2_5.name]: '480p' | '720p' | '1080p'
760 [DREAMINA_SEEDANCE_2_0.name]: '480p' | '720p' | '1080p' | '4k'
761 [DREAMINA_SEEDANCE_2_0_FAST.name]: '480p' | '720p'
762 [DREAMINA_SEEDANCE_2_0_MINI.name]: '480p' | '720p'
763 [SEEDANCE_1_5_PRO.name]: '480p' | '720p' | '1080p'
764 [SEEDANCE_1_0_PRO.name]: '480p' | '720p' | '1080p'
765 [SEEDANCE_1_0_PRO_FAST.name]: '480p' | '720p' | '1080p'
767​
768/**
769 * Type-only map from video model name to its accepted `size` strings.
770 */
771export type BytePlusVideoModelSizeByName = {
772 [K in BytePlusVideoModel]: BytePlusVideoSize<
773 BytePlusVideoModelResolutionByName[K]
774 >
776​
777/**
778 * A Seedance model id: one this package knows, or any other string.
779 *
780 * The open half is a deliberate escape hatch for models BytePlus ships between
781 * releases of this package. Adding a model to {@link BYTEPLUS_VIDEO_MODELS}
782 * *narrows* it — the adapter's guards switch on and reject against this
783 * file's tables. For a model whose real limits are unknown that is strictly
784 * worse than the open path, which lets Ark judge. So an id lands in the
785 * known table only once its capability cells are documented or probed.
786 *
787 * Discovering ids: `GET /models` on the Ark data plane enumerates the catalog
788 * (id, `task_type`, `modalities`, `status`). It is not exhaustive —
789 * `seedream-5-0-lite-260128` answers requests but is missing from the
790 * listing — so absence there is not evidence of absence. The ModelArk
791 * release notes (https://docs.byteplus.com/en/docs/ModelArk/1159178) are the
792 * other watch surface.
793 *
794 * To probe an id, POST `/contents/generations/tasks` with only
795 * `{"model": "<id>"}`. Three outcomes, all live-verified:
796 * - 400 `MissingParameter` (about `content`) — live and usable.
797 * - 404 `ModelNotOpen` — real, but not activated on this account.
798 * - 404 `InvalidEndpointOrModel.NotFound` — no such model.
799 *
800 * Unknown ids trade compile-time narrowing for reach: the full size surface is
801 * accepted, provider options are ungated, and the adapter's model-specific
802 * runtime guards stand down so a new model's legitimate request reaches Ark.
803 * Known ids keep their documented / probe-verified narrowing.
804 */
805export type BytePlusVideoModelOrString = BytePlusVideoModel | (string & {})
806​
807/**
808 * Resolve the `size` type for a video model: the model's probe-verified
809 * template union when known, otherwise the full template surface plus any
810 * string (a future model may bring ratios or resolution tiers that do not
811 * exist today).
812 */
813export type ResolveBytePlusVideoSize<TModel extends string> =
814 TModel extends BytePlusVideoModel
815 ? BytePlusVideoModelSizeByName[TModel]
816 : BytePlusVideoSize | (string & {})
817​
818/**
819 * Resolve the accepted non-text prompt modalities for a video model. Unknown
820 * models accept all three rather than none, so a new model's reference media
821 * is not a compile error.
822 */
823export type ResolveBytePlusVideoInputModalities<TModel extends string> =
824 TModel extends BytePlusVideoModel
825 ? BytePlusVideoModelInputModalitiesByName[TModel]
826 : readonly ['image', 'video', 'audio']
827​
828const VIDEO_MODEL_SET: ReadonlySet<string> = new Set(BYTEPLUS_VIDEO_MODELS)
829​
830/**
831 * True when the id is one this package has probe-verified metadata for.
832 *
833 * The adapter uses this to decide whether its model-specific guards apply:
834 * see {@link BytePlusVideoModelOrString}.
835 */
836export function isKnownBytePlusVideoModel(
837 model: string,
838): model is BytePlusVideoModel {
839 return VIDEO_MODEL_SET.has(model)
841​
842/**
843 * Per-model duration type. Seedance accepts any integer second inside the
844 * model's range, so this is a continuous range expressed as `number` — a
845 * literal union cannot represent it. (The API also accepts `duration: -1` on
846 * Seedance 2.5, 2.0 and 1.5-pro to let the model choose; that is reachable
847 * through provider options, not through the generic `duration`.)
848 */
849export type BytePlusVideoModelDurationByName = {
850 [K in BytePlusVideoModel]: number
852​
853/**
854 * Runtime duration table backing `availableDurations()` / `snapDuration()`.
855 */
856export const BYTEPLUS_VIDEO_DURATIONS: {
857 readonly [TModel in BytePlusVideoModel]: DurationOptions<
858 BytePlusVideoModelDurationByName[TModel]
859 >
860} = {
861 'dreamina-seedance-2-5-260628': {
862 kind: 'range',
863 min: 4,
864 max: 30,
865 step: 1,
866 unit: 'seconds',
867 },
868 'dreamina-seedance-2-0-260128': {
869 kind: 'range',
870 min: 4,
871 max: 15,
872 step: 1,
873 unit: 'seconds',
874 },
875 'dreamina-seedance-2-0-fast-260128': {
876 kind: 'range',
877 min: 4,
878 max: 15,
879 step: 1,
880 unit: 'seconds',
881 },
882 'dreamina-seedance-2-0-mini-260615': {
883 kind: 'range',
884 min: 4,
885 max: 15,
886 step: 1,
887 unit: 'seconds',
888 },
889 'seedance-1-5-pro-251215': {
890 kind: 'range',
891 min: 4,
892 max: 12,
893 step: 1,
894 unit: 'seconds',
895 },
896 'seedance-1-0-pro-250528': {
897 kind: 'range',
898 min: 2,
899 max: 12,
900 step: 1,
901 unit: 'seconds',
902 },
903 'seedance-1-0-pro-fast-251015': {
904 kind: 'range',
905 min: 2,
906 max: 12,
907 step: 1,
908 unit: 'seconds',
909 },
911​
912/**
913 * Duration hint for a model this package has no table for.
914 *
915 * Spans every range Seedance has shipped so far (2s on the 1.0 models through
916 * 30s on Seedance 2.5) so `availableDurations()` can still drive a UI. It is
917 * a hint, not a contract: the adapter does **not** snap an unknown model's
918 * duration against it, because clamping a future model's legitimate longer
919 * request down to 30 would corrupt the request rather than protect it.
920 */
921export const BYTEPLUS_VIDEO_FALLBACK_DURATIONS: DurationOptions<number> = {
922 kind: 'range',
923 min: 2,
924 max: 30,
925 step: 1,
926 unit: 'seconds',
928​
929/**
930 * Look up the duration options for a Seedance video model, falling back to
931 * {@link BYTEPLUS_VIDEO_FALLBACK_DURATIONS} for an id this package does not
932 * know.
933 */
934export function getBytePlusVideoDurationOptions(
935 model: BytePlusVideoModelOrString,
936): DurationOptions<number> {
937 return isKnownBytePlusVideoModel(model)
938 ? BYTEPLUS_VIDEO_DURATIONS[model]
939 : BYTEPLUS_VIDEO_FALLBACK_DURATIONS
941​
942// ============================================================================
943// Image models (Seedream)
944// ============================================================================
945​
946/**
947 * Shorthand size tokens accepted by `/images/generations`. A request uses
948 * either a token or an explicit `WxH` string — never both.
949 */
950export type BytePlusImageSizeToken = '1K' | '2K' | '4K'
951​
952/**
953 * Accepted `size` values for Seedream models: a shorthand token or an
954 * explicit pixel size such as `2048x2048`.
955 */
956export type BytePlusImageSize = BytePlusImageSizeToken | `${number}x${number}`
957​
958const DOLA_SEEDREAM_5_0_PRO = {
959 name: 'dola-seedream-5-0-pro-260628',
960 supports: {
961 input: ['text', 'image'],
962 output: ['image'],
963 },
964} as const satisfies ModelMeta
965​
966const SEEDREAM_5_0 = {
967 name: 'seedream-5-0-260128',
968 supports: {
969 input: ['text', 'image'],
970 output: ['image'],
971 },
972} as const satisfies ModelMeta
973​
974const SEEDREAM_5_0_LITE = {
975 name: 'seedream-5-0-lite-260128',
976 supports: {
977 input: ['text', 'image'],
978 output: ['image'],
979 },
980} as const satisfies ModelMeta
981​
982const SEEDREAM_4_5 = {
983 name: 'seedream-4-5-251128',
984 supports: {
985 input: ['text', 'image'],
986 output: ['image'],
987 },
988} as const satisfies ModelMeta
989​
990const SEEDREAM_4_0 = {
991 name: 'seedream-4-0-250828',
992 supports: {
993 input: ['text', 'image'],
994 output: ['image'],
995 },
996} as const satisfies ModelMeta
997​
998/**
999 * All supported Seedream image model identifiers.
1000 */
1001export const BYTEPLUS_IMAGE_MODELS = [
1002 DOLA_SEEDREAM_5_0_PRO.name,
1003 SEEDREAM_5_0.name,
1004 SEEDREAM_5_0_LITE.name,
1005 SEEDREAM_4_5.name,
1006 SEEDREAM_4_0.name,
1007] as const
1008​
1009/**
1010 * Union of all supported Seedream image model names.
1011 */
1012export type BytePlusImageModel = (typeof BYTEPLUS_IMAGE_MODELS)[number]
1013​
1014/**
1015 * Type-only map from image model name to its accepted `size` strings.
1016 */
1017export type BytePlusImageModelSizeByName = {
1018 [K in BytePlusImageModel]: BytePlusImageSize
1020​
1021/**
1022 * Maximum number of reference images accepted per editing request.
1023 * Seedream 5.0 Pro caps at 10 references; the other editing-capable models
1024 * accept up to 14.
1026 * Docs-derived, not live-probed. The 14 for `seedream-5-0-260128` is weaker
1027 * still — the docs never state a cap for that model, so it is inferred from
1028 * the rest of the family.
1029 */
1030export const BYTEPLUS_IMAGE_MAX_REFERENCE_IMAGES: {
1031 readonly [K in BytePlusImageModel]: number
1032} = {
1033 'dola-seedream-5-0-pro-260628': 10,
1034 'seedream-5-0-260128': 14,
1035 'seedream-5-0-lite-260128': 14,
1036 'seedream-4-5-251128': 14,
1037 'seedream-4-0-250828': 14,
1039​
1040// ============================================================================
1041// Seed Speech models (voice host — separate product and API key)
1042// ============================================================================
1043​
1044const SEED_AUDIO_1_0 = {
1045 name: 'seed-audio-1.0',
1046 supports: {
1047 input: ['text', 'audio'],
1048 output: ['audio'],
1049 },
1050} as const satisfies ModelMeta
1051​
1052// Seed Speech ASR is endpoint-addressed: `POST /api/v3/auc/bigmodel/recognize/
1053// flash` selects the model through the `X-Api-Resource-Id` header
1054// (`volc.seedasr.auc_turbo`) and takes no `model` field in the body. This
1055// synthetic identifier satisfies the SDK's `TranscriptionOptions.model`
1056// contract and gives logging and fixture matching a stable value.
1057const SEED_ASR = {
1058 name: 'seed-asr',
1059 supports: {
1060 input: ['audio'],
1061 output: ['text'],
1062 },
1063} as const satisfies ModelMeta
1064​
1065/**
1066 * All supported Seed Speech TTS model identifiers.
1068 * Note: TTS runs on `voice.ap-southeast-1.bytepluses.com` with an
1069 * `X-Api-Key` header and a *different* API key from Ark.
1070 */
1071export const BYTEPLUS_TTS_MODELS = [SEED_AUDIO_1_0.name] as const
1072​
1073/**
1074 * All supported Seed Speech transcription model identifiers.
1075 */
1076export const BYTEPLUS_TRANSCRIPTION_MODELS = [SEED_ASR.name] as const
1077​
1078/**
1079 * Union of all supported Seed Speech TTS model names.
1080 */
1081export type BytePlusTTSModel = (typeof BYTEPLUS_TTS_MODELS)[number]
1082​
1083/**
1084 * Union of all supported Seed Speech transcription model names.
1085 */
1086export type BytePlusTranscriptionModel =
1087 (typeof BYTEPLUS_TRANSCRIPTION_MODELS)[number]
1088​
1089// ============================================================================
1090// Type resolution helpers
1091// ============================================================================
1092​
1093/**
1094 * Resolve provider options for a specific model. Models listed in the chat
1095 * map get their explicit options; anything else falls back to the base chat
1096 * options.
1097 */
1098export type ResolveProviderOptions<TModel extends string> =
1099 TModel extends keyof BytePlusChatModelProviderOptionsByName
1100 ? BytePlusChatModelProviderOptionsByName[TModel]
1101 : BytePlusTextProviderOptions
1102​
1103/**
1104 * Resolve input modalities for a specific model. Models missing from the map
1105 * are treated as text-only.
1106 */
1107export type ResolveInputModalities<TModel extends string> =
1108 TModel extends keyof BytePlusModelInputModalitiesByName
1109 ? BytePlusModelInputModalitiesByName[TModel]
1110 : readonly ['text']
1111​
1112// Reasoning
1114// Each model's `reasoning` field holds its data for `chat({ reasoning })`: the
1115// levels it has, with the provider value for each, and whether it takes a
1116// thinking token budget. The data comes from models.dev. The generator that
1117// writes it comes with the model catalog later. Until then, the sync scripts
1118// keep these fields as they are.
1119​
1120const BYTEPLUS_REASONING = {
1121 [DOLA_SEED_2_1_TURBO.name]: DOLA_SEED_2_1_TURBO.reasoning,
1122 [SEED_2_0_LITE_260428.name]: SEED_2_0_LITE_260428.reasoning,
1123 [SEED_2_0_MINI_260428.name]: SEED_2_0_MINI_260428.reasoning,
1124 [SEED_2_0_PRO_260328.name]: SEED_2_0_PRO_260328.reasoning,
1125 [SEED_2_0_LITE_260228.name]: SEED_2_0_LITE_260228.reasoning,
1126 [SEED_2_0_MINI_260215.name]: SEED_2_0_MINI_260215.reasoning,
1127 [SEED_2_0_CODE_PREVIEW_260328.name]: SEED_2_0_CODE_PREVIEW_260328.reasoning,
1128 [SEED_1_8_251228.name]: SEED_1_8_251228.reasoning,
1129 [SEED_1_6_250915.name]: SEED_1_6_250915.reasoning,
1130 [SEED_1_6_250615.name]: SEED_1_6_250615.reasoning,
1131 [SEED_1_6_FLASH_250715.name]: SEED_1_6_FLASH_250715.reasoning,
1132 [SEED_1_6_FLASH_250615.name]: SEED_1_6_FLASH_250615.reasoning,
1133 [GLM_5_2_260617.name]: GLM_5_2_260617.reasoning,
1134 [GLM_4_7_251222.name]: GLM_4_7_251222.reasoning,
1135 [DEEPSEEK_V4_PRO_260425.name]: DEEPSEEK_V4_PRO_260425.reasoning,
1136 [DEEPSEEK_V4_FLASH_260425.name]: DEEPSEEK_V4_FLASH_260425.reasoning,
1137 [DEEPSEEK_V3_2_251201.name]: DEEPSEEK_V3_2_251201.reasoning,
1138 [GPT_OSS_120B_250805.name]: GPT_OSS_120B_250805.reasoning,
1140​
1141/**
1142 * Each chat model's reasoning levels, and whether it takes a token budget,
1143 * for `chat({ reasoning })`. Derived from the `reasoning` field. A model
1144 * that is not here does not reason.
1145 */
1146export type BytePlusModelReasoningByName = {
1147 [K in keyof typeof BYTEPLUS_REASONING]: ModelReasoningCapability<
1148 (typeof BYTEPLUS_REASONING)[K]
1151​
1152/**
1153 * Runtime map from chat model name to its reasoning data, for the text adapter.
1154 * An unknown name gives `undefined`: the adapter sends no reasoning field.
1155 */
1156export const BYTEPLUS_MODEL_REASONING: Readonly<
1157 Record<string, ModelReasoning>
1158> = BYTEPLUS_REASONING