Skip to content

Inconsistent together ai model prefix #1970

@reynaldichernando

Description

@reynaldichernando

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

Image

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

const TOGETHER_IMAGE_MODEL_PREFIXES = [
'black-forest-labs/',
'stabilityai/',
'togethercomputer/',
'playgroundai/',
'runwayml/',
'lightricks/',
'sg161222/',
'wavymulder/',
'prompthero/',
];

video prefix

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

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";
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions