Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions packages/inference/src/providers/together.ts
Original file line number Diff line number Diff line change
Expand Up @@ -531,10 +531,14 @@ export class TogetherTextToSpeechTask extends TaskProviderHelper implements Text
preparePayload(params: BodyParams): Record<string, unknown> {
const userParams = (params.args.parameters as Record<string, unknown> | undefined) ?? {};
// Together's /v1/audio/speech requires a `voice` field. Voices are model-specific
// (Kokoro accepts `af_*`, Orpheus uses different names, etc.), so we only default
// when the target model is Kokoro — the only TTS model currently registered.
const isKokoro = params.model.toLowerCase().includes("kokoro");
const voice = userParams.voice ?? (isKokoro ? "af_alloy" : undefined);
// (Kokoro accepts `af_*`, Orpheus uses different names, etc.), so we default per model.
const model = params.model.toLowerCase();
const defaultVoice = model.includes("kokoro")
? "af_alloy"
: model.includes("orpheus")
? "tara"
: undefined;
const voice = userParams.voice ?? defaultVoice;

return {
...omit(params.args, ["inputs", "parameters"]),
Expand Down