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

# Latency & quality (NFE)

> Tune the nfe dial and understand cold starts.

Two things dominate how fast you get audio and how good it sounds: the **`nfe`** setting and **cold starts**.

## `nfe` — the quality/speed dial

`nfe` (number of function evaluations) is how many diffusion steps the model runs. More steps = better quality, more time.

| `nfe`          | Use it for                                                          |
| -------------- | ------------------------------------------------------------------- |
| `16`           | Low-latency / interactive — noticeably faster, very usable quality. |
| `32` (default) | Best quality — narration, published audio, anything you'll ship.    |

```ts theme={null}
await geko.tts.create({ text, voice: "Aigerim", nfe: 16 }); // snappy
await geko.tts.create({ text, voice: "Aigerim", nfe: 32 }); // polished
```

Rule of thumb: start at `32`; drop to `16` when responsiveness matters more than the last bit of fidelity.

## Cold starts

The GPU backend **scales to zero when idle** to save cost. Consequences:

* The **first** request after an idle period pays a cold start — this can be tens of seconds.
* After a request, the service stays **warm for a few minutes**, so follow-up calls are fast.
* The SDK's default **120 s** timeout is sized for this. Don't lower it below what a cold start needs unless you know the service is warm.

<Tip>
  **Keeping it warm:** if you have predictable traffic, a lightweight periodic `geko.health()` (or a pre-warm call before a known burst) keeps a container hot. Always-on warmth is a server-side deployment choice.
</Tip>

## Other factors

* **Text length.** Longer text = longer synthesis (roughly linear). Break very long inputs into sentences/paragraphs and synthesize in parallel if you need throughput.
* **`speed`.** Changes playback pace (0.5–2), not generation time.
* **Concurrency.** Independent requests run concurrently; the SDK doesn't serialize them.

## Measuring

Time a warm call end-to-end:

```ts theme={null}
const t = performance.now();
await geko.tts.create({ text: "Сәлем", voice: "Aigerim", nfe: 16 });
console.log(`${Math.round(performance.now() - t)}ms`);
```

Run it twice — the second number (warm) is the one your users will usually see.

## Next steps

<CardGroup cols={2}>
  <Card title="Streaming" icon="waveform-lines" href="/guides/streaming">
    Start playback sooner by synthesizing sentence-by-sentence.
  </Card>

  <Card title="Voice agents" icon="phone" href="/guides/voice-agents">
    Wire low-latency TTS into a real-time voice loop.
  </Card>

  <Card title="Limits & constraints" icon="gauge-high" href="/limits">
    Text limits, output format, and cold starts.
  </Card>
</CardGroup>
