Skip to main content

Boson plugin for LiveKit Agents

This plugin lets LiveKit Agents use the Boson realtime WebSocket API as a LiveKit RealtimeModel.

LiveKit owns the room connection, participant audio, interruption plumbing, transcript IO, and worker lifecycle. This plugin adapts LiveKit Agents realtime model calls to Boson's OpenAI-compatible realtime protocol subset.

See https://docs.livekit.io/agents/models/realtime/boson/ for more information.

Installation

pip install livekit-plugins-boson-ai

Usage

Set BOSON_API_KEY in your environment. Get a key at boson.ai/workspace/api-key.

from livekit.agents import AgentSession
from livekit.plugins import boson_ai


session = AgentSession(llm=boson_ai.realtime.RealtimeModel())

The defaults connect to the hosted API (wss://api.boson.ai/v1/realtime) with the higgs-realtime model and the default voice. To point at another deployment, pass url= — and api_key=None if it does not authenticate.

Model options

boson_ai.realtime.RealtimeModel accepts these options:

Option Description
url Realtime WebSocket endpoint. Defaults to wss://api.boson.ai/v1/realtime. http/https URLs are normalized to ws/wss; the path is passed through unchanged.
api_key Sent as an Authorization: Bearer ... header. Omit it to read BOSON_API_KEY from the environment; omitting both raises ValueError. Pass None explicitly to send no header, for a local dev server without auth.
model Sent as session.model. Defaults to "higgs-realtime".
voice Sent as session.audio.output.voice.
output_modalities ["audio"] by default. ["text"] is also supported for text-only responses.
temperature Optional. Sent as session.temperature when set; otherwise the server default is used.
max_output_tokens Sent as session.max_output_tokens.
tool_choice Sent as session.tool_choice.
speed Playback rate for synthesized audio; 1.0 is unmodified. Sent as session.audio.output.speed.
turn_detection Sent as session.audio.input.turn_detection.
input_audio_transcription Sent as session.audio.input.transcription.
input_audio_noise_reduction Sent as session.audio.input.noise_reduction.
truncation "auto" (default) or "disabled". Sent as session.truncation. "auto" enables background context summarization where the model supports it. Do not pass None — it is rejected and ends the session.
query_params Extra query parameters added to the WebSocket URL.
max_session_duration Seconds before the connection is recycled: the session reconnects and replays the conversation as text, after any reply in progress finishes. A user turn replays only if it has a transcript. Defaults to 1200 (20 minutes), as in the OpenAI plugin, when user transcription is on (input_audio_transcription_model set), and to None when it is off, since every recycle would then drop all of the user's turns. The default is chosen at construction; changing transcription later does not revisit it. None keeps one connection until the server's own limit, which is recycled the same way. Must be positive.

If turn_detection is omitted, the plugin sends a default server VAD config:

{
    "type": "server_vad",
    "create_response": True,
    "interrupt_response": True,
    "prefix_padding_ms": 300,
    "silence_duration_ms": 500,
    "threshold": 0.55,
}

create_response and interrupt_response are accepted for OpenAI wire compatibility but are not configurable here: with server VAD enabled, a response is always created after user speech and the active response is always cancelled when new speech is detected. The plugin's own duplicate response.cancel suppression follows that behavior (keyed on whether server VAD is enabled at all), not on what these fields are set to.

The dict is sent to the server as given, so {"type": "semantic_vad", ...} works too; the plugin does not filter or rewrite its keys.

Passing turn_detection=None/False disables server-side turn detection and switches to client-driven input_audio_buffer.commit. This is exposed for interface completeness but isn't a heavily-exercised path yet — treat it as experimental rather than a recommended default.

input_audio_transcription can be passed as a full dict, or built with:

  • input_audio_transcription_model (e.g. "higgs-stt-3.1")
  • input_audio_transcription_language

User transcription is enabled only when the transcription config contains a non-empty model. A transcription prompt is not supported; the plugin drops it even if present in a raw input_audio_transcription dict.

generate_reply() overrides

generate_reply(instructions=...) works as it does with the OpenAI plugin. The instructions go in response.create, which the server uses in place of the session instructions for that reply, so the event carries the session instructions followed by the per-response ones.

tools and tool_choice are not applied per response — the server accepts and ignores them. generate_reply() therefore ignores them too (with a warning) rather than sending values that would appear to take effect. The framework scopes them at the session level around the call instead, since the plugin reports per_response_tool_choice = False; to scope them from your own code, use update_tools() and update_options(tool_choice=...) directly.

Protocol compatibility

The plugin translates LiveKit realtime model operations to the following client events:

  • session.update
  • input_audio_buffer.append
  • input_audio_buffer.commit
  • input_audio_buffer.clear
  • conversation.item.create
  • conversation.item.delete
  • conversation.item.truncate
  • response.create
  • response.cancel

The plugin handles Boson response audio, response text, audio transcript, input transcription, function call, interruption, and error events and maps them back to LiveKit realtime model streams.

Function tools registered on the LiveKit Agent are sent in session.update. When Boson returns a function_call item, LiveKit Agents executes the Python tool locally and the plugin sends the result back as a function_call_output conversation item.

Only function tools have a shape on the wire. A tool of any other kind is left out of session.update — the model never sees it — and the plugin logs a warning once per session saying how many were dropped.

The plugin does not retry a WebSocket close that a reconnect cannot fix: an invalid API key (close code 3000) or a billing entitlement refusal (close code 4429, e.g. insufficient_quota/monthly_cap_reached) both end the session instead of retrying. Server errors that reflect an expected client/server race rather than a real failure (response_not_active, response_id_mismatch, voice_output_task_ongoing, invalid_previous_item_id) are logged but not surfaced as recoverable error events.

The server has no insert-at-head primitive for conversation items (previous_item_id: null always means append-at-tail). If update_chat_ctx() needs to insert a new item ahead of turns the server already has (e.g. prepending a context summary), the plugin deletes and recreates the entire remote conversation in the target order instead of silently misordering it by appending the new item at the tail.

That rebuild can only put back what it can express as text. A user turn whose transcript has not arrived yet has none, and no audio is kept client-side, so it is deleted along with the rest and not recreated — the server answers without it until a later update_chat_ctx() recreates it (at the tail) once its transcript exists. The plugin logs a warning naming the affected item ids whenever this happens.

The same limit applies without a rebuild. A change to a turn's text goes out as a delete plus a create under one id, so clearing that text leaves a create with nothing to send: the turn is deleted rather than emptied. The delete is kept — the caller asked for that text to leave the context — and the same warning names the item, which returns on a later sync once it has text again.

Limitations

  • The plugin expects the current realtime event names, such as response.output_audio.delta and response.output_text.delta.
  • Video input is not supported yet.
  • Mixed ["text", "audio"] output modalities are not supported; choose either ["audio"] or ["text"].
  • This plugin sends and receives 24 kHz PCM audio. That's the format this integration uses, not the full range the Higgs Realtime API supports.
  • system/developer-role chat items are not supported (the server's conversation store only accepts assistant/user items); they're silently dropped when syncing update_chat_ctx(). Use the Agent's instructions for persistent directives instead.

Metadata

Release files for livekit-plugins-boson-ai 1.8.13

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-boson-ai 1.8.13
File Size Uploaded Provenance Actions
livekit_plugins_boson_ai-1.8.13.tar.gz 30.3 kB With provenance Details for livekit_plugins_boson_ai-1.8.13.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for livekit-plugins-boson-ai 1.8.13
File Interpreter ABI Platform Actions
livekit_plugins_boson_ai-1.8.13-py3-none-any.whl Python 3 none any Details for livekit_plugins_boson_ai-1.8.13-py3-none-any.whl

Total release size: 61.9 kB

Release files / livekit_plugins_boson_ai-1.8.13.tar.gz

Download URL livekit_plugins_boson_ai-1.8.13.tar.gz
Size 30.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8aeee590762fae0a4b1281df1d14b254760ba4329b86cd0afa0ff544e3d1df4a
BLAKE2b-256 checksum
How to use checksums
b39c835f9c477a44fb94be7ba3ff608f2d80d7347dd814cb0720f996b2fdeaea
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 18, 2026.

Transparency log

Release files / livekit_plugins_boson_ai-1.8.13-py3-none-any.whl

Download URL livekit_plugins_boson_ai-1.8.13-py3-none-any.whl
Size 31.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
facb5b86fac8fafa9fa6d2204b0c3fdcef9a2acb1fa9044cef8229813197b896
BLAKE2b-256 checksum
How to use checksums
09e8fe54e36cb265b8a0b4cc1290446ef06dbf961038d7f4de3d5ef80b35a9e4
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 18, 2026.

Transparency log

Security for livekit-plugins-boson-ai 1.8.13

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_boson_ai-1.8.13.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 18, 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.8.13 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