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

# On-premises

> Run Umay STT and Ses TTS on your own servers

Umay and Ses also run on your own servers, as Docker images, with the same API as the hosted service. Audio and text then never leave your network, and the containers need no internet connection while they run.

> [!NOTE]
>
> On-premises needs a licence. We share the images with you: access to our registry, or files for servers without internet.

## Images

| Service | Image | Languages |
| - | - | - |
| Umay STT | `umay` | `tr`, `en`, `de`, `fr`, `es`, `it`, `ru` |
| Ses TTS | `ses` | `tr`, `en`, `de`, `fr`, `es`, `it`, `ru` |
| Mihu gateway | `gateway` | in front of both: keys, TLS, load balancing, scaling |

We send you the full image names and the version to use. Both services run on CPU; no GPU is needed. The server size depends on how many calls you run at once; we size it with you and set the services up for your load.

## Install

`.env` (the image names and versions are the ones we shared with you):

```bash theme={null}
UMAY_IMAGE=<shared with you>
UMAY_TAG=<version>
SES_IMAGE=<shared with you>
SES_TAG=<version>
MIHU_SES_API_KEY=<a long random key>                   # openssl rand -hex 32
```

`docker-compose.yml`:

```yaml theme={null}
services:
  umay:
    image: ${UMAY_IMAGE}:${UMAY_TAG}
    ports: ["8080:8080"]
    restart: unless-stopped

  ses:
    image: ${SES_IMAGE}:${SES_TAG}
    ports: ["8081:8080"]
    environment:
      MIHU_SES_API_KEY: ${MIHU_SES_API_KEY}    # every request then needs "Authorization: Bearer <key>"
    volumes:
      - voices:/data/voices                    # custom voices: keep this volume and back it up
    restart: unless-stopped

volumes:
  voices:
```

```bash theme={null}
docker compose up -d
curl -s http://localhost:8080/health                   # Umay
curl -s http://localhost:8081/health                   # Ses
```

## Gateway

For production, the Mihu gateway is provided with Umay and Ses and runs in front of them, as on our own servers. We set it up with you, to your needs. It gives you:

* **API keys per application or team.** Each key is its own tenant: custom voices of one tenant are not visible to another, and limits apply per tenant.
* **TLS**, WebSocket and streaming without buffering.
* **Several Umay and Ses servers** behind one address: each request goes to the least-loaded healthy server; a server that fails is skipped.
* **Scaling** on CPU and utilization (next section). Audio, text and keys are never logged.

## Scaling

The gateway watches every server pool all the time. Based on CPU and utilization, servers join and leave on demand: a new server registers itself with the gateway (for example with `mgw-agent -register`) and starts taking requests without a restart; a server that leaves is drained first, so running calls are not cut. The gateway tells your autoscaler (Kubernetes, a script, your cloud) when to add or remove servers, by webhook, Slack or e-mail:

| Signal | Fires when (example) | Your action |
| - | - | - |
| `capacity.high` | utilization ≥ 80 %, or CPU ≥ 85 %, or at least one refused request, for 5 minutes | add servers; the signal says how many (to reach 70 % utilization) |
| `capacity.high.resolved` | the above is false for 10 minutes | none |
| `capacity.idle` | utilization ≤ 10 % and CPU ≤ 20 %, for 1 hour | drain and remove servers |
| `pool.down` | no healthy server for 1 minute | check the servers |

The trigger points are adjusted to your setup on request.

## Use it

Every example in these docs works with your address in place of ours:

| Hosted | On your server |
| - | - |
| `https://stt.eu.mihu.ai/v1` | `http://<umay-host>:8080/v1` |
| `wss://stt.eu.mihu.ai/v1/realtime` | `ws://<umay-host>:8080/v1/realtime` |
| `https://tts.eu.mihu.ai/v1` | `http://<ses-host>:8081/v1` |
| `https://tts.eu.mihu.ai/v1/audio/speech` (streamed) | `http://<ses-host>:8081/v1/audio/speech` (streamed) |

TTS streams over the same `POST /v1/audio/speech`: the audio comes in the answer while it is generated (see [Text to speech](https://developers.mihu.ai/tts/speech.md#streaming)).

```python theme={null}
# LiveKit Agents in the same compose network (see LiveKit and Pipecat for the whole example)
stt = openai.STT(base_url="http://umay:8080/v1", api_key=os.environ["MIHU_STT_KEY"], model="umay", language="tr", use_realtime=True)
tts = openai.TTS(base_url="http://ses:8080/v1", api_key=os.environ["MIHU_SES_API_KEY"], model="mihu-ses-v1",
                 voice="alp", response_format="pcm")
```

See [LiveKit and Pipecat](https://developers.mihu.ai/guides/voice-frameworks.md) for the whole example.

## Updates

New versions are published; nothing changes on your server until you update. To update, set the new tag in `.env`, then:

```bash theme={null}
docker compose pull && docker compose up -d
```

The service is back in 1–2 minutes, while the models load. Custom voices stay in the `voices` volume.


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