SLNG plugin for LiveKit Agents
Support for SLNG's voice AI gateway in LiveKit Agents, providing access to multiple STT and TTS providers through a unified API.
See https://docs.slng.ai/ for more information.
Installation
pip install livekit-plugins-slng
Pre-requisites
You'll need an API key from SLNG. It can be set as an environment variable: SLNG_API_KEY
Usage
Pass an SLNG model identifier; the plugin connects through SLNG's Unmute Bridge and builds the endpoint itself.
from livekit.plugins import slng
stt = slng.STT(
model="deepgram/nova:3",
language="en",
)
tts = slng.TTS(
model="deepgram/aura:2",
voice="aura-2-thalia-en", # provider voice ID, required
language="en",
)
Additional keyword arguments are forwarded to the gateway and applied according to the selected model's contract. Failover across multiple models or endpoints is available via connections=[...]; see docs.slng.ai for details.
End of turn finalization
For the lowest STT turn latency, let the plugin know when the user stops speaking. The plugin then sends a finalize signal so the provider returns the final transcript immediately instead of waiting for its own endpointing:
session = AgentSession(stt=stt, ...)
stt.attach_to_session(session)
Or wire it manually:
@session.on("user_state_changed")
def _on_user_state_changed(ev):
stt.notify_user_state(ev.new_state)
Without this hook the plugin still works, but end of turn detection relies entirely on the provider's endpointing, which typically adds a few hundred milliseconds per turn.
Region override
The plugin supports gateway region routing via the region_override option on both STT and TTS.
This maps directly to the gateway's X-Region-Override header.
See the available regions at docs.slng.ai/region-override.
You can pass either a single region:
stt = slng.STT(
api_key="your-slng-api-key",
model="deepgram/nova:3",
region_override="eu-west-1",
)
Or multiple preferred regions in priority order:
tts = slng.TTS(
api_key="your-slng-api-key",
model="deepgram/aura:2",
voice="aura-2-thalia-en",
region_override=["eu-west-1", "us-east-1"],
)
To constrain routing to a broad geographic zone instead of a specific region,
use world_part_override (for example "eu"), which maps to the gateway's
X-World-Part-Override header. region_override takes precedence when both
are set.
Migrating from 1.x
Version 2.0 is a breaking change:
- All traffic goes through the Unmute Bridge.
model_endpointandmodel_endpointswere removed; pass a model identifier orconnections=[...]instead. - STT no longer defaults to
model="deepgram/nova:3"; pass a model (orconnections) explicitly. - TTS
voiceis required and passed verbatim as the provider's voice identifier. - Language codes are no longer normalized client-side; send the value the model expects (for example BCP-47
hi-INfor Sarvam, nothi). - STT
recognize()(HTTP batch) is no longer supported; usestream(). Onlypcm_s16leinput audio is supported. api_tokenstill works on STT but is deprecated; useapi_key.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file livekit_plugins_slng-1.6.8.tar.gz.
File metadata
- Download URL: livekit_plugins_slng-1.6.8.tar.gz
- Upload date:
- Size: 32.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
47c3102417cd9dd0a46648eebdf05899ae5dbaa85a471bfdf950c10a39d7b87f
|
|
| MD5 |
71a90842267c987ba799c569c5c3914f
|
|
| BLAKE2b-256 |
5dc6567512579f69db8168f29fd5f796b4dbd2f2d32a80a0b6c708eba458d02d
|
Provenance
The following attestation bundles were made for livekit_plugins_slng-1.6.8.tar.gz:
Publisher:
publish.yml on livekit/agents
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
livekit_plugins_slng-1.6.8.tar.gz -
Subject digest:
47c3102417cd9dd0a46648eebdf05899ae5dbaa85a471bfdf950c10a39d7b87f - Sigstore transparency entry: 2335843125
- Sigstore integration time:
-
Permalink:
livekit/agents@c4c303a34d06c64d06851cc2762265f98eb29ced -
Branch / Tag:
refs/heads/main - Owner: https://github.com/livekit
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c4c303a34d06c64d06851cc2762265f98eb29ced -
Trigger Event:
pull_request
-
Statement type:
File details
Details for the file livekit_plugins_slng-1.6.8-py3-none-any.whl.
File metadata
- Download URL: livekit_plugins_slng-1.6.8-py3-none-any.whl
- Upload date:
- Size: 35.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c66f44d72ac9a486245b930eb2d0f7ddec66a38c425b94b5be05f6fedadc7edd
|
|
| MD5 |
e402267425fcf02c972228726eb21c74
|
|
| BLAKE2b-256 |
16209ed76d8d4c2898b93b0453bc0c336342ed34fce5b0aa73c27b3d31955566
|
Provenance
The following attestation bundles were made for livekit_plugins_slng-1.6.8-py3-none-any.whl:
Publisher:
publish.yml on livekit/agents
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
livekit_plugins_slng-1.6.8-py3-none-any.whl -
Subject digest:
c66f44d72ac9a486245b930eb2d0f7ddec66a38c425b94b5be05f6fedadc7edd - Sigstore transparency entry: 2335843329
- Sigstore integration time:
-
Permalink:
livekit/agents@c4c303a34d06c64d06851cc2762265f98eb29ced -
Branch / Tag:
refs/heads/main - Owner: https://github.com/livekit
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c4c303a34d06c64d06851cc2762265f98eb29ced -
Trigger Event:
pull_request
-
Statement type: