-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
hi team, i noticed this problem when i tried to access ByteDance Seedream 4.0 model (from together ai)
it should be available looking at together ai, and the costmap
the error
tracing parts of the code, it looks like the js lib failed to determine if this should use the together ai service, because there isn't the bytedance prefix (adding it should fix it?)
image prefix
puter/src/puter-js/src/modules/AI.js
Lines 13 to 23 in 545b5a0
| const TOGETHER_IMAGE_MODEL_PREFIXES = [ | |
| 'black-forest-labs/', | |
| 'stabilityai/', | |
| 'togethercomputer/', | |
| 'playgroundai/', | |
| 'runwayml/', | |
| 'lightricks/', | |
| 'sg161222/', | |
| 'wavymulder/', | |
| 'prompthero/', | |
| ]; |
video prefix
puter/src/puter-js/src/modules/AI.js
Lines 33 to 41 in 545b5a0
| const TOGETHER_VIDEO_MODEL_PREFIXES = [ | |
| 'minimax/', | |
| 'google/', | |
| 'bytedance/', | |
| 'pixverse/', | |
| 'kwaivgi/', | |
| 'vidu/', | |
| 'wan-ai/', | |
| ]; |
this is where it determines which AI service it chooses, by default because it doesn't found any, it just uses the one it initialized with, which is the openai, which explains why error message shows gpt image, dalle, etc
puter/src/puter-js/src/modules/AI.js
Lines 892 to 918 in 545b5a0
| let AIService = "openai-image-generation" | |
| if (options.model === "nano-banana") | |
| options.model = "gemini-2.5-flash-image-preview"; | |
| const driverHint = typeof options.driver === 'string' ? options.driver : undefined; | |
| const providerRaw = typeof options.provider === 'string' | |
| ? options.provider | |
| : (typeof options.service === 'string' ? options.service : undefined); | |
| const providerHint = typeof providerRaw === 'string' ? providerRaw.toLowerCase() : undefined; | |
| const modelLower = typeof options.model === 'string' ? options.model.toLowerCase() : ''; | |
| const looksLikeTogetherModel = | |
| typeof options.model === 'string' && | |
| (TOGETHER_IMAGE_MODEL_PREFIXES.some(prefix => modelLower.startsWith(prefix)) || | |
| TOGETHER_IMAGE_MODEL_KEYWORDS.some(keyword => modelLower.includes(keyword))); | |
| if (driverHint) { | |
| AIService = driverHint; | |
| } else if (providerHint === 'gemini') { | |
| AIService = "gemini-image-generation"; | |
| } else if (providerHint === 'together' || providerHint === 'together-ai') { | |
| AIService = "together-image-generation"; | |
| } else if (options.model === "gemini-2.5-flash-image-preview") { | |
| AIService = "gemini-image-generation"; | |
| } else if (looksLikeTogetherModel) { | |
| AIService = "together-image-generation"; | |
| } |