Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Nabrah plugin for LiveKit Agents

Support for Nabrah Speech-to-Text in LiveKit Agents, with client-side end-of-turn detection tuned for Arabic conversation.

Installation

pip install livekit-plugins-nabrah

Pre-requisites

You'll need an API key from Nabrah. It can be set as an environment variable: NABRAH_API_KEY.

Usage

Use Nabrah STT in a VoiceSession:

from livekit.agents import VoiceSession
from livekit.plugins import nabrah

session = VoiceSession(
    stt=nabrah.STT(
        recognition_model="eot_nabrah",
        language="ar-SA",
        end_of_turn_confirm_delay_seconds=0.4,
    ),
)

Turn detection

recognition_model="eot_nabrah" emits the end-of-turn signal the plugin uses to close a turn. end_of_turn_confirm_delay_seconds is how long it waits after that signal before committing. Speaking again inside the window keeps the turn open. max_transcript_inactivity_seconds optionally commits after that many seconds without new transcript text. It is disabled by default because it measures recognizer inactivity, not acoustic silence, and a provider delay could otherwise split continuous speech.

Nabrah's unnamed model (recognition_model="") is more accurate but emits no end-of-turn signal. When using it, configure another turn detector or explicitly set max_transcript_inactivity_seconds as a fallback heuristic.

Word boosting

Bias recognition toward terms the model gets wrong:

stt = nabrah.STT(
    priority_words=["مستشفى الملك فيصل التخصصي", "رقم الهوية الوطنية"],
    priority_words_strength=0.5,
)

0.5 is the recommended strength. Higher values make boosted terms appear in places they were not said, so keep the list to terms your callers actually say and add one only after hearing it come out wrong. Multi-word phrases are boosted as a unit.

Loading terms from a file

For anything beyond a handful of terms, keep them in a JSON file so they can be edited without touching code. Create boosting.json next to your agent:

{
  "boost_threshold": 0.5,
  "words": [
    "مستشفى الملك فيصل التخصصي",
    "رقم الهوية الوطنية"
  ]
}

Load it at startup and pass it to the plugin:

import json
import pathlib

from livekit.agents import VoiceSession
from livekit.plugins import nabrah

boosting = json.loads(
    pathlib.Path(__file__).with_name("boosting.json").read_text(encoding="utf-8")
)

session = VoiceSession(
    stt=nabrah.STT(
        recognition_model="eot_nabrah",
        language="ar-SA",
        end_of_turn_confirm_delay_seconds=0.4,
        priority_words=boosting["words"],
        priority_words_strength=boosting["boost_threshold"],
    ),
)

Read the file with encoding="utf-8". Without it, Arabic terms fail to load on platforms that default to a different encoding.

Full example

A complete agent using Nabrah STT with word boosting loaded from a file:

import json
import pathlib

from dotenv import load_dotenv
from livekit import agents
from livekit.agents import (
    Agent,
    AgentServer,
    JobContext,
    TurnHandlingOptions,
    VoiceSession,
    inference,
)
from livekit.plugins import nabrah

load_dotenv()

boosting = json.loads(
    pathlib.Path(__file__).with_name("boosting.json").read_text(encoding="utf-8")
)

server = AgentServer()


assistant = Agent(instructions="You are a helpful voice assistant.")


@server.rtc_session()
async def entrypoint(ctx: JobContext) -> None:
    session = VoiceSession(
        stt=nabrah.STT(
            recognition_model="eot_nabrah",
            language="ar-SA",
            end_of_turn_confirm_delay_seconds=0.4,
            max_transcript_inactivity_seconds=1.5,
            priority_words=boosting["words"],
            priority_words_strength=boosting["boost_threshold"],
        ),
        llm=inference.LLM("openai/gpt-4.1-mini"),
        tts=inference.TTS("cartesia/sonic-3"),
        turn_handling=TurnHandlingOptions(
            turn_detection="stt",
            endpointing={"min_delay": 0},
        ),
    )

    await session.start(agent=assistant, room=ctx.room)


if __name__ == "__main__":
    agents.cli.run_app(server)

Parameters

Parameter Default Description
recognition_model "eot_nabrah" "eot_nabrah" emits the end-of-turn signal used for turn detection. "" selects the default model, which is more accurate but emits no signal.
end_of_turn_confirm_delay_seconds 0.4 Hold after an end-of-turn signal before committing the turn. None commits immediately.
max_transcript_inactivity_seconds None Optional fallback that finalizes after no new transcript text. This does not measure acoustic silence.
priority_words [] Terms to bias recognition toward.
priority_words_strength 0.5 How strongly to bias.
api_key NABRAH_API_KEY API key, if not set in the environment.

Metadata

Release files for livekit-plugins-nabrah 2.0.0b2

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-nabrah 2.0.0b2
File Size Uploaded Provenance Actions
livekit_plugins_nabrah-2.0.0b2.tar.gz 9.4 kB With provenance Details for livekit_plugins_nabrah-2.0.0b2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for livekit-plugins-nabrah 2.0.0b2
File Interpreter ABI Platform Actions
livekit_plugins_nabrah-2.0.0b2-py3-none-any.whl Python 3 none any Details for livekit_plugins_nabrah-2.0.0b2-py3-none-any.whl

Total release size: 19.5 kB

Release files / livekit_plugins_nabrah-2.0.0b2.tar.gz

Download URL livekit_plugins_nabrah-2.0.0b2.tar.gz
Size 9.4 kB
Tags Source
SHA-256 checksum
How to use checksums
444baf418fcf32cfe8c4bf12af912f64cf424c6a3a2ee1668440084121b3cd13
BLAKE2b-256 checksum
How to use checksums
d3ba52883ea22e1991cfcd75545342395a79ba667b3d14ca99594737e6e90e69
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_nabrah-2.0.0b2-py3-none-any.whl

Download URL livekit_plugins_nabrah-2.0.0b2-py3-none-any.whl
Size 10.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d27f65d4a21156d08bb3ec3400cec5690453b72bc630b99df79b1218c2f0188e
BLAKE2b-256 checksum
How to use checksums
911a2b4567803cf7cf90425e8fc27b2e2a9d1fb63c805d35cc9931e7a796eaf3
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-nabrah 2.0.0b2

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_nabrah-2.0.0b2.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.

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