> ## 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.

# MiniCPM-o 4.5

> Get a spoken answer about a picture or recording on one NVIDIA GPU.

MiniCPM-o 4.5 generates a text or spoken response to text, an image or an audio clip. Use the native API or the Python SDK.

## Install and start

The default runs three workers on one NVIDIA GPU with MPS. An offline cache must contain the vocoder files in `assets/token2wav/`, including `flow.pt` and `hift.pt`. Populate the full snapshot before starting.

### `minicpm_o`

Text, image, audio → text, audio. The default `minicpm_o.yaml` uses 1 GPU. Beta. The [weights](https://huggingface.co/openbmb/MiniCPM-o-4_5) use Apache-2.0.

```bash theme={null}
uv pip install --torch-backend=auto "mstar-ai[minicpm_o]"
mstar serve minicpm_o
```

[Send the request](#spoken-reply).

## Send a request

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

### Ask for a spoken reply

Save a picture as `scene.png`. The SDK prints the transcript and writes a WAV. curl saves the accompanying PCM.

**Python SDK**

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

client = MStarClient("http://localhost:8000")
reply = client.generate(
    text='Describe this picture in one sentence.',
    images='scene.png',
    input_modalities=('image', 'text'),
    output_modalities=('text', 'audio'),
)
reply.audio.to_wav("reply.wav")
print(reply.text)
```

**curl**

```bash theme={null}
curl -fsS http://localhost:8000/generate \
  --form-string 'text=Describe this picture in one sentence.' \
  -F files=@scene.png \
  --form-string input_modalities=image,text \
  --form-string output_modalities=text,audio \
  --form-string streaming=false \
  | python3 -c '
import base64, json, sys

outputs = json.load(sys.stdin)["outputs"]
with open("reply.pcm", "wb") as file:
    for chunk in outputs["audio"]:
        file.write(base64.b64decode(chunk["data"]))
'
```

## Deployment configs

| File | GPUs | Parallelism | When to use |
| - | - | - | - |
| `configs/minicpm_o.yaml` | 1 | three workers with `mps: true` | The only shipped config: the LLM and encoders, the TTS, and the vocoder each have a worker, so the vocoder's steps don't hold up the TTS's decode. |

It caps `max_concurrent_requests` at 32 and gives the LLM's KV pool 512 host pages (`cpu_offload_pages`), so a full pool moves a request to the host instead of stalling.

## Settings and defaults

Request knobs in `model_kwargs`:

| Knob | Default | Effect |
| - | - | - |
| `voice` | `default` | The single bundled voice produces 24 kHz audio. |
| `voice_prompt` | `true` | A spoken reply's system message is upstream's voice-clip prompt. `false` leaves the clip out and uses `system_prompt` instead; the reply is still spoken in the voice. |
| `system_prompt` | | Your own system message. With speech output it needs `voice_prompt: false`. |
| `enable_thinking` | `false` | Passed to the checkpoint's chat template as `enable_thinking`. |
| `max_slice_nums` | 9 | Most slices an image is cut into, 1 to 9. |
| `temperature`, `top_p`, `top_k`, `repetition_penalty` | 0.7, 0.8, 100, 1.02 | Upstream `chat()`'s recipe, kept over the checkpoint's file. |

Deployment keys: each spoken reply holds a slot of each `t2w_*` resource while it speaks, so their `max_slots` cap the replies voiced at once. `t2w_conv`, `t2w_vocoder` and `t2w_tail` each have one more slot than each `t2w_*_kv` (their sink), and startup refuses counts that disagree. Startup also refuses a `tts_kv` pool that cannot hold `max_concurrent_requests` full replies.

## Limits

* No OpenAI routes; see [No OpenAI adapter](https://docs.m-star.org/models.md#no-openai-adapter).
* A spoken request with a system prompt of its own is a 400 unless it sets `voice_prompt: false`.
* Video input, upstream's `streaming_generate` and full duplex are not supported.
* `mps: true` is refused off NVIDIA.


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