# Self-hosted voice for your AI agents

You don't need a voice vendor to talk to an AI agent. Open models such as [Kokoro](https://huggingface.co/hexgrad/Kokoro-82M) for speech and Whisper for transcription run on an ordinary computer, and several open source servers put them behind the same API shape OpenAI uses. Point an agent at that server and no voice vendor ever hears you. The finished audio still goes to whichever device is listening.

[SFCrew](https://sfcrewai.com/) is an open source app for AI teammates that do real work. You talk to each bot in chat, and you can also talk to it by voice: hold the mic to speak, have replies read aloud, or call a bot in real time. Its **Self-hosted** voice option connects to any OpenAI-compatible speech server you run, so a [self-hosted SFCrew](https://sfcrewai.com/self-hosted-ai-agent/) can have voice with no hosted service at all.

Updated November 4, 2026.

## What is a self-hosted speech server?

It's a small web service on a machine you control that answers OpenAI's audio API: `POST /v1/audio/speech` turns text into audio and `POST /v1/audio/transcriptions` turns audio into text. Because the shape is shared, one client works with many servers and models.

[Kokoro-FastAPI](https://github.com/remsky/Kokoro-FastAPI) serves the Apache-licensed Kokoro-82M model and only speaks. [Speaches](https://github.com/speaches-ai/speaches) does both, with faster-whisper for transcription and Kokoro or Piper for speech. [mlx-audio](https://github.com/Blaizzy/mlx-audio) runs Kokoro and Whisper on Apple Silicon. SFCrew's default model names match mlx-audio's.

## What you can do with self-hosted voice in SFCrew

SFCrew sends both speech and transcription to the one **Server URL** you enter. If that server does both, you get every voice feature in the [voice and calls guide](https://sfcrewai.com/docs/voice-and-calls/).

- Talk instead of typing. Hold the mic in the composer and your server transcribes what you say.
- Hear replies. Choose **Speak this reply** on a message, or turn on **Read replies aloud** in a bot's settings.
- Call a bot with **Call** at the top of the chat, or let a bot call you, for example when you ask it to call you at 5.
- Pick a voice from the server's own list. Kokoro voices show their language, and SFCrew passes that language to the server so a French voice reads with French pronunciation.

## When to choose self-hosted voice

Choose it when you don't want a hosted vendor to process your voice, when you want voice with no vendor account, or when you already run local models. It pairs naturally with a [self-hosted SFCrew](https://sfcrewai.com/self-hosted-ai-agent/) and a local model, so the whole assistant can work offline.

Hosted providers are less work and usually sound more polished. [ElevenLabs](https://sfcrewai.com/voice-providers/elevenlabs/) and [Fish Audio](https://sfcrewai.com/voice-providers/fish-audio/) offer cloning, [OpenAI](https://sfcrewai.com/voice-providers/openai/) reuses a key you may already have, and [Cartesia](https://sfcrewai.com/voice-providers/cartesia/) is tuned for low latency. If SFCrew runs directly on a Mac, [macOS voices](https://sfcrewai.com/voice-providers/macos/) speak with nothing to install, but don't transcribe. See the [comparison](https://sfcrewai.com/voice-providers/) for all six.

## Limits and network rules

- Quality and speed depend on your models and hardware. Whisper on a CPU can be slow on a call.
- A speech-only server such as Kokoro-FastAPI can't transcribe. Use a server that does both if you want to hold the mic or make calls.
- Addresses on your own network, `localhost` and `host.docker.internal` are refused unless the server sets `MCP_ALLOW_PRIVATE_ENDPOINT=true` on the API and worker. That setting applies to every user, so leave it off on a public install.
- A hostname that resolves to a private address must also be listed in `SFCREW_OPENAI_COMPAT_PRIVATE_HOSTS`. Cloud metadata and link-local addresses are always blocked.
- A public address must use HTTPS if you add an API key. Setting `SFCREW_OPENAI_COMPAT_ALLOW_PUBLIC=0` blocks public servers, and hides the option if private ones aren't allowed either.
- On the mobile app, calls can use your phone's own voices if you pick a **Device voice** in the bot's settings. Otherwise replies use this provider.

## How to set it up

Whoever runs the SFCrew server allows the address once; then each person connects in the app. The [self-hosted model settings](https://sfcrewai.com/docs/self-host-models/) cover the network options in full.

1. Start a speech server, for example the Kokoro-FastAPI Docker image, Speaches, or `mlx_audio.server` on a Mac.
2. On the SFCrew API and worker, set `MCP_ALLOW_PRIVATE_ENDPOINT=true` for a server on your network, and `PHONE_CALLS_ENABLED=true` to turn on hold-to-talk and calls. Restart them.
3. Open **Settings → Voice**, set **Provider** to **Self-hosted** and enter the **Server URL**, such as `http://192.168.1.10:8880/v1`. SFCrew adds `/v1` if you leave it off. If SFCrew runs in Docker and the speech server is on the same machine, use `host.docker.internal` instead of `localhost`.
4. Add an **API key** only if your server needs one. Change **Speech model** and **Transcription model** if your server uses other names; Kokoro-FastAPI expects `kokoro`.
5. Choose **Connect**, pick a **Voice** and choose **Hear a sample**.

## FAQ

### Can I use Kokoro TTS with an AI agent?

Yes. Run Kokoro behind an OpenAI-compatible server such as Kokoro-FastAPI, Speaches or mlx-audio, then enter its URL under **Self-hosted** in SFCrew's voice settings. SFCrew lists the Kokoro voices and reads replies with the one you pick.

### Can I use a local Whisper server for speech to text?

Yes, if it answers `/v1/audio/transcriptions` the way OpenAI does. Speaches and mlx-audio both do. Set **Transcription model** to the model name your server expects.

### Does self-hosted voice work offline?

Voice does: speech and transcription go only to your server. For a fully offline assistant, also self-host SFCrew and use a local language model.

### Why can't SFCrew reach my speech server on localhost?

Private addresses are refused until the server sets `MCP_ALLOW_PRIVATE_ENDPOINT=true` on the API and worker. If SFCrew runs in Docker, `localhost` is the container itself, so use `host.docker.internal` or the machine's network address.

## More voice providers for AI agents

- [Compare all voice providers](https://sfcrewai.com/voice-providers/)
- [ElevenLabs](https://sfcrewai.com/voice-providers/elevenlabs/): The most natural voices, including ones you clone
- [OpenAI](https://sfcrewai.com/voice-providers/openai/): Reusing an OpenAI key you already have
- [Cartesia](https://sfcrewai.com/voice-providers/cartesia/): Fast, natural voices on calls
- [Fish Audio](https://sfcrewai.com/voice-providers/fish-audio/): Expressive voices and your own cloned voice
- [macOS voices](https://sfcrewai.com/voice-providers/macos/): Running SFCrew on a Mac with no voice key

## Sources

- [Kokoro-FastAPI](https://github.com/remsky/Kokoro-FastAPI)
- [Kokoro-82M model](https://huggingface.co/hexgrad/Kokoro-82M)
- [Speaches](https://github.com/speaches-ai/speaches)
- [mlx-audio](https://github.com/Blaizzy/mlx-audio)
- [SFCrew, voice and calls](https://github.com/Isuhail29/sfcrew-ai/blob/main/docs/voice-and-calls.md)
- [SFCrew, self-hosted voice settings](https://github.com/Isuhail29/sfcrew-ai/blob/main/docs/self-host-models.md#voice)
