Skip to main content

AssemblyAI plugin for LiveKit Agents

Support for Streaming Speech-to-Text and Streaming Text-to-Speech from AssemblyAI.

More information is available in the docs for the STT integration and for AssemblyAI's Streaming TTS.

Installation

pip install livekit-plugins-assemblyai

Pre-requisites

You'll need to specify an AssemblyAI API Key. It can be set as environment variable: ASSEMBLYAI_API_KEY.

Usage

from livekit.agents import AgentSession, TurnHandlingOptions
from livekit.plugins import assemblyai

session = AgentSession(
    stt=assemblyai.STT(model="assemblyai-stt-3-7-realtime-agent", mode="balanced"),
    tts=assemblyai.TTS(
        model="assemblyai-tts-1",
        voice="49c443a4-8a1d-5f7e-b70b-98bdbd9823c3",  # Audrey
    ),
    # let AssemblyAI decide when the user has finished speaking
    turn_handling=TurnHandlingOptions(turn_detection="stt"),
    # use the TTS word timings for the transcript and for what an interrupted reply said
    use_tts_aligned_transcript=True,
    # ... llm, vad, etc.
)

Speech-to-text

assemblyai.STT streams AssemblyAI-STT-3.7-Realtime-Agent by default (model). Useful options:

  • mode: "min_latency", "balanced", "max_accuracy" or "manual" (see below).
  • language_codes: steer transcription toward one or more expected languages ("es" or ["en", "es"]).
  • prompt: context about the audio, such as its domain or scenario, to help recognize likely vocabulary (up to 1,750 characters).
  • keyterms_prompt: names and terms the model should get right.

Manual mode

To let a LiveKit turn detector decide when the user is done, set mode="manual". AssemblyAI then doesn't end turns on short pauses. When LiveKit ends the turn, the plugin sends AssemblyAI a ForceEndpoint and gets that turn's final transcript back right away.

from livekit.agents import AgentSession, TurnHandlingOptions, inference
from livekit.plugins import assemblyai

session = AgentSession(
    stt=assemblyai.STT(model="assemblyai-stt-3-7-realtime-agent", mode="manual"),
    vad=inference.VAD(),
    turn_handling=TurnHandlingOptions(turn_detection=inference.TurnDetector()),
    # ... llm, tts, etc.
)

Manual mode needs assemblyai-stt-3-7-realtime-agent and a LiveKit turn detector or VAD turn detection, and doesn't support speaker_labels yet. Leave min_turn_silence unset. max_turn_silence (10 s by default) only ends a turn when LiveKit never does. See manual mode.

Text-to-speech

assemblyai.TTS streams speech over a pooled WebSocket and cancels in-flight audio when the user interrupts. Useful options:

  • voice: a voice's id, from the voice library or a custom (cloned) voice; defaults to Audrey. Slugs such as "aai-linda-3" also work, but can change, while ids don't.
  • language: a code such as "es", set independently of the voice.
  • model: defaults to assemblyai-tts-1.
  • base_url: the US data zone by default; wss://tts.eu.assemblyai.com keeps data in the EU.
  • word_timestamps: per-word timings (default True). With AgentSession(use_tts_aligned_transcript=True), LiveKit uses them to sync the transcript and to record an interrupted reply up to the word the user heard.

Call tts.prewarm() to open the session before the first reply.

Metadata

Release files for livekit-plugins-assemblyai 1.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for livekit-plugins-assemblyai 1.9.0
File Size Uploaded Provenance Actions
livekit_plugins_assemblyai-1.9.0.tar.gz 28.0 kB With provenance Details for livekit_plugins_assemblyai-1.9.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for livekit-plugins-assemblyai 1.9.0
File Interpreter ABI Platform Actions
livekit_plugins_assemblyai-1.9.0-py3-none-any.whl Python 3 none any Details for livekit_plugins_assemblyai-1.9.0-py3-none-any.whl

Total release size: 57.1 kB

Release files / livekit_plugins_assemblyai-1.9.0.tar.gz

Download URL livekit_plugins_assemblyai-1.9.0.tar.gz
Size 28.0 kB
Tags Source
SHA-256 checksum
How to use checksums
e95fe386e2830d3a3b7a1caacf9f4aa530cccb2ae545a2f78c79d54ee7e5ab2d
BLAKE2b-256 checksum
How to use checksums
00282dcaf9b4ce1c7bd67558a134a4de3455e3239bdfe5f9ff072d4ccda15adc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / livekit_plugins_assemblyai-1.9.0-py3-none-any.whl

Download URL livekit_plugins_assemblyai-1.9.0-py3-none-any.whl
Size 29.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d3a6b8d93b957b0540a6c18712210d7297a36917bbbaaababc13db39f5dd8e94
BLAKE2b-256 checksum
How to use checksums
98efa4155065abf3f5ecaf137207124da12c2fa002be4b5cb354fdbbed44a059
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Security for livekit-plugins-assemblyai 1.9.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for livekit_plugins_assemblyai-1.9.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.9.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page