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

# OmniVoice

> Install the separate runtime and generate multilingual speech with a designed or cloned voice.

OmniVoice supports speech synthesis in more than 600 languages. It can pick a voice, construct one from a description, or clone a speaker. Its output is 24 kHz.

## Install and start

The PyPI release lacks the required `omnivoice_flashinfer` module. Install the git package in a separate environment with transformers 5.3 or later. Verify it with `python -c "import omnivoice.models.omnivoice_flashinfer"`.

### `omnivoice`

Text, audio → audio. The default `omnivoice.yaml` uses 1 GPU. The [weights](https://huggingface.co/k2-fsa/OmniVoice) use CC-BY-NC.

```bash theme={null}
uv pip install --torch-backend=auto "mstar-ai[omnivoice]"
uv pip install --torch-backend=auto "git+https://github.com/k2-fsa/OmniVoice.git"
mstar serve omnivoice
```

[Send the request](#synthesize).

## Send a request

Run either client example in a second terminal after `/health` returns 200.

### Synthesize a sentence

Save the synthesized speech as `reply.wav`.

**Python SDK**

```python theme={null}
from mstar import MStarClient

client = MStarClient("http://localhost:8000")
reply = client.tts(
    'The next stop is Central.',
)
reply.to_wav("reply.wav")
```

Supply `reference_audio` and `ref_text` to clone a voice.

**curl**

```bash theme={null}
curl -fsS http://localhost:8000/v1/audio/speech \
  -H 'Content-Type: application/json' \
  -d '{"input": "The next stop is Central.", "response_format": "wav"}' -o reply.wav
```

## Deployment configs

| File | GPUs | Layout | Use |
| - | - | - | - |
| `omnivoice.yaml` | 1 | Reference encoder, backbone and codec decode on one worker | Default |
| `omnivoice_split.yaml` | 1 | Codec decode on a second worker on GPU 0, `mps: true` | The unmask loop no longer stops for each finished request's decode |

`mps: true` needs `nvidia-cuda-mps-control` on `PATH`.

To use an alternative, pass `--config configs/<file>` after the launcher name. From a wheel installation, [copy the shipped YAML](https://docs.m-star.org/serving.md#custom-configs) and pass its local path.

## Settings and defaults

Request fields (on `/v1/audio/speech`, all but `instructions`, `voice`, `speed` and `seed` go in `extra_body`):

| Field | Default | Effect |
| - | - | - |
| `language` | none | A name (`Vietnamese`) or an id (`vi`). An unrecognized value warns and falls back to language-agnostic mode. |
| `instructions`, `voice` | none | Voice description (`instruct` on `/generate`). On `/v1/audio/speech`, `voice` supplies the description when no instruction is set. |
| `ref_audio`, `ref_text` | none | Clone a voice. `ref_text` is required with the clip. |
| `speed` | 1.0 | Scales the estimated duration. |
| `duration` | estimated | Target length of the speech in seconds. |
| `num_step` | 32 | Unmasking steps. |
| `guidance_scale` | 2.0 | Classifier-free guidance; 0 turns it off. |
| `t_shift` | 0.1 | Must be above 0. |
| `position_temperature`, `class_temperature` | 5.0, 0.0 | Which cell is revealed next, and which token. 0 is argmax. |

Deployment settings:

| Knob | Default | Effect |
| - | - | - |
| `model_kwargs.backbone_graphs` | `true` | `false` runs the backbone's layer loop eagerly instead of replaying captured graphs. |
| `prefill_token_buckets: {backbone: {backbone_layers: [...]}}` | up to 8192 tokens | The packed-token buckets captured for the backbone; larger steps run eagerly. See [Config files](https://docs.m-star.org/serving.md#config-files). |

## Limits

* No built-in speakers.
* A request whose estimated speech is over 30 s is a 400. Split the text or pass a shorter `duration`.
* `num_step` may be at most 64.
* `temperature` and `top_p` are not mapped: OmniVoice ranks the whole canvas by confidence instead of sampling one token per position.
* Logits match the reference to half-precision rounding, not bit for bit.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.