# 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/c9/c1/c2a5f9ff71e32c2d9680a859aa93fb52c901486e81c6f738cea90b4982aa/livekit_plugins_gladia-1.2.7.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.7",
"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": "ddf972f8ffd069d13fd2dc8ca0f9a55135342c457f0bdb44fe337137f7b2d141",
"md5": "4654448e1c11c746189905499b4e8809",
"sha256": "8961398673a2fe2c6438541ff0336f42a88220066f3beb6173f556c94e122e5c"
},
"downloads": -1,
"filename": "livekit_plugins_gladia-1.2.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4654448e1c11c746189905499b4e8809",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9.0",
"size": 14657,
"upload_time": "2025-08-28T00:54:50",
"upload_time_iso_8601": "2025-08-28T00:54:50.979327Z",
"url": "https://files.pythonhosted.org/packages/dd/f9/72f8ffd069d13fd2dc8ca0f9a55135342c457f0bdb44fe337137f7b2d141/livekit_plugins_gladia-1.2.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "c9c1c2a5f9ff71e32c2d9680a859aa93fb52c901486e81c6f738cea90b4982aa",
"md5": "ea5a13174d92be5c2b1bbdf58d73c1f2",
"sha256": "5dc9b0bf051cb7b5196c7dba3a113ba7c8f7f3d21d1096a6a14c8264acd28393"
},
"downloads": -1,
"filename": "livekit_plugins_gladia-1.2.7.tar.gz",
"has_sig": false,
"md5_digest": "ea5a13174d92be5c2b1bbdf58d73c1f2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9.0",
"size": 13991,
"upload_time": "2025-08-28T00:54:52",
"upload_time_iso_8601": "2025-08-28T00:54:52.212289Z",
"url": "https://files.pythonhosted.org/packages/c9/c1/c2a5f9ff71e32c2d9680a859aa93fb52c901486e81c6f738cea90b4982aa/livekit_plugins_gladia-1.2.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-28 00:54:52",
"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"
}