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

Mistral

Realtime speech-to-text with MistralSTTService, Mistral's Voxtral over WebSocket.

Overview

  • MistralSTTService: streams audio to Mistral's Voxtral realtime transcription over a WebSocket, pushes the text deltas as interim transcriptions, and the final transcript when the user stops speaking.

Installation

bun add @pipedog/mistral
import { MistralSTTService } from "@pipedog/mistral/stt";

Prerequisites

  • A Mistral account and an API key from Mistral.
  • Pass the key as apiKey. The examples read it from MISTRAL_API_KEY.
  • A VAD in the pipeline: the end of the user's speech flushes the audio buffer.

MistralSTTService

Connects to wss://api.mistral.ai/v1/audio/transcriptions/realtime.

Configuration

Prop

Type

Settings

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

SettingTypeDefaultDescription
modelstring"voxtral-mini-transcribe-realtime-2602"Realtime transcription model.
languageLanguage | nullnullNot sent: Voxtral detects the language, which is reported on the final transcript.

Usage

stt.ts
import { STTUpdateSettingsFrame } from "@pipedog/core/frames/frames";
import { MistralSTTService } from "@pipedog/mistral/stt";

const stt = new MistralSTTService({
  apiKey: process.env.MISTRAL_API_KEY ?? "",
});

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 MistralSTTService.Settings({ model: "voxtral-mini-transcribe-realtime-2602" }),
});

Event handlers

EventDescription
on_connectedThe session was created.
on_disconnectedThe WebSocket closed.
on_connection_errorThe connection failed.

Notes

  • targetStreamingDelayMs trades latency for accuracy, when set. It is sent in the session.update message (target_streaming_delay_ms); Mistral accepts 80 to 1200, or 2400, and recommends 480.
  • The service waits for session.created before it sends the session settings, as Mistral's SDK does.
  • Any settings change 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/mistral/package.json: ✅ means the compat smoke test passes on that runtime.

  • The WebSocket goes through the core websocketConnect (upstream uses the mistralai SDK's realtime connection). It works on Bun, Node, Deno and Cloudflare Workers.
  • The protocol follows Mistral's SDK (mistralai 3.3.0 and @mistralai/mistralai 3.1.0, extra/realtime) and the realtime transcription docs. input_audio.flush and transcription.language are in the SDK but not in the docs.
  • Tested against a local fake that follows that protocol, not against Mistral 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