aloof-forest-57428
11/30/2025, 3:57 PMtall-airline-16756
11/30/2025, 3:57 PMtall-airline-16756
11/30/2025, 3:57 PMen-IN) to improve recognition.
• Use Sarvam’s optimized real-time model (recommended saarika:v2.5) for lower latency and higher accuracy.
• If available, enable endpointing/turn-detection features in Sarvam so the agent knows when the speaker finished.
3) Turn detection & end-of-turn handling
• Use a reliable turn detector (e.g., LiveKit’s MultilingualModel) so you avoid cutting users off or waiting too long.
• Configure sensitivity so the detector favors not truncating user speech (slightly conservative end-of-turn) for confirmations.
4) Latency reduction techniques
• Enable preemptive generation so GPT‑4.0 can begin composing as partial transcription arrives.
• Co-locate your agent server with Sarvam and your LLM endpoint to reduce network RTT.
• Monitor Time‑To‑First‑Token (LLM) and TTFB (TTS) and optimize the slowest hop.
5) TTS behavior
• Use a clear, moderate-paced voice and short confirmation prompts to minimize synthesis time and improve listener comprehension.
• If possible, synthesize partial responses quickly (short confirmations) rather than long prompts.
6) Validation & observability
• Record and review traces for STT → LLM → TTS timing to find bottlenecks.
• Replay examples of confirmation flows to check accuracy and adjust prompt phrasing, STT model, or turn detector settings.
7) Safety & fallback
• If STT confidence is low, ask the confirmation once more in a short form or request a typed confirmation if the channel allows.
• For critical confirmations, require a second verification (different phrasing) or a follow-up short code readback.
If you want, I can:
• Suggest a short confirmation prompt template for your agent.
• Show example session config code for enabling preemptive generation + Sarvam STT settings.
Which would you like next?
Sources: Prompting guide | LiveKit docs | Sarvam STT plugin guide | LiveKit Docs | OpenAI TTS plugin guide | LiveKit docs | Agent speech and audio | LiveKit docs | LiveKit turn detector plugin | LiveKit docsaloof-forest-57428
11/30/2025, 4:00 PMtall-airline-16756
11/30/2025, 4:00 PM# Example: Sarvam STT session configuration (Python-style pseudocode)
from sarvam import STT
stt = STT(
model="saarika:v2.5", # low-latency, high-accuracy real-time model
language="en-IN", # set locale for better recognition
sample_rate=16000, # match common telephony/WebRTC rate
channel_count=1, # mono audio for voice calls
enable_endpointing=True, # detect end-of-turn to avoid cutting off user
endpoint_silence_ms=450, # consider speech ended after ~450ms silence
partial_results=True, # receive interim transcripts for preemptive LLM use
max_alternatives=3, # return top N hypotheses for higher confirmation accuracy
profanity_filter=False, # set per your use case
vad_mode="conservative", # voice activity detection mode; conservative avoids truncation
confidence_threshold=0.7 # use returned confidence to trigger re-confirmation if low
)
# Example usage (streaming):
for audio_chunk in microphone.stream():
resp = stt.stream_audio(audio_chunk)
if resp.partial:
handle_partial_transcript(resp.text)
if resp.final:
handle_final_transcript(resp.text, resp.confidence, resp.alternatives)
Notes:
• Use partial_results=True plus preemptive generation so GPT‑4 can start composing before final transcript arrives.
• Use max_alternatives and confidence_threshold to decide when to re-ask confirmations (e.g., if confidence < 0.7, prompt again).
• Tune endpoint_silence_ms and vad_mode based on call environment (noisy vs. quiet) to balance latency vs. truncation.
Want this in another language (Node/JS) or an exact API call for your setup?