pipedog is an unofficial community port of Pipecat, not affiliated with Daily.
pipedog
Speech-to-text

Together AI

Realtime speech-to-text with TogetherSTTService, over Together AI's WebSocket API.

Overview

  • TogetherSTTService: streams audio over a WebSocket to Together's realtime transcription endpoint and pushes interim and final transcriptions.

Installation

bun add @pipedog/together
import { TogetherSTTService } from "@pipedog/together/stt";

Prerequisites

  • A Together AI account and an API key from Together AI.
  • Pass the key as apiKey. The examples read it from TOGETHER_API_KEY.

TogetherSTTService

Connects to wss://api.together.ai/v1/realtime?intent=transcription, with Authorization: Bearer <key>.

Configuration

Prop

Type

Settings

Runtime-updatable settings, passed as settings: new TogetherSTTService.Settings({...}) (TogetherSTTSettings). Any setting you leave out keeps the default below.

SettingTypeDefaultDescription
modelstring"openai/whisper-large-v3"Transcription model.
languageLanguage | nullLanguage.ENLanguage of the audio.

Usage

stt.ts
import { STTUpdateSettingsFrame } from "@pipedog/core/frames/frames";
import { TogetherSTTService } from "@pipedog/together/stt";

const stt = new TogetherSTTService({
  apiKey: process.env.TOGETHER_API_KEY ?? "",
  settings: new TogetherSTTService.Settings({ model: "openai/whisper-large-v3" }),
});

Change settings mid-call with an STTUpdateSettingsFrame:

// Queue it on the worker, or push it from a processor upstream of the service.
const update = new STTUpdateSettingsFrame({
  delta: new TogetherSTTService.Settings({ model: "openai/whisper-large-v3" }),
});

Event handlers

EventDescription
on_connectedThe WebSocket connected.
on_disconnectedThe WebSocket closed.

Notes

  • Audio is sent as base64 16-bit PCM. When the user stops speaking, the buffer is committed so the final transcript arrives.
  • Any settings change reconnects, since the session is configured in the connection URL.
  • If the connection drops, the base class reconnects.

Runtime notes

RuntimeWorksWhat it needs
Bun✅ yesNothing.
Node.js✅ yesNothing.
Deno✅ yesNothing.
Cloudflare Workers✅ yesNothing.

Generated from pipecat.runtimes and pipecat.compat in packages/together/package.json: ✅ means the compat smoke test passes on that runtime.

  • The WebSocket goes through the core websocketConnect, with headers on the handshake. It works on Bun, Node, Deno and Cloudflare Workers.
  • Tested against a local WebSocket fake, not against Together AI itself.

pipedog is an unofficial community TypeScript port of Pipecat. It is not affiliated with or endorsed by Daily or the Pipecat project.

Portions adapted from the Pipecat documentation, Copyright (c) 2024–2025 Daily, BSD-2-Clause (see apps/docs/LICENSE-pipecat-docs).

On this page