Open full-duplex voice models that hear your tone and speak with one. One GPU with vLLM-Omni, or fully offline on a Mac with MLX. Zero-shot voice cloning, OpenAI Realtime / GPT-Live compatible, free hosted API trial. Apache-2.0.
Python apple-siliconfull-duplexlivekitmacosmlxofflineopen-sourceopenai-realtimeparalinguisticspipecatrealtimespeechspeech-to-speechttsvllmvllm-omnivoice-assistantvoice-cloningzero-shot
README: lead with what it can do; fold the build comparison and the one-command scripts
Claude2debdd1bcd28
diff --git a/README.md b/README.mdindex 3dfba5a..25713f4 100644--- a/README.md+++ b/README.md@@ -95,49 +95,14 @@ https://github.com/user-attachments/assets/1d9442ef-84b0-45a3-acd4-2d05a9562397Every release, including fixes: [CHANGELOG](CHANGELOG.md) · [GitHub Releases](https://github.com/adventists-ai/sophon-realtime/releases)-## Three builds, one brain+## What you can do with it-All three builds share the same brain: one 32B model that listens to your voice, decides when you have finished, and writes the reply. They differ only in **how the reply becomes sound**.--| | **Tag** (recommended) | **Flash** | **E2E** |-|---|---|---|---|-| How it speaks | The brain writes the reply with sound tags (`[laughter]`, `[sigh]`, `<strong>…</strong>` …); an expressive speech model performs them | Same tagged reply, spoken by a lighter, faster speech model (one forward pass per 80 ms frame) | No speech-token model: a compact talker (about 350M parameters) reads the tagged reply as it is written and generates continuous voice vectors directly; a decoder turns them into sound |-| Best for | Expressive voice: companions, characters, demos | Speed and scale: customer service, in-car, many users per GPU | Expressive voice with the fastest first audio; our own engine, easy to modify |-| Non-verbal sounds (NVV-SuperBench, en / zh) | **0.80 / 0.86** | 0.63 / 0.77 | 0.75 / 0.85 |-| First audio, one user | ~0.45 s | **0.22 s** | **~0.25 s** |-| Users per 80 GB GPU (recommended) | 16 | **40** | 16 |-| Zero-shot voice cloning | **yes**, from a 3–10 s clip ([how](tag/README.md#zero-shot-voice-cloning)) | **yes**, from a 3–10 s clip ([how](flash/README.md#zero-shot-voice-cloning)) | **yes**, from a 5–12 s clip ([how](e2e/README.md#zero-shot-voice-cloning-new-in-130)) |-| GPUs | **1** × 80 GB | **1** × 80 GB | **1** × 80 GB |-| Serving | vLLM-Omni, one command | vLLM-Omni, one command | own engine or vLLM-Omni, one command |-| Weights | [HF](https://huggingface.co/adventists-ai/Sophon-Realtime-v1) · [ModelScope](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-32B-Tag) | [HF](https://huggingface.co/adventists-ai/Sophon-Realtime-32B-Flash) · [ModelScope](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-32B-Flash) | [HF](https://huggingface.co/adventists-ai/Sophon-Realtime-32B-E2E) · [ModelScope](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-32B-E2E) |-| Code | [`tag/`](tag/README.md) | [`flash/`](flash/README.md) | own engine: [`docs/deploy.md`](docs/deploy.md) · vLLM-Omni: [`e2e/`](e2e/README.md) |--**Which one?** Start with **Tag** if you want the voice to act. Pick **Flash** if the number of users per GPU matters most. Pick **E2E** for the fastest first audio with a voice that still laughs and sighs. Tag and Flash share the same APIs, so you can switch later; E2E runs on its own engine or, since 1.1.4, on vLLM-Omni with the same APIs as Tag and Flash.--### 4B builds--The same three builds with a 4B brain ([DuplexJev-4B-Para](https://huggingface.co/adventists-ai/DuplexJev-4B-Para) with a tag-writing adapter), for one consumer GPU. The speech stages and voices are the same as in the 32B builds; there is no image input.--| | **Tag-4B** | **Flash-4B** | **E2E-4B** |-|---|---|---|---|-| GPU | one 32 GB (uses ~27 GB) | one 24 GB (uses ~21 GB) | one 32 GB (uses ~31 GB) |-| Full-Duplex-Bench v1.0 (4-task avg; 32B: 97.3) | 98.2 | 96.3 | 98.6 |-| First audio, one user (RTX PRO 6000) | 0.40 s | 0.21 s | 0.31 s |-| Install | `SIZE=4B bash install.sh` | `bash install.sh` + [weights](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-4B-Flash) | `SIZE=4B bash install.sh` |-| Weights | [HF](https://huggingface.co/adventists-ai/Sophon-Realtime-4B-Tag) · [ModelScope](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-4B-Tag) | [HF](https://huggingface.co/adventists-ai/Sophon-Realtime-4B-Flash) · [ModelScope](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-4B-Flash) | [HF](https://huggingface.co/adventists-ai/Sophon-Realtime-4B-E2E) · [ModelScope](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-4B-E2E) |--The 4B brain keeps the conversation skills (turn-taking, back-channels, barge-in, sound tags at the same rate as the reference data) but knows and reasons much less: VoiceBench 62.4 (32B: 82.8), Big Bench Audio 44.3% (32B: 81.8%). Use it for local demos, companions and characters, and turn-taking research; use 32B or the [hosted API](https://api.adventists.ai/console/) when answers must be right. **The 4B builds do not support tool calling** (it answers instead of calling the tool; see [#20](https://github.com/adventists-ai/sophon-realtime/issues/20)); for tools and Live mode delegation, use a 32B build. `start.sh` sees a 4B model and picks its config.--#### Smaller machines--| | **Tag-4B-W4** | **Mac 4B** (Flash-4B on MLX) |-|---|---|---|-| Runs on | one 24 GB GPU (RTX 4090 / 3090 class; uses ~21 GB) | an Apple silicon Mac with 16 GB or more (uses ~11 GB) |-| What changes | the brain's language model in 4 bits (GPTQ W4A16); speech, sound tags and speed as Tag-4B | the brain's language model in 8 bits; starts speaking 0.3–0.5 s after you stop (M4 Max) |-| Install | `SIZE=4B-W4 bash install.sh` in `tag/` | `SIZE=4B bash mac/install.sh` |-| Weights | [HF](https://huggingface.co/adventists-ai/Sophon-Realtime-4B-Tag-W4) · [ModelScope](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-4B-Tag-W4) | [HF](https://huggingface.co/adventists-ai/Sophon-Realtime-4B-Flash-MLX) · [ModelScope](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-4B-Flash-MLX) |--Both were measured with memory held to the target (an H100 with the 24 GB budget; an M4 Max with MLX capped at what a 16 GB Mac gives the GPU), not yet on a physical 24 GB card or 16 GB Mac: reports are welcome. Comparisons with the full-precision builds are on the model cards.+- **Talk to it in your language**: Chinese and English, plus Italian, German, Spanish, French, Portuguese and Japanese. [Languages](#languages)+- **Give it your own backend**: it keeps talking while your system looks things up or takes actions, then says the result; drop-in for OpenAI GPT-Live. [Live mode](#live-mode-openai-gpt-live-compatible)+- **Give it any voice**: a few seconds of audio, no training. [Voice cloning](#zero-shot-voice-cloning)+- **Put it in your agent**: LiveKit, Pipecat, SillyTavern, or any OpenAI Realtime client. [Integrations](#integrations)+- **Make it yours**: fine-tune persona, tone and knowledge on one GPU. [Fine-tuning](#fine-tuning)+- **Try it without installing anything**: [in your browser](https://huggingface.co/spaces/adventists-ai/Sophon-Realtime), by phone at +1 650-547-4466, or through the [hosted API](https://api.adventists.ai/console/).## Languages@@ -153,71 +118,6 @@ Talk to it in your own language. Sophon-Realtime listens and answers in the lang<sub>Internal tests, November 2026: 15 languages × 20 spoken questions, plus multi-turn dialogues from Omnilingua-AudioMC in 8 languages (Portuguese not included). Japanese re-tested in December 2026 with 90 spoken questions on each build. Japanese is a priority language for us, and upcoming releases will keep improving it.</sub>-## How it works--- **Listens continuously.** At each pause, the same model decides in a single token whether you've finished, are still talking, are back-channeling or are thinking.-- **Drafts early, speaks on time.** A reply is drafted from your first pause and released the moment the model decides it's its turn. If you keep talking, the draft is dropped before you hear it.-- **Writes how to say it, not just what.** The brain marks where to laugh, sigh, breathe, cough or stress a word. Tag and Flash perform these marks; they are never read aloud.-- **Barge-in.** When you interrupt, it stops and keeps only the part you actually heard in the conversation history.--## Quick start--**No GPU?** Use the hosted API: sign up at [api.adventists.ai/console](https://api.adventists.ai/console/) and get 3 hours of free voice chat (counted on Flash). It speaks the OpenAI Realtime protocol at `wss://api.adventists.ai/sophon/v1/realtime` (HTTP: `https://api.adventists.ai/sophon/v1`); set `model` to `sophon-realtime-tag`, `sophon-realtime-flash` or `sophon-realtime-e2e`. A complete Python example is in the [API docs](https://api.adventists.ai/console/docs).--**Quickest** (Tag build, one 80 GB GPU):--```bash-pip install "sophon-realtime[trt]" # Python 3.12, Linux, CUDA 13; installs vLLM-Omni, the Tag plugin and TensorRT-sophon-realtime serve # downloads Sophon-Realtime-32B-Tag (~42 GB) on first run, then serves on port 8000-```--> **Keep the `[trt]`.** Without TensorRT the voice runs in plain PyTorch and is about 3× slower under load (16 users: first audio ~2.4 s-> instead of ~0.75 s, with 1–1.5 s of stutter). `sophon-realtime serve` now warns at start-up when TensorRT is missing.--Or use the one-command scripts, which set up an isolated environment:--**Tag** (one 80 GB GPU):--```bash-git clone https://github.com/adventists-ai/sophon-realtime && cd sophon-realtime/tag-bash install.sh # venv + vLLM-Omni + plugin, downloads the weights (~45 GB)-GPU=0 PORT=8000 bash start.sh-python client_example.py --wav my_question.wav --lang en-```--**4B on one 24 GB GPU** (Flash-4B, uses about 21 GB):--```bash-cd sophon-realtime/flash-bash install.sh-modelscope download --model AdventistsAI/Sophon-Realtime-4B-Flash --local_dir ./model # or: hf download adventists-ai/Sophon-Realtime-4B-Flash --local-dir ./model-GPU=0 PORT=8000 bash start.sh # sees the 4B model and picks its config-python client_example.py --wav my_question.wav --lang en --voice chelsie-```--**Flash** (one 80 GB GPU):--```bash-cd sophon-realtime/flash-bash install.sh-modelscope download --model AdventistsAI/Sophon-Realtime-32B-Flash --local_dir ./model # or: hf download adventists-ai/Sophon-Realtime-32B-Flash --local-dir ./model-GPU=0 PORT=8000 bash start.sh-python client_example.py --wav my_question.wav --lang en --voice chelsie-```--Both serve `ws://HOST:PORT/v1/realtime` (full duplex, OpenAI-Realtime-style) and `POST /v1/chat/completions` (audio in, text + audio out). Details: [tag/README.md](tag/README.md) · [flash/README.md](flash/README.md).--**Mac** (Apple silicon, 36 GB+ unified memory recommended; runs locally with MLX; 16 GB Macs: the 4B build, `SIZE=4B bash mac/install.sh`):--```bash-cd sophon-realtime && bash mac/install.sh # environment + Sophon-Realtime-32B-Flash-4bit-MLX (~24 GB)-~/sophon-mac/sophon --lang en # talk through your microphone-```--Details: [mac/README.md](mac/README.md).--**Live mode** (GPT-Live compatible, delegation to your backend): see [Live mode](#live-mode-openai-gpt-live-compatible) below.-## Live mode (OpenAI GPT-Live compatible)**What it is.** Live mode lets Sophon be the voice of an agent while your own system does the work. [`live/`](live/README.md) is a small gateway that speaks the OpenAI GPT-Live protocol in front of a 32B Tag or Flash engine, so an app written for GPT-Live switches to Sophon by changing only the URL and key. The same gateway also serves an OpenAI Realtime endpoint, for LiveKit and Pipecat agents.@@ -275,7 +175,126 @@ https://github.com/user-attachments/assets/74bd6096-b6fc-4433-a1d7-d3e967107193</details>-## E2E+## Integrations++- **[LiveKit Agents and Pipecat](docs/frameworks.md)**: Sophon-Realtime as the realtime model of your agent, in Realtime mode (`livekit-plugins-sophon`, or Pipecat's OpenAI Realtime service) or Live mode (GPT-Live with client delegation). Measured: the frameworks add about 0.05 s.+- **[SillyTavern](https://github.com/adventists-ai/sophon-sillytavern)**: full-duplex voice calls with your character. Install from SillyTavern → Extensions → Install extension; point it at your own Sophon-Realtime server or the API.++## Fine-tuning++Adapt the brain (persona, tone, domain knowledge, tool use) with LoRA in [ms-swift](https://github.com/modelscope/ms-swift): the 32B brain on one 80 GB GPU, the 4B brain on one 24 GB GPU (about 12 GB in training; merge on CPU). The voice, expressive sound tags and turn-taking are kept. See [finetune/](finetune/README.md).++## Quick start++**No GPU?** Use the hosted API: sign up at [api.adventists.ai/console](https://api.adventists.ai/console/) and get 3 hours of free voice chat (counted on Flash). It speaks the OpenAI Realtime protocol at `wss://api.adventists.ai/sophon/v1/realtime` (HTTP: `https://api.adventists.ai/sophon/v1`); set `model` to `sophon-realtime-tag`, `sophon-realtime-flash` or `sophon-realtime-e2e`. A complete Python example is in the [API docs](https://api.adventists.ai/console/docs).++**Quickest** (Tag build, one 80 GB GPU):++```bash+pip install "sophon-realtime[trt]" # Python 3.12, Linux, CUDA 13; installs vLLM-Omni, the Tag plugin and TensorRT+sophon-realtime serve # downloads Sophon-Realtime-32B-Tag (~42 GB) on first run, then serves on port 8000+```++> **Keep the `[trt]`.** Without TensorRT the voice runs in plain PyTorch and is about 3× slower under load (16 users: first audio ~2.4 s+> instead of ~0.75 s, with 1–1.5 s of stutter). `sophon-realtime serve` now warns at start-up when TensorRT is missing.++**4B on one 24 GB GPU** (Flash-4B, uses about 21 GB):++```bash+git clone https://github.com/adventists-ai/sophon-realtime && cd sophon-realtime/flash+bash install.sh+modelscope download --model AdventistsAI/Sophon-Realtime-4B-Flash --local_dir ./model # or: hf download adventists-ai/Sophon-Realtime-4B-Flash --local-dir ./model+GPU=0 PORT=8000 bash start.sh # sees the 4B model and picks its config+python client_example.py --wav my_question.wav --lang en --voice chelsie+```++**Mac** (Apple silicon, 36 GB+ unified memory recommended; runs locally with MLX; 16 GB Macs: the 4B build, `SIZE=4B bash mac/install.sh`):++```bash+cd sophon-realtime && bash mac/install.sh # environment + Sophon-Realtime-32B-Flash-4bit-MLX (~24 GB)+~/sophon-mac/sophon --lang en # talk through your microphone+```++Details: [mac/README.md](mac/README.md).++<details>+<summary>One-command scripts (Tag, Flash; isolated environment)</summary>++**Tag** (one 80 GB GPU):++```bash+git clone https://github.com/adventists-ai/sophon-realtime && cd sophon-realtime/tag+bash install.sh # venv + vLLM-Omni + plugin, downloads the weights (~45 GB)+GPU=0 PORT=8000 bash start.sh+python client_example.py --wav my_question.wav --lang en+```++**Flash** (one 80 GB GPU):++```bash+cd sophon-realtime/flash+bash install.sh+modelscope download --model AdventistsAI/Sophon-Realtime-32B-Flash --local_dir ./model # or: hf download adventists-ai/Sophon-Realtime-32B-Flash --local-dir ./model+GPU=0 PORT=8000 bash start.sh+python client_example.py --wav my_question.wav --lang en --voice chelsie+```++Both serve `ws://HOST:PORT/v1/realtime` (full duplex, OpenAI-Realtime-style) and `POST /v1/chat/completions` (audio in, text + audio out). Details: [tag/README.md](tag/README.md) · [flash/README.md](flash/README.md).++</details>++## Builds++One brain, three ways to turn its reply into sound: **Tag** (the most expressive voice), **Flash** (the fastest, up to 40 users per GPU) and **E2E** (fast and expressive, our own engine). Each comes with a 32B brain (one 80 GB GPU) or a 4B brain (one 24–32 GB GPU, or a 16 GB Mac). Not sure? Start with Tag on a big GPU, or Flash-4B on a consumer GPU.++<details>+<summary>Compare the builds: Tag, Flash, E2E, 4B and smaller machines</summary>++### Three builds, one brain++All three builds share the same brain: one 32B model that listens to your voice, decides when you have finished, and writes the reply. They differ only in **how the reply becomes sound**.++| | **Tag** (recommended) | **Flash** | **E2E** |+|---|---|---|---|+| How it speaks | The brain writes the reply with sound tags (`[laughter]`, `[sigh]`, `<strong>…</strong>` …); an expressive speech model performs them | Same tagged reply, spoken by a lighter, faster speech model (one forward pass per 80 ms frame) | No speech-token model: a compact talker (about 350M parameters) reads the tagged reply as it is written and generates continuous voice vectors directly; a decoder turns them into sound |+| Best for | Expressive voice: companions, characters, demos | Speed and scale: customer service, in-car, many users per GPU | Expressive voice with the fastest first audio; our own engine, easy to modify |+| Non-verbal sounds (NVV-SuperBench, en / zh) | **0.80 / 0.86** | 0.63 / 0.77 | 0.75 / 0.85 |+| First audio, one user | ~0.45 s | **0.22 s** | **~0.25 s** |+| Users per 80 GB GPU (recommended) | 16 | **40** | 16 |+| Zero-shot voice cloning | **yes**, from a 3–10 s clip ([how](tag/README.md#zero-shot-voice-cloning)) | **yes**, from a 3–10 s clip ([how](flash/README.md#zero-shot-voice-cloning)) | **yes**, from a 5–12 s clip ([how](e2e/README.md#zero-shot-voice-cloning-new-in-130)) |+| GPUs | **1** × 80 GB | **1** × 80 GB | **1** × 80 GB |+| Serving | vLLM-Omni, one command | vLLM-Omni, one command | own engine or vLLM-Omni, one command |+| Weights | [HF](https://huggingface.co/adventists-ai/Sophon-Realtime-v1) · [ModelScope](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-32B-Tag) | [HF](https://huggingface.co/adventists-ai/Sophon-Realtime-32B-Flash) · [ModelScope](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-32B-Flash) | [HF](https://huggingface.co/adventists-ai/Sophon-Realtime-32B-E2E) · [ModelScope](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-32B-E2E) |+| Code | [`tag/`](tag/README.md) | [`flash/`](flash/README.md) | own engine: [`docs/deploy.md`](docs/deploy.md) · vLLM-Omni: [`e2e/`](e2e/README.md) |++**Which one?** Start with **Tag** if you want the voice to act. Pick **Flash** if the number of users per GPU matters most. Pick **E2E** for the fastest first audio with a voice that still laughs and sighs. Tag and Flash share the same APIs, so you can switch later; E2E runs on its own engine or, since 1.1.4, on vLLM-Omni with the same APIs as Tag and Flash.++#### 4B builds++The same three builds with a 4B brain ([DuplexJev-4B-Para](https://huggingface.co/adventists-ai/DuplexJev-4B-Para) with a tag-writing adapter), for one consumer GPU. The speech stages and voices are the same as in the 32B builds; there is no image input.++| | **Tag-4B** | **Flash-4B** | **E2E-4B** |+|---|---|---|---|+| GPU | one 32 GB (uses ~27 GB) | one 24 GB (uses ~21 GB) | one 32 GB (uses ~31 GB) |+| Full-Duplex-Bench v1.0 (4-task avg; 32B: 97.3) | 98.2 | 96.3 | 98.6 |+| First audio, one user (RTX PRO 6000) | 0.40 s | 0.21 s | 0.31 s |+| Install | `SIZE=4B bash install.sh` | `bash install.sh` + [weights](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-4B-Flash) | `SIZE=4B bash install.sh` |+| Weights | [HF](https://huggingface.co/adventists-ai/Sophon-Realtime-4B-Tag) · [ModelScope](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-4B-Tag) | [HF](https://huggingface.co/adventists-ai/Sophon-Realtime-4B-Flash) · [ModelScope](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-4B-Flash) | [HF](https://huggingface.co/adventists-ai/Sophon-Realtime-4B-E2E) · [ModelScope](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-4B-E2E) |++The 4B brain keeps the conversation skills (turn-taking, back-channels, barge-in, sound tags at the same rate as the reference data) but knows and reasons much less: VoiceBench 62.4 (32B: 82.8), Big Bench Audio 44.3% (32B: 81.8%). Use it for local demos, companions and characters, and turn-taking research; use 32B or the [hosted API](https://api.adventists.ai/console/) when answers must be right. **The 4B builds do not support tool calling** (it answers instead of calling the tool; see [#20](https://github.com/adventists-ai/sophon-realtime/issues/20)); for tools and Live mode delegation, use a 32B build. `start.sh` sees a 4B model and picks its config.++##### Smaller machines++| | **Tag-4B-W4** | **Mac 4B** (Flash-4B on MLX) |+|---|---|---|+| Runs on | one 24 GB GPU (RTX 4090 / 3090 class; uses ~21 GB) | an Apple silicon Mac with 16 GB or more (uses ~11 GB) |+| What changes | the brain's language model in 4 bits (GPTQ W4A16); speech, sound tags and speed as Tag-4B | the brain's language model in 8 bits; starts speaking 0.3–0.5 s after you stop (M4 Max) |+| Install | `SIZE=4B-W4 bash install.sh` in `tag/` | `SIZE=4B bash mac/install.sh` |+| Weights | [HF](https://huggingface.co/adventists-ai/Sophon-Realtime-4B-Tag-W4) · [ModelScope](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-4B-Tag-W4) | [HF](https://huggingface.co/adventists-ai/Sophon-Realtime-4B-Flash-MLX) · [ModelScope](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-4B-Flash-MLX) |++Both were measured with memory held to the target (an H100 with the 24 GB budget; an M4 Max with MLX capped at what a 16 GB Mac gives the GPU), not yet on a physical 24 GB card or 16 GB Mac: reports are welcome. Comparisons with the full-precision builds are on the model cards.++### E2EThe E2E build has no speech-token model in the middle. A compact talker (about 350M parameters) reads the brain's tagged reply while it is still being written and generates a stream of continuous voice vectors, about 6.5 frames per second; a 2-step decoder and a vocoder turn them into 24 kHz audio. Laughs, coughs, sighs, breaths and stressed words are produced by the talker itself, as part of the same stream. Everything runs on **one 80 GB GPU** with our own engine: [docs/deploy.md](docs/deploy.md). Weights: [HF](https://huggingface.co/adventists-ai/Sophon-Realtime-32B-E2E) · [ModelScope](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-32B-E2E).@@ -283,14 +302,14 @@ Measured from a fresh install on one H100: first audio for one user in about 0.2E2E can be served in two ways, with the same weights and the same voice: by our own engine ([docs/deploy.md](docs/deploy.md), the numbers above), or as one vLLM-Omni model like Tag and Flash ([e2e/](e2e/README.md): `/v1/realtime` and `/v1/chat/completions`; first audio about 0.3 s for one user and 0.35 s (median) for 16). Both are measured on an H100. The E2E voice stages run about 2× slower on an RTX PRO 6000 (about 4–8 users per GPU); on such cards use Tag or Flash if you need more users per GPU.-## Fine-tuning--Adapt the brain (persona, tone, domain knowledge, tool use) with LoRA in [ms-swift](https://github.com/modelscope/ms-swift): the 32B brain on one 80 GB GPU, the 4B brain on one 24 GB GPU (about 12 GB in training; merge on CPU). The voice, expressive sound tags and turn-taking are kept. See [finetune/](finetune/README.md).+</details>-## Integrations+## How it works-- **[LiveKit Agents and Pipecat](docs/frameworks.md)**: Sophon-Realtime as the realtime model of your agent, in Realtime mode (`livekit-plugins-sophon`, or Pipecat's OpenAI Realtime service) or Live mode (GPT-Live with client delegation). Measured: the frameworks add about 0.05 s.-- **[SillyTavern](https://github.com/adventists-ai/sophon-sillytavern)**: full-duplex voice calls with your character. Install from SillyTavern → Extensions → Install extension; point it at your own Sophon-Realtime server or the API.+- **Listens continuously.** At each pause, the same model decides in a single token whether you've finished, are still talking, are back-channeling or are thinking.+- **Drafts early, speaks on time.** A reply is drafted from your first pause and released the moment the model decides it's its turn. If you keep talking, the draft is dropped before you hear it.+- **Writes how to say it, not just what.** The brain marks where to laugh, sigh, breathe, cough or stress a word. Tag and Flash perform these marks; they are never read aloud.+- **Barge-in.** When you interrupt, it stops and keeps only the part you actually heard in the conversation history.## From the same teamdiff --git a/README_CN.md b/README_CN.mdindex 95cbca9..d214261 100644--- a/README_CN.md+++ b/README_CN.md@@ -94,49 +94,14 @@ https://github.com/user-attachments/assets/4d6c74f5-3bbf-4dc2-8b11-f90ff85de4a2每个版本(包括修复版)的详细改动:[更新记录](CHANGELOG.md) · [GitHub Releases](https://github.com/adventists-ai/sophon-realtime/releases)-## 三个版本,同一个大脑+## 能做什么-三个版本的大脑完全相同:同一个 32B 模型负责听你说话、判断你说完没有、写出回复。区别只在于**回复怎么变成声音**。--| | **Tag**(推荐) | **Flash** | **E2E** |-|---|---|---|---|-| 怎么出声 | 大脑写出带声音标签的回复(`[laughter]`、`[sigh]`、`<strong>…</strong>` 等),由一个擅长表演的语音模型演出来 | 同样是带标签的回复,交给更轻、更快的语音模型来说(每 80 ms 一帧,一次前向) | 不经过语音 token:一个小巧的说话头(约 3.5 亿参数)边读带标签的回复,边直接生成连续的声音向量,再由解码器还原成声音 |-| 适合 | 表现力优先:陪伴、角色、演示 | 速度和并发优先:客服、车机、一张卡服务很多人 | 既要表现力、又要最快的首包;自研引擎,方便改动 |-| 非语言声音(NVV-SuperBench,英 / 中) | **0.80 / 0.86** | 0.63 / 0.77 | 0.75 / 0.85 |-| 单路首包 | 约 0.45 s | **0.22 s** | **约 0.25 s** |-| 每张 80 GB 卡建议并发 | 16 路 | **40 路** | 16 路 |-| 零样本音色克隆 | **支持**,3–10 秒参考音([用法](tag/README_CN.md#零样本音色克隆)) | **支持**,3–10 秒参考音([用法](flash/README_CN.md#零样本音色克隆)) | **支持**,5–12 秒参考音([用法](e2e/README_CN.md#零样本音色克隆130-新增)) |-| 显卡 | **1** × 80 GB | **1** × 80 GB | **1** × 80 GB |-| 部署 | vLLM-Omni,一条命令 | vLLM-Omni,一条命令 | 自研引擎或 vLLM-Omni,一条命令 |-| 权重 | [魔搭](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-32B-Tag) · [HF](https://huggingface.co/adventists-ai/Sophon-Realtime-v1) | [魔搭](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-32B-Flash) · [HF](https://huggingface.co/adventists-ai/Sophon-Realtime-32B-Flash) | [魔搭](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-32B-E2E) · [HF](https://huggingface.co/adventists-ai/Sophon-Realtime-32B-E2E) |-| 代码 | [`tag/`](tag/README_CN.md) | [`flash/`](flash/README_CN.md) | 自研引擎:[`docs/deploy_CN.md`](docs/deploy_CN.md) · vLLM-Omni:[`e2e/`](e2e/README_CN.md) |--**怎么选?** 想让声音"会演",先用 **Tag**;最看重单卡能接多少人,用 **Flash**;想要最快的首包、同时保留会笑会叹气的表现力,用 **E2E**。Tag 和 Flash 接口相同,之后可以随时切换;E2E 用自研引擎,1.1.4 起也可以用 vLLM-Omni 部署(接口与 Tag、Flash 相同)。--### 4B 版--同样三个版本,换上 4B 大脑([DuplexJev-4B-Para](https://www.modelscope.cn/models/AdventistsAI/DuplexJev-4B-Para) 加写标签的适配器),一张消费级显卡就能跑。发声部分和音色与 32B 版相同;不收图片。--| | **Tag-4B** | **Flash-4B** | **E2E-4B** |-|---|---|---|---|-| 显卡 | 一张 32 GB(占用约 27 GB) | 一张 24 GB(占用约 21 GB) | 一张 32 GB(占用约 31 GB) |-| Full-Duplex-Bench v1.0(4 项平均;32B:97.3) | 98.2 | 96.3 | 98.6 |-| 单路首包(RTX PRO 6000) | 0.40 秒 | 0.21 秒 | 0.31 秒 |-| 安装 | `SIZE=4B bash install.sh` | `bash install.sh` + [权重](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-4B-Flash) | `SIZE=4B bash install.sh` |-| 权重 | [魔搭](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-4B-Tag) · [HF](https://huggingface.co/adventists-ai/Sophon-Realtime-4B-Tag) | [魔搭](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-4B-Flash) · [HF](https://huggingface.co/adventists-ai/Sophon-Realtime-4B-Flash) | [魔搭](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-4B-E2E) · [HF](https://huggingface.co/adventists-ai/Sophon-Realtime-4B-E2E) |--4B 大脑保留了对话能力(接话、附和、被打断就停、声音标签比例和标准答案一样),但知识和推理弱很多:VoiceBench 62.4(32B:82.8),Big Bench Audio 44.3%(32B:81.8%)。适合本地演示、陪伴和角色对话、话轮研究;需要回答准确时用 32B 版或[在线 API](https://api.adventists.cn/console/)。**4B 版目前不支持工具调用**(该调工具时它不会调用,见 [#20](https://github.com/adventists-ai/sophon-realtime/issues/20));要用工具或 Live 模式的委派,请用 32B 版。`start.sh` 识别到 4B 模型会自动选它的配置。--#### 更小的机器--| | **Tag-4B-W4** | **Mac 4B 版**(Flash-4B 的 MLX 版) |-|---|---|---|-| 硬件 | 一张 24 GB 显卡(4090 / 3090 一档,占用约 21 GB) | 16 GB 及以上内存的 Apple 芯片 Mac(占用约 11 GB) |-| 改了什么 | 大脑的语言模型用 4 位(GPTQ W4A16);语音、声音标签和速度与 Tag-4B 相同 | 大脑的语言模型用 8 位;你说完 0.3–0.5 秒开口(M4 Max) |-| 安装 | 在 `tag/` 里 `SIZE=4B-W4 bash install.sh` | `SIZE=4B bash mac/install.sh` |-| 权重 | [魔搭](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-4B-Tag-W4) · [HF](https://huggingface.co/adventists-ai/Sophon-Realtime-4B-Tag-W4) | [魔搭](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-4B-Flash-MLX) · [HF](https://huggingface.co/adventists-ai/Sophon-Realtime-4B-Flash-MLX) |--两者都是把显存 / 内存限制在目标机器的大小下测得的(H100 按 24 GB 预算;M4 Max 把 MLX 限制在 16 GB Mac 给 GPU 的量),还没在真实的 24 GB 显卡和 16 GB Mac 上测过,欢迎反馈。与全精度版的对比见模型卡。+- **用你的语言聊**:中文、英文,以及意大利语、德语、西班牙语、法语、葡萄牙语和日语。[多语言](#多语言)+- **接上你自己的后端**:你的系统去查资料、办事时,它继续陪用户聊,拿到结果再说出来;可直接替换 OpenAI GPT-Live。[Live 模式](#live-模式兼容-openai-gpt-live)+- **换成任何声音**:几秒钟录音,不用训练。[声音克隆](#零样本声音克隆)+- **放进你的智能体**:LiveKit、Pipecat、SillyTavern,或任何 OpenAI Realtime 客户端。[生态集成](#生态集成)+- **调成你自己的**:一张显卡微调人设、语气和知识。[微调](#微调)+- **不用安装就能试**:[浏览器里](https://www.modelscope.cn/studios/AdventistsAI/Sophon-Realtime)直接聊、打电话 +1 650-547-4466,或用[在线 API](https://api.adventists.cn/console/)。## 多语言@@ -152,71 +117,6 @@ https://github.com/user-attachments/assets/4d6c74f5-3bbf-4dc2-8b11-f90ff85de4a2<sub>内部测试,2026 年 11 月:15 种语言各 20 道口语问题,另用 Omnilingua-AudioMC 测了 8 种语言的多轮对话(不含葡萄牙语)。2026 年 12 月日语复测:每个版本 90 道口语问题。日语是我们重点投入的语言,后续版本会持续加强。</sub>-## 工作方式--- **一直在听。** 每次你停顿,同一个模型用一个 token 判断:你说完了、还在说、只是附和,还是在想。-- **提前起草,按时开口。** 你第一次停顿时它就开始起草,判定轮到自己时立刻说出来;如果你接着说,草稿在你听到之前就丢掉。-- **不只写说什么,还写怎么说。** 大脑会标出哪里该笑、叹气、换气、咳嗽、加重语气;Tag 和 Flash 把这些标记演出来,不会念出来。-- **可以随时打断。** 你一插话它就停下,对话历史里只保留你真正听到的那部分。--## 快速上手--**没有显卡?** 直接用在线 API:在 [api.adventists.cn/console](https://api.adventists.cn/console/)(海外用 [api.adventists.ai/console](https://api.adventists.ai/console/))注册,送 3 小时免费对话(按 Flash 计)。接口兼容 OpenAI Realtime 协议,地址 `wss://api.adventists.cn/sophon/v1/realtime`(HTTP:`https://api.adventists.cn/sophon/v1`),`model` 填 `sophon-realtime-tag`、`sophon-realtime-flash` 或 `sophon-realtime-e2e`。完整的 Python 示例见[接口文档](https://api.adventists.cn/console/docs)。--**最快**(Tag 版,一张 80 GB 显卡):--```bash-pip install "sophon-realtime[trt]" # Python 3.12、Linux、CUDA 13;会装好 vLLM-Omni、Tag 插件和 TensorRT-sophon-realtime serve # 首次运行自动下载 Sophon-Realtime-32B-Tag(约 42 GB),然后在 8000 端口提供服务-```--> **一定要带 `[trt]`。** 没有 TensorRT 时说话段走纯 PyTorch,高并发下慢约 3 倍(16 路:首包约 2.4 秒,而不是约 0.75 秒,还会卡顿 1–1.5 秒)。-> 现在 `sophon-realtime serve` 启动时如果没装 TensorRT 会给出警告。--也可以用一键脚本,会建一个独立的虚拟环境:--**Tag**(一张 80 GB 显卡):--```bash-git clone https://github.com/adventists-ai/sophon-realtime && cd sophon-realtime/tag-bash install.sh # 建环境、装 vLLM-Omni 和插件、下载权重(约 45 GB)-GPU=0 PORT=8000 bash start.sh-python client_example.py --wav my_question.wav --lang zh-```--**4B 版,一张 24 GB 显卡**(Flash-4B,占用约 21 GB):--```bash-cd sophon-realtime/flash-bash install.sh-modelscope download --model AdventistsAI/Sophon-Realtime-4B-Flash --local_dir ./model-GPU=0 PORT=8000 bash start.sh # 识别到 4B 模型会自动选它的配置-python client_example.py --wav my_question.wav --lang zh --voice chelsie-```--**Flash**(一张 80 GB 显卡):--```bash-cd sophon-realtime/flash-bash install.sh-modelscope download --model AdventistsAI/Sophon-Realtime-32B-Flash --local_dir ./model-GPU=0 PORT=8000 bash start.sh-python client_example.py --wav my_question.wav --lang zh --voice chelsie-```--两者都提供 `ws://HOST:PORT/v1/realtime`(全双工,OpenAI Realtime 风格)和 `POST /v1/chat/completions`(语音进,文字 + 语音出)。详见 [tag/README_CN.md](tag/README_CN.md) · [flash/README_CN.md](flash/README_CN.md)。--**Mac**(Apple 芯片,推荐 36 GB 及以上统一内存;用 MLX 本地运行;16 GB 的 Mac 用 4B 版:`SIZE=4B bash mac/install.sh`):--```bash-cd sophon-realtime && bash mac/install.sh # 安装环境并下载 Sophon-Realtime-32B-Flash-4bit-MLX(约 24 GB,国内自动走魔搭)-~/sophon-mac/sophon # 对着麦克风说话-```--详见 [mac/README_CN.md](mac/README_CN.md)。--**Live 模式**(兼容 GPT-Live,把查询委派给你的后端):见下方 [Live 模式](#live-模式兼容-openai-gpt-live)。-## Live 模式(兼容 OpenAI GPT-Live)**是什么。** Live 模式让智子当智能体的「嘴和耳朵」,真正干活的是你自己的系统。[`live/`](live/README_CN.md) 是一个小网关:对外说 OpenAI GPT-Live 协议,后面接 32B 的 Tag 或 Flash 引擎。按 GPT-Live 写的应用,只要换地址和 key 就能切到智子。同一个网关还提供 OpenAI Realtime 接口,给 LiveKit、Pipecat 智能体用。@@ -274,7 +174,126 @@ https://github.com/user-attachments/assets/7f0627b0-fae4-4633-b412-88cb24942ab8</details>-## E2E+## 生态集成++- **[LiveKit Agents 和 Pipecat](docs/frameworks_CN.md)**:把 Sophon-Realtime 作为智能体的实时模型,Realtime 模式(`livekit-plugins-sophon`,或 Pipecat 的 OpenAI Realtime 服务)和 Live 模式(GPT-Live 客户端委派)都可以。实测框架只多约 0.05 秒。+- **[酒馆 SillyTavern](https://github.com/adventists-ai/sophon-sillytavern)**:和角色全双工语音通话。在酒馆 → 扩展 → 安装扩展里安装,连接自己的 Sophon-Realtime 服务器或 API。++## 微调++可以用 [ms-swift](https://github.com/modelscope/ms-swift) 以 LoRA 方式调整大脑(人设、语气、领域知识、工具调用):32B 用一张 80 GB 显卡,4B 用一张 24 GB 显卡(训练约占 12 GB,CPU 上合并);声音、声音标签和接话能力都会保留。详见 [finetune/](finetune/README_CN.md)。++## 快速上手++**没有显卡?** 直接用在线 API:在 [api.adventists.cn/console](https://api.adventists.cn/console/)(海外用 [api.adventists.ai/console](https://api.adventists.ai/console/))注册,送 3 小时免费对话(按 Flash 计)。接口兼容 OpenAI Realtime 协议,地址 `wss://api.adventists.cn/sophon/v1/realtime`(HTTP:`https://api.adventists.cn/sophon/v1`),`model` 填 `sophon-realtime-tag`、`sophon-realtime-flash` 或 `sophon-realtime-e2e`。完整的 Python 示例见[接口文档](https://api.adventists.cn/console/docs)。++**最快**(Tag 版,一张 80 GB 显卡):++```bash+pip install "sophon-realtime[trt]" # Python 3.12、Linux、CUDA 13;会装好 vLLM-Omni、Tag 插件和 TensorRT+sophon-realtime serve # 首次运行自动下载 Sophon-Realtime-32B-Tag(约 42 GB),然后在 8000 端口提供服务+```++> **一定要带 `[trt]`。** 没有 TensorRT 时说话段走纯 PyTorch,高并发下慢约 3 倍(16 路:首包约 2.4 秒,而不是约 0.75 秒,还会卡顿 1–1.5 秒)。+> 现在 `sophon-realtime serve` 启动时如果没装 TensorRT 会给出警告。++**4B 版,一张 24 GB 显卡**(Flash-4B,占用约 21 GB):++```bash+git clone https://github.com/adventists-ai/sophon-realtime && cd sophon-realtime/flash+bash install.sh+modelscope download --model AdventistsAI/Sophon-Realtime-4B-Flash --local_dir ./model+GPU=0 PORT=8000 bash start.sh # 识别到 4B 模型会自动选它的配置+python client_example.py --wav my_question.wav --lang zh --voice chelsie+```++**Mac**(Apple 芯片,推荐 36 GB 及以上统一内存;用 MLX 本地运行;16 GB 的 Mac 用 4B 版:`SIZE=4B bash mac/install.sh`):++```bash+cd sophon-realtime && bash mac/install.sh # 安装环境并下载 Sophon-Realtime-32B-Flash-4bit-MLX(约 24 GB,国内自动走魔搭)+~/sophon-mac/sophon # 对着麦克风说话+```++详见 [mac/README_CN.md](mac/README_CN.md)。++<details>+<summary>一键脚本(Tag、Flash;独立虚拟环境)</summary>++**Tag**(一张 80 GB 显卡):++```bash+git clone https://github.com/adventists-ai/sophon-realtime && cd sophon-realtime/tag+bash install.sh # 建环境、装 vLLM-Omni 和插件、下载权重(约 45 GB)+GPU=0 PORT=8000 bash start.sh+python client_example.py --wav my_question.wav --lang zh+```++**Flash**(一张 80 GB 显卡):++```bash+cd sophon-realtime/flash+bash install.sh+modelscope download --model AdventistsAI/Sophon-Realtime-32B-Flash --local_dir ./model+GPU=0 PORT=8000 bash start.sh+python client_example.py --wav my_question.wav --lang zh --voice chelsie+```++两者都提供 `ws://HOST:PORT/v1/realtime`(全双工,OpenAI Realtime 风格)和 `POST /v1/chat/completions`(语音进,文字 + 语音出)。详见 [tag/README_CN.md](tag/README_CN.md) · [flash/README_CN.md](flash/README_CN.md)。++</details>++## 版本++同一个大脑,三种把回复变成声音的方式:**Tag**(声音最有表现力)、**Flash**(最快,单卡最多 40 路)、**E2E**(又快又有表现力,自研引擎)。每种都有 32B 大脑(一张 80 GB 显卡)和 4B 大脑(一张 24–32 GB 显卡,或 16 GB 的 Mac)。拿不准就这样选:大显卡用 Tag,消费级显卡用 Flash-4B。++<details>+<summary>版本对比:Tag、Flash、E2E、4B 和更小的机器</summary>++### 三个版本,同一个大脑++三个版本的大脑完全相同:同一个 32B 模型负责听你说话、判断你说完没有、写出回复。区别只在于**回复怎么变成声音**。++| | **Tag**(推荐) | **Flash** | **E2E** |+|---|---|---|---|+| 怎么出声 | 大脑写出带声音标签的回复(`[laughter]`、`[sigh]`、`<strong>…</strong>` 等),由一个擅长表演的语音模型演出来 | 同样是带标签的回复,交给更轻、更快的语音模型来说(每 80 ms 一帧,一次前向) | 不经过语音 token:一个小巧的说话头(约 3.5 亿参数)边读带标签的回复,边直接生成连续的声音向量,再由解码器还原成声音 |+| 适合 | 表现力优先:陪伴、角色、演示 | 速度和并发优先:客服、车机、一张卡服务很多人 | 既要表现力、又要最快的首包;自研引擎,方便改动 |+| 非语言声音(NVV-SuperBench,英 / 中) | **0.80 / 0.86** | 0.63 / 0.77 | 0.75 / 0.85 |+| 单路首包 | 约 0.45 s | **0.22 s** | **约 0.25 s** |+| 每张 80 GB 卡建议并发 | 16 路 | **40 路** | 16 路 |+| 零样本音色克隆 | **支持**,3–10 秒参考音([用法](tag/README_CN.md#零样本音色克隆)) | **支持**,3–10 秒参考音([用法](flash/README_CN.md#零样本音色克隆)) | **支持**,5–12 秒参考音([用法](e2e/README_CN.md#零样本音色克隆130-新增)) |+| 显卡 | **1** × 80 GB | **1** × 80 GB | **1** × 80 GB |+| 部署 | vLLM-Omni,一条命令 | vLLM-Omni,一条命令 | 自研引擎或 vLLM-Omni,一条命令 |+| 权重 | [魔搭](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-32B-Tag) · [HF](https://huggingface.co/adventists-ai/Sophon-Realtime-v1) | [魔搭](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-32B-Flash) · [HF](https://huggingface.co/adventists-ai/Sophon-Realtime-32B-Flash) | [魔搭](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-32B-E2E) · [HF](https://huggingface.co/adventists-ai/Sophon-Realtime-32B-E2E) |+| 代码 | [`tag/`](tag/README_CN.md) | [`flash/`](flash/README_CN.md) | 自研引擎:[`docs/deploy_CN.md`](docs/deploy_CN.md) · vLLM-Omni:[`e2e/`](e2e/README_CN.md) |++**怎么选?** 想让声音"会演",先用 **Tag**;最看重单卡能接多少人,用 **Flash**;想要最快的首包、同时保留会笑会叹气的表现力,用 **E2E**。Tag 和 Flash 接口相同,之后可以随时切换;E2E 用自研引擎,1.1.4 起也可以用 vLLM-Omni 部署(接口与 Tag、Flash 相同)。++#### 4B 版++同样三个版本,换上 4B 大脑([DuplexJev-4B-Para](https://www.modelscope.cn/models/AdventistsAI/DuplexJev-4B-Para) 加写标签的适配器),一张消费级显卡就能跑。发声部分和音色与 32B 版相同;不收图片。++| | **Tag-4B** | **Flash-4B** | **E2E-4B** |+|---|---|---|---|+| 显卡 | 一张 32 GB(占用约 27 GB) | 一张 24 GB(占用约 21 GB) | 一张 32 GB(占用约 31 GB) |+| Full-Duplex-Bench v1.0(4 项平均;32B:97.3) | 98.2 | 96.3 | 98.6 |+| 单路首包(RTX PRO 6000) | 0.40 秒 | 0.21 秒 | 0.31 秒 |+| 安装 | `SIZE=4B bash install.sh` | `bash install.sh` + [权重](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-4B-Flash) | `SIZE=4B bash install.sh` |+| 权重 | [魔搭](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-4B-Tag) · [HF](https://huggingface.co/adventists-ai/Sophon-Realtime-4B-Tag) | [魔搭](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-4B-Flash) · [HF](https://huggingface.co/adventists-ai/Sophon-Realtime-4B-Flash) | [魔搭](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-4B-E2E) · [HF](https://huggingface.co/adventists-ai/Sophon-Realtime-4B-E2E) |++4B 大脑保留了对话能力(接话、附和、被打断就停、声音标签比例和标准答案一样),但知识和推理弱很多:VoiceBench 62.4(32B:82.8),Big Bench Audio 44.3%(32B:81.8%)。适合本地演示、陪伴和角色对话、话轮研究;需要回答准确时用 32B 版或[在线 API](https://api.adventists.cn/console/)。**4B 版目前不支持工具调用**(该调工具时它不会调用,见 [#20](https://github.com/adventists-ai/sophon-realtime/issues/20));要用工具或 Live 模式的委派,请用 32B 版。`start.sh` 识别到 4B 模型会自动选它的配置。++##### 更小的机器++| | **Tag-4B-W4** | **Mac 4B 版**(Flash-4B 的 MLX 版) |+|---|---|---|+| 硬件 | 一张 24 GB 显卡(4090 / 3090 一档,占用约 21 GB) | 16 GB 及以上内存的 Apple 芯片 Mac(占用约 11 GB) |+| 改了什么 | 大脑的语言模型用 4 位(GPTQ W4A16);语音、声音标签和速度与 Tag-4B 相同 | 大脑的语言模型用 8 位;你说完 0.3–0.5 秒开口(M4 Max) |+| 安装 | 在 `tag/` 里 `SIZE=4B-W4 bash install.sh` | `SIZE=4B bash mac/install.sh` |+| 权重 | [魔搭](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-4B-Tag-W4) · [HF](https://huggingface.co/adventists-ai/Sophon-Realtime-4B-Tag-W4) | [魔搭](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-4B-Flash-MLX) · [HF](https://huggingface.co/adventists-ai/Sophon-Realtime-4B-Flash-MLX) |++两者都是把显存 / 内存限制在目标机器的大小下测得的(H100 按 24 GB 预算;M4 Max 把 MLX 限制在 16 GB Mac 给 GPU 的量),还没在真实的 24 GB 显卡和 16 GB Mac 上测过,欢迎反馈。与全精度版的对比见模型卡。++### E2EE2E 版中间不经过语音 token。一个小巧的说话头(约 3.5 亿参数)在大脑还在写回复的时候就开始读,边读边生成连续的声音向量(每秒约 6.5 帧),再由 2 步解码器和声码器还原成 24 kHz 音频。笑、咳嗽、叹气、呼吸和重读都由说话头自己在同一条流里发出来。整套系统跑在**一张 80 GB 显卡**上,使用我们的自研引擎:[docs/deploy_CN.md](docs/deploy_CN.md)。权重:[魔搭](https://www.modelscope.cn/models/AdventistsAI/Sophon-Realtime-32B-E2E) · [HF](https://huggingface.co/adventists-ai/Sophon-Realtime-32B-E2E)。@@ -282,14 +301,14 @@ E2E 版中间不经过语音 token。一个小巧的说话头(约 3.5 亿参E2E 版有两种部署方式,权重相同、声音相同:自研引擎([docs/deploy_CN.md](docs/deploy_CN.md),上面的数字),或者像 Tag、Flash 一样作为一个 vLLM-Omni 模型([e2e/](e2e/README_CN.md):提供 `/v1/realtime` 和 `/v1/chat/completions`;单路首包约 0.3 秒,16 路首包中位数 0.35 秒)。以上都是在 H100 上测的。E2E 的发声部分在 RTX PRO 6000 上慢约一倍(单卡约 4–8 路);在这类显卡上需要更高并发时请用 Tag 或 Flash。-## 微调--可以用 [ms-swift](https://github.com/modelscope/ms-swift) 以 LoRA 方式调整大脑(人设、语气、领域知识、工具调用):32B 用一张 80 GB 显卡,4B 用一张 24 GB 显卡(训练约占 12 GB,CPU 上合并);声音、声音标签和接话能力都会保留。详见 [finetune/](finetune/README_CN.md)。+</details>-## 生态集成+## 工作方式-- **[LiveKit Agents 和 Pipecat](docs/frameworks_CN.md)**:把 Sophon-Realtime 作为智能体的实时模型,Realtime 模式(`livekit-plugins-sophon`,或 Pipecat 的 OpenAI Realtime 服务)和 Live 模式(GPT-Live 客户端委派)都可以。实测框架只多约 0.05 秒。-- **[酒馆 SillyTavern](https://github.com/adventists-ai/sophon-sillytavern)**:和角色全双工语音通话。在酒馆 → 扩展 → 安装扩展里安装,连接自己的 Sophon-Realtime 服务器或 API。+- **一直在听。** 每次你停顿,同一个模型用一个 token 判断:你说完了、还在说、只是附和,还是在想。+- **提前起草,按时开口。** 你第一次停顿时它就开始起草,判定轮到自己时立刻说出来;如果你接着说,草稿在你听到之前就丢掉。+- **不只写说什么,还写怎么说。** 大脑会标出哪里该笑、叹气、换气、咳嗽、加重语气;Tag 和 Flash 把这些标记演出来,不会念出来。+- **可以随时打断。** 你一插话它就停下,对话历史里只保留你真正听到的那部分。## 同一团队的其他项目