# Gladia plugin for LiveKit Agents
Support for speech-to-text with [Gladia](https://gladia.io/).
See [https://docs.livekit.io/agents/integrations/stt/gladia/](https://docs.livekit.io/agents/integrations/stt/gladia/) for more information.
## Installation
```bash
pip install livekit-plugins-gladia
```
## Pre-requisites
You'll need an API key from Gladia. It can be set as an environment variable: `GLADIA_API_KEY`
## Features
- Streaming speech-to-text
- Multi-language support
- Code-switching between languages
- Interim results (partial transcriptions)
- Voice activity detection with energy filtering
- Optional real-time translation
- Customizable audio parameters (sample rate, bit depth, channels, encoding)
## Example Usage
```python
from livekit.stt import STT
from livekit.plugins.gladia.stt import STT as GladiaSTT
# Basic initialization
stt = GladiaSTT(
api_key="your-api-key-here", # or use GLADIA_API_KEY env var
interim_results=True
)
# With more options
stt = GladiaSTT(
languages=["en", "fr"], # Specify languages or let Gladia auto-detect
code_switching=True, # Allow switching between languages during recognition
sample_rate=16000, # Audio sample rate in Hz
bit_depth=16, # Audio bit depth
channels=1, # Number of audio channels
region="eu-west" # Specify Region to use for the Gladia API
encoding="wav/pcm", # Audio encoding format
energy_filter=True, # Enable voice activity detection
translation_enabled=True,
translation_target_languages=["en"],
translation_model="base",
translation_match_original_utterances=True
translation_context_adaptation= False, # Enable context-aware translation
translation_context= None, # Context input to guide translation
translation_informal=False, # Use informal tone in translation
pre_processing_audio_enhancer=False, # Apply pre-processing to the audio stream to enhance the quality
pre_processing_speech_threshold=0.6, # Sensitivity for speech detection; closer to 1 = stricter, less background noise
# Custom_vocabulary exemple
custom_vocabulary=[
"Westeros",
{"value": "Stark"},
{
"value": "Night's Watch",
"pronunciations": ["Nightz Watch"],
"intensity": 0.4,
"language": "en"
}
],
# Custom_spelling exemple
custom_spelling={
"Gorish": ["ghorish", "gaurish", "gaureish"],
"Data Science": ["data-science", "data science"],
".": ["period", "full stop"],
"SQL": ["sequel"]
}
)
# Update options after initialization
stt.update_options(
languages=["ja", "en"],
translation_enabled=True,
translation_target_languages=["fr"]
)
```
## Using with LiveKit Agents Framework
```python
from livekit.agents import Agent
from livekit.plugins.gladia.stt import STT as GladiaSTT
agent = Agent(
stt=GladiaSTT(
api_key="your-api-key-here",
languages=["en"],
translation_enabled=True,
translation_target_languages=["es"]
)
)
# Rest of your agent setup...
```
Raw data
{
"_id": null,
"home_page": null,
"name": "livekit-plugins-gladia",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9.0",
"maintainer_email": null,
"keywords": "audio, gladia, livekit, realtime, speech-to-text, video, webrtc",
"author": null,
"author_email": "LiveKit <support@livekit.io>",
"download_url": "https://files.pythonhosted.org/packages/0f/11/fa417daeaa6953e69621278f51d2dd36a6d0d2a84adef7f5df63a6e8ffbe/livekit_plugins_gladia-1.2.5.tar.gz",
"platform": null,
"description": "# Gladia plugin for LiveKit Agents\n\nSupport for speech-to-text with [Gladia](https://gladia.io/).\n\nSee [https://docs.livekit.io/agents/integrations/stt/gladia/](https://docs.livekit.io/agents/integrations/stt/gladia/) for more information.\n\n## Installation\n\n```bash\npip install livekit-plugins-gladia\n```\n\n## Pre-requisites\n\nYou'll need an API key from Gladia. It can be set as an environment variable: `GLADIA_API_KEY`\n\n## Features\n\n- Streaming speech-to-text\n- Multi-language support\n- Code-switching between languages\n- Interim results (partial transcriptions)\n- Voice activity detection with energy filtering\n- Optional real-time translation\n- Customizable audio parameters (sample rate, bit depth, channels, encoding)\n\n## Example Usage\n\n```python\nfrom livekit.stt import STT\nfrom livekit.plugins.gladia.stt import STT as GladiaSTT\n\n# Basic initialization\nstt = GladiaSTT(\n api_key=\"your-api-key-here\", # or use GLADIA_API_KEY env var\n interim_results=True\n)\n\n# With more options\nstt = GladiaSTT(\n languages=[\"en\", \"fr\"], # Specify languages or let Gladia auto-detect\n code_switching=True, # Allow switching between languages during recognition\n sample_rate=16000, # Audio sample rate in Hz\n bit_depth=16, # Audio bit depth\n channels=1, # Number of audio channels\n region=\"eu-west\" # Specify Region to use for the Gladia API\n encoding=\"wav/pcm\", # Audio encoding format\n energy_filter=True, # Enable voice activity detection\n translation_enabled=True,\n translation_target_languages=[\"en\"],\n translation_model=\"base\",\n translation_match_original_utterances=True\n translation_context_adaptation= False, # Enable context-aware translation\n translation_context= None, # Context input to guide translation\n translation_informal=False, # Use informal tone in translation\n pre_processing_audio_enhancer=False, # Apply pre-processing to the audio stream to enhance the quality\n pre_processing_speech_threshold=0.6, # Sensitivity for speech detection; closer to 1 = stricter, less background noise\n\n # Custom_vocabulary exemple\n custom_vocabulary=[\n \"Westeros\",\n {\"value\": \"Stark\"},\n {\n \"value\": \"Night's Watch\",\n \"pronunciations\": [\"Nightz Watch\"],\n \"intensity\": 0.4,\n \"language\": \"en\"\n }\n ],\n\n # Custom_spelling exemple\n custom_spelling={\n \"Gorish\": [\"ghorish\", \"gaurish\", \"gaureish\"],\n \"Data Science\": [\"data-science\", \"data science\"],\n \".\": [\"period\", \"full stop\"],\n \"SQL\": [\"sequel\"]\n }\n)\n\n# Update options after initialization\nstt.update_options(\n languages=[\"ja\", \"en\"],\n translation_enabled=True,\n translation_target_languages=[\"fr\"]\n)\n```\n\n## Using with LiveKit Agents Framework\n\n```python\nfrom livekit.agents import Agent\nfrom livekit.plugins.gladia.stt import STT as GladiaSTT\n\nagent = Agent(\n stt=GladiaSTT(\n api_key=\"your-api-key-here\",\n languages=[\"en\"],\n translation_enabled=True,\n translation_target_languages=[\"es\"]\n )\n)\n\n# Rest of your agent setup...\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "Agent Framework plugin for services using Gladia's API.",
"version": "1.2.5",
"project_urls": {
"Documentation": "https://docs.livekit.io",
"Source": "https://github.com/livekit/agents",
"Website": "https://livekit.io/"
},
"split_keywords": [
"audio",
" gladia",
" livekit",
" realtime",
" speech-to-text",
" video",
" webrtc"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "dcbdedb6926b55fb0d4a6816650224811aac6a789a8fa2fbac940809203daf9d",
"md5": "5b606678e98720599cfecba86ba01531",
"sha256": "6bbf0311d288919e99b448e20221c1775551bcccb3cc3bc7afaa1f6d8784997e"
},
"downloads": -1,
"filename": "livekit_plugins_gladia-1.2.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5b606678e98720599cfecba86ba01531",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9.0",
"size": 14654,
"upload_time": "2025-08-10T10:21:47",
"upload_time_iso_8601": "2025-08-10T10:21:47.740585Z",
"url": "https://files.pythonhosted.org/packages/dc/bd/edb6926b55fb0d4a6816650224811aac6a789a8fa2fbac940809203daf9d/livekit_plugins_gladia-1.2.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "0f11fa417daeaa6953e69621278f51d2dd36a6d0d2a84adef7f5df63a6e8ffbe",
"md5": "08c3ac031071423e57e57a9b888a1c18",
"sha256": "8538e816b912be693ae1c80d1604caaf2e09575ca949e751dcd4cbade26a7cc8"
},
"downloads": -1,
"filename": "livekit_plugins_gladia-1.2.5.tar.gz",
"has_sig": false,
"md5_digest": "08c3ac031071423e57e57a9b888a1c18",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9.0",
"size": 13993,
"upload_time": "2025-08-10T10:21:48",
"upload_time_iso_8601": "2025-08-10T10:21:48.784693Z",
"url": "https://files.pythonhosted.org/packages/0f/11/fa417daeaa6953e69621278f51d2dd36a6d0d2a84adef7f5df63a6e8ffbe/livekit_plugins_gladia-1.2.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-10 10:21:48",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "livekit",
"github_project": "agents",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "livekit-plugins-gladia"
}