> ## Documentation Index
> Fetch the complete documentation index at: https://assemblyai.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Optimizing Accuracy and Latency

> Tune streaming models to balance transcription accuracy and latency.

## Mode

Streaming workloads sit on a spectrum between two competing goals: returning transcripts as fast as possible, and returning the most accurate transcripts possible. To make this tradeoff explicit, every streaming model supports a **mode** connection parameter you can set when opening a streaming session. On AssemblyAI-STT-3.7-Realtime, turn detection is tuned for transcript segmentation rather than voice-agent turn-taking (see [Turn detection on AssemblyAI-STT-3.7-Realtime](https://assemblyai.com/docs/streaming/turn-detection.md#turn-detection-on-assemblyai-stt-3-7-realtime)).

| Mode | Value | When to use |
| - | - | - |
| Min latency | `min_latency` | Lowest possible time-to-text. Best when responsiveness matters more than catching every word. |
| Balanced (default) | `balanced` | A middle ground between latency and accuracy. Best for voice agents and other interactive applications. |
| Max accuracy | `max_accuracy` | Highest transcription accuracy. Best for note-taking, scribes, and post-call analysis where a small added delay is acceptable. |
| Manual | `manual` | Your client decides when each turn ends by sending `ForceEndpoint`; punctuation never ends a turn. Best when you run your own VAD, push-to-talk, or turn detection model. AssemblyAI-STT-3.7-Realtime-Agent only. See [Manual mode](https://assemblyai.com/docs/streaming/turn-detection.md#manual-mode). |

Set the `mode` connection parameter when you open the WebSocket.

> [tab] Python
>
> ```python theme={null}
> CONNECTION_PARAMS = {
>     "sample_rate": 16000,
>     "speech_model": "assemblyai-stt-3-7-realtime-agent",
>     "mode": "balanced",  # min_latency | max_accuracy | manual
> }
> ```

> [tab] Python SDK
>
> ```python theme={null}
> client.connect(
>     RealTimeParameters(
>         sample_rate=16000,
>         speech_model="assemblyai-stt-3-7-realtime-agent",
>         mode="balanced",  # min_latency | max_accuracy | manual
>     )
> )
> ```

> [tab] Javascript
>
> ```javascript theme={null}
> const CONNECTION_PARAMS = {
>   sample_rate: 16000,
>   speech_model: "assemblyai-stt-3-7-realtime-agent",
>   mode: "balanced", // min_latency | max_accuracy | manual
> };
> ```

> [tab] JavaScript SDK
>
> ```javascript theme={null}
> const transcriber = client.streaming.transcriber({
>   sampleRate: 16_000,
>   speechModel: "assemblyai-stt-3-7-realtime-agent",
>   mode: "balanced", // min_latency | max_accuracy | manual
> });
> ```

## Language selection

By default, streaming is multilingual and code-switches natively across all supported languages with no configuration. When you know which languages a session will use, pass the `language_codes` connection parameter to steer the model toward them and improve language accuracy.

* For a **known subset**, pass the codes you expect (for example, `["en", "es"]`). The model still code-switches, but heavily biased to the languages you list.
* For a **monolingual session**, pass a single-element list (for example, `["es"]`).
* For **full multilingual**, omit `language_codes` to keep native code switching.

See [Multilingual transcription](https://assemblyai.com/docs/streaming/multilingual-transcription.md) for the full feature guide, including supported languages, language detection, and updating `language_codes` mid-stream.

## Turn detection

The model detects the end of a turn using the transcript rather than silence alone. The `mode` preset sets the defaults, and every turn detection parameter can be overridden on the connection or updated mid-stream to tune endpointing for your use case.

* Raise `min_turn_silence` when brief pauses end turns too early, for example while a caller dictates a phone number. Raise `max_turn_silence` when you expect longer pauses within a turn.
* Lower `vad_threshold` when quiet speech is missed. When background noise causes false interruptions, raise `vad_threshold`, increase `interruption_delay`, or enable [Voice Focus](https://assemblyai.com/docs/streaming/voice-focus.md).

See [Turn detection](https://assemblyai.com/docs/streaming/turn-detection.md) for the full feature guide, including the turn lifecycle, entity capture, and bringing your own turn detection.
