SLM Voice Agent
Conversational voice assistant powered by local ONNX Speech-to-Text (STT) and Text-to-Speech (TTS) models with real-time barge-in capability.
๐ Overview & Capabilities
Conversational voice assistant powered by local ONNX Speech-to-Text (STT) and Text-to-Speech (TTS) models with real-time barge-in capability.
Key Features
- Offline Speech-to-Text (STT) transcription
- Multilingual Text-to-Speech (TTS) synthesis (English, Hindi, Tamil, Telugu)
- Real-time audio stream barge-in interrupt detection
- Sub-50ms CPU synthesis latency
๐ป Installation
Install the local package using pip:
๐ Checkout from GitHub
Clone only this agent's folder from the monorepo using Git sparse-checkout โ no need to download the full repository:
Option 1 โ Sparse Checkout (Recommended)
Option 2 โ Full Repository Clone
๐ก Tip: After checkout, install the package locally with pip install -e ./slm_voice to run in editable mode without publishing to PyPI.
โ๏ธ Configuration API
Constructor Parameters
Instantiate SLMVoiceAgent with performance and runtime options:
| Parameter | Type / Default | Description |
|---|---|---|
stt_model_path | str | None | Path to local STT ONNX weights. Default: None. |
tts_model_path | str | None | Path to local TTS ONNX weights. Default: None. |
temperature | float | 0.7 | Sampling temperature for speech synthesis. Default: 0.7. |
top_p | float | 0.9 | Nucleus sampling cutoff threshold. Default: 0.9. |
max_tokens | int | 256 | Maximum output token generation limit per response. Default: 256. |
cache_dir | str | None | Local directory for caching model weights. Default: None. |
n_threads | int | 4 | Number of CPU threads for inference. Default: 4. |
Methods
| Method Signature | Return Type | Description |
|---|---|---|
process_speech_text(speech_transcript, ...) | dict | Transcribes audio input or processes text transcript and returns synthesized speech payload. |
Execution Parameters
Complete list of execution parameters accepted by the primary agent method:
| Parameter | Type / Default | Description |
|---|---|---|
speech_transcript | str | Input raw audio transcription string or speech input text. |
language | str | English | Target output synthesis language (English, Hindi, Tamil, Telugu). Default: English. |
system_prompt | str | None | Custom system prompt instruction. Default: None. |
user_input | str | None | Optional additional contextual text keys. Default: None. |
temperature | float | 0.7 | Sampling temperature. Default: 0.7. |
top_p | float | 0.9 | Nucleus sampling probability. Default: 0.9. |
max_tokens | int | 256 | Maximum generation token limit. Default: 256. |
Quick Start
๐ Verified Output Logs
Diagnostic execution console output running locally on CPU: