LiveKit docs › Build Agents › Models › STT › Additional models › Baseten

---

# Baseten STT plugin guide

> How to use the Baseten STT plugin for LiveKit Agents.

Available in:
- [ ] Node.js
- [x] Python

## Overview

This plugin allows you to use [Baseten](https://www.baseten.co/) as an STT provider for your voice agents.

### Installation

Install the plugin from PyPI:

```shell
uv add "livekit-agents[baseten]~=1.8"

```

### Authentication

The Baseten plugin requires a [Baseten API key](https://app.baseten.co/settings/api-keys).

Set the following in your `.env` file:

```shell
BASETEN_API_KEY=<your-baseten-api-key>

```

### Model deployment

You must deploy a websocket-based STT model to Baseten to use it with LiveKit Agents. The plugin supports two model families, selected with the `model` parameter:

| `model` | Deployment | Notes |
| --- | --- | --- |
| `whisper` (default) | [Whisper Large V3 Turbo](https://www.baseten.co/library/whisper-large-turbo/) | Realtime streaming Whisper. |
| `qwen3-asr` | [Qwen3-ASR 1.7B Streaming](https://www.baseten.co/library/qwen3-asr-1-7b-streaming/) | Streaming Qwen3-ASR, with optional word-level alignment. |

The two families use different wire protocols and aren't interchangeable, so set `model` to match the deployment you created. The standard, non-streaming Whisper deployments in the Baseten library aren't suitable for realtime use. Deploy one of the streaming models in the table.

Your model endpoint may show as an HTTP URL such as `https://model-<id>.api.baseten.co/environments/production/predict`. The domain is correct but you must change the protocol to `wss` and the path to `/environments/production/websocket` to use it as the `model_endpoint` parameter:

```
wss://model-<your-model-id>.api.baseten.co/environments/production/websocket

```

Note the `model-` prefix on the hostname. Instead of building the URL yourself, pass `model_id` (or `chain_id` for a chain deployment) and the plugin constructs it for you.

### Usage

Use Baseten STT within an `AgentSession` or as a standalone transcription service. For example, you can use this STT in the [Voice AI quickstart](https://docs.livekit.io/agents/start/voice-ai.md).

```python
from livekit.plugins import baseten

session = AgentSession(
   # Streaming Whisper, the default model.
   stt=baseten.STT(model_id="<your-model-id>"),
   # ... llm, tts, etc.
)

```

To use Qwen3-ASR instead, set `model`:

```python
stt=baseten.STT(model="qwen3-asr", model_id="<your-model-id>")

```

Detection across all supported languages is unreliable on the one- to two-second utterances typical of telephony. Restrict detection to the languages your agent supports instead. This needs Baseten Whisper runtime v0.5.0 or newer:

```python
stt=baseten.STT(
   model_id="<your-model-id>",
   language="auto",
   language_options=["en", "de"],
)

```

### Parameters

This section describes some of the available parameters. See the [plugin reference](https://docs.livekit.io/reference/python/livekit/plugins/baseten/index.html.md#livekit.plugins.baseten.STT) for a complete list of all available parameters.

- **`model`** _(STTModels)_ (optional) - Default: `whisper`: Which deployment protocol to use: `whisper` or `qwen3-asr`. The two aren't interchangeable. See [Model deployment](#model-deployment).

- **`model_endpoint`** _(string)_ (optional) - Environment: `BASETEN_MODEL_ENDPOINT`: The endpoint URL for your deployed model. You can find this in your Baseten dashboard. Note that this must be a websocket URL (starts with `wss://`). Takes priority over `model_id` and `chain_id`. See [Model deployment](#model-deployment) for more details.

- **`model_id`** _(string)_ (optional): Baseten truss model ID. The plugin builds the endpoint URL for you. Ignored when `model_endpoint` is set.

- **`chain_id`** _(string)_ (optional): Baseten chain ID. The plugin builds the endpoint URL for you. Ignored when `model_endpoint` is set.

- **`language`** _(LanguageCode)_ (optional): [Language code](https://docs.livekit.io/agents/models/stt.md#language-codes) for the input audio. For `whisper`, this is a BCP-47 code and defaults to `en`; use `auto` for detection. For `qwen3-asr`, it's a Qwen3-ASR canonical language name such as `English` or `Cantonese`, or `auto` (the default). Forcing a language on `qwen3-asr` also sets the output language and can translate, so use it only to pin what's actually spoken.

- **`language_options`** _(list[LanguageCode])_ (optional) - Default: `[]`: Restrict automatic detection to this set of language codes, such as `["en", "de"]`. This is usually more accurate than `auto`. Requires Baseten Whisper runtime v0.5.0 or newer. Empty, the default, leaves detection unrestricted. `whisper` only.

- **`enable_partial_transcripts`** _(bool)_ (optional) - Default: `True`: Emit interim transcripts while the speaker is still talking.

- **`partial_transcript_interval_s`** _(float)_ (optional): Interval in seconds between partial transcript updates. Defaults to `1.0` for `whisper` and `0.5` for `qwen3-asr`, matching each deployment's own default.

- **`final_transcript_max_duration_s`** _(int)_ (optional) - Default: `30`: Maximum seconds of audio before the server forces a final transcript.

- **`show_word_timestamps`** _(bool)_ (optional): Include word-level timestamps. Defaults to on for `whisper` and off for `qwen3-asr`, whose aligner is opt-in on the deployment (`STREAM_ALIGNER=mms`).

- **`encoding`** _(string)_ (optional) - Default: `pcm_s16le`: Audio encoding: `pcm_s16le` or `pcm_mulaw`. `whisper` only.

- **`buffer_size_seconds`** _(float)_ (optional) - Default: `0.032`: Audio buffer size in seconds. `whisper` only.

- **`sample_rate`** _(int)_ (optional) - Default: `16000`: Audio sample rate in Hz. `whisper` only. `qwen3-asr` always uses 16 kHz PCM16.

- **`vad_threshold`** _(float)_ (optional) - Default: `0.5`: Server-side voice activity detection threshold, from `0.0` to `1.0`.

- **`vad_min_silence_duration_ms`** _(int)_ (optional): Minimum duration of silence in milliseconds to consider speech ended. Defaults to `300` for `whisper` and `500` for `qwen3-asr`.

- **`vad_speech_pad_ms`** _(int)_ (optional): Duration in milliseconds to pad speech segments. Defaults to `30` for `whisper` and `100` for `qwen3-asr`.

## Additional resources

The following resources provide more information about using Baseten with LiveKit Agents.

- **[Python package](https://pypi.org/project/livekit-plugins-baseten/)**: The `livekit-plugins-baseten` package on PyPI.

- **[Plugin reference](https://docs.livekit.io/reference/python/livekit/plugins/baseten/index.html.md#livekit.plugins.baseten.STT)**: Reference for the Baseten STT plugin.

- **[GitHub repo](https://github.com/livekit/agents/tree/main/livekit-plugins/livekit-plugins-baseten)**: View the source or contribute to the LiveKit Baseten STT plugin.

- **[Baseten docs](https://docs.baseten.co/)**: Baseten's full docs site.

- **[Voice AI quickstart](https://docs.livekit.io/agents/start/voice-ai.md)**: Get started with LiveKit Agents and Baseten.

- **[Baseten TTS](https://docs.livekit.io/agents/models/tts/baseten.md)**: Guide to the Baseten TTS plugin with LiveKit Agents.

---

This document was rendered at 2026-11-14T15:23:30.701Z.
For the latest version of this document, see [https://docs.livekit.io/agents/models/stt/baseten.md](https://docs.livekit.io/agents/models/stt/baseten.md).

To explore all LiveKit documentation, see [llms.txt](https://docs.livekit.io/llms.txt).