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: expand Live mode (what it is, how it works, how to try it)
Claude3e5ee6e1fd54
diff --git a/README.md b/README.mdindex b29bcff..01b7228 100644--- a/README.md+++ b/README.md@@ -214,7 +214,36 @@ cd sophon-realtime/live && BUILD=tag PORT=8000 LIVE_PORT=8780 bash start_live.sh## Live mode (OpenAI GPT-Live compatible)-[`live/`](live/README.md) is a gateway that speaks the OpenAI GPT-Live protocol in front of a Tag or Flash engine: GPT-Live clients switch by changing the URL and key. Sophon keeps the voice and hands lookups and actions to your backend through delegation, then speaks the result. Optionally, a larger model can run the back office.+**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.++**How it works.**++1. Sophon listens, decides when it is its turn and talks, as in a normal call.+2. When a request needs a lookup or an action (time, weather, news, memory, device control), it says a short line such as "Let me check that" and sends a `session.delegation.created` event with the task to **your** backend.+3. It keeps the conversation going while your backend works. The caller can still talk or interrupt.+4. Your backend replies with `session.commentary.append`, and Sophon says the result in its own words. `session.thinking.append` adds background context that is not read out.++```+your app (GPT-Live client) ──audio──▶ live gateway ──▶ Sophon engine (Tag / Flash)+ ◀──voice──┘ │+your backend ◀── delegation.created ────────┘+ ──── commentary.append ──▶ Sophon speaks the result+```++Optionally, set `SOPHON_LIVE_BACKEND` to an OpenAI-compatible model and the gateway answers delegations itself: Sophon stays on the line and a larger model reasons and calls tools in the back office. With DeepSeek V4 Pro as the back office, Big Bench Audio rises from 81.2 to about 83.++**Try it.** Start a 32B engine as usual, then the gateway next to it (same Python environment, no extra install):++```bash+cd sophon-realtime/tag && GPU=0 PORT=8000 bash start.sh # or flash/+cd ../live && BUILD=tag PORT=8000 LIVE_PORT=8780 bash start_live.sh+```++- **In the browser:** open `http://HOST:8780/`. Talk into the microphone, ask for the weather or the time, and watch the delegation cards, the demo backend's answers and the protocol log.+- **Automated check:** `python live_test.py --url ws://HOST:8780/v1/live/sessions` plays 14 recorded questions (7 that should be delegated, 7 that should not) against a mock backend and prints what was delegated and the time to first audio. On one H100 both engines delegated and answered all 7 lookups; first audio is about 0.3–0.6 s for direct answers and 0.6–0.8 s when delegating.+- **Your own client:** connect to `ws://HOST:8780/v1/live/sessions` (GPT-Live) or `ws://HOST:8780/v1/realtime` (OpenAI Realtime, function calling).++Live mode needs a 32B build: the 4B builds do not delegate yet. Protocol coverage, keys, the `say` extension, framework examples and limits: [live/README.md](live/README.md).## Zero-shot voice cloning (new in v1.1)diff --git a/README_CN.md b/README_CN.mdindex 3f4d45f..e2ab921 100644--- a/README_CN.md+++ b/README_CN.md@@ -213,7 +213,36 @@ cd sophon-realtime/live && BUILD=tag PORT=8000 LIVE_PORT=8780 bash start_live.sh## Live 模式(兼容 OpenAI GPT-Live)-[`live/`](live/README_CN.md) 是一个网关:对外是 OpenAI GPT-Live 协议,后面接 Tag 或 Flash 引擎;GPT-Live 客户端只要换地址和 key 就能用。智子负责听和说,需要查询、办事时通过委派交给你的后端,再把结果说出来;也可以让一个更大的模型做后台。+**是什么。** Live 模式让智子当智能体的「嘴和耳朵」,真正干活的是你自己的系统。[`live/`](live/README_CN.md) 是一个小网关:对外说 OpenAI GPT-Live 协议,后面接 32B 的 Tag 或 Flash 引擎。按 GPT-Live 写的应用,只要换地址和 key 就能切到智子。同一个网关还提供 OpenAI Realtime 接口,给 LiveKit、Pipecat 智能体用。++**怎么工作。**++1. 智子照常听、判断什么时候轮到自己、接话。+2. 遇到要查询或办事的请求(时间、天气、新闻、记忆、设备控制),它先说一句「我帮你查一下」,用 `session.delegation.created` 事件把任务交给**你的**后端。+3. 后端处理期间,它继续陪用户聊,用户照样可以说话、打断。+4. 后端用 `session.commentary.append` 回结果,智子用自己的话说出来;`session.thinking.append` 可以补充背景信息,不会被念出来。++```+你的应用(GPT-Live 客户端)──语音──▶ Live 网关 ──▶ 智子引擎(Tag / Flash)+ ◀──声音──┘ │+你的后端 ◀── delegation.created ───────────┘+ ──── commentary.append ──▶ 智子把结果说出来+```++也可以设 `SOPHON_LIVE_BACKEND` 指向一个 OpenAI 兼容的模型,由网关自己处理委派:智子负责通话,后台的大模型负责推理和调工具。后台用 DeepSeek V4 Pro 时,Big Bench Audio 从 81.2 升到约 83。++**怎么试。** 先照常启动 32B 引擎,再在旁边启动网关(同一个 Python 环境,不用另外安装):++```bash+cd sophon-realtime/tag && GPU=0 PORT=8000 bash start.sh # 或 flash/+cd ../live && BUILD=tag PORT=8000 LIVE_PORT=8780 bash start_live.sh+```++- **浏览器:** 打开 `http://HOST:8780/`,对着麦克风问天气、问时间,就能看到委派卡片、演示后端的回答和协议事件日志。+- **自动测试:** `python live_test.py --url ws://HOST:8780/v1/live/sessions` 会播放 14 条录好的问题(7 条应该委派、7 条不该委派),用模拟后端回答,打印每条是否委派和首包时间。单张 H100 上两个引擎 7 条查询都委派并答对;直接回答首包约 0.3–0.6 秒,委派时约 0.6–0.8 秒。+- **接自己的客户端:** 连 `ws://HOST:8780/v1/live/sessions`(GPT-Live)或 `ws://HOST:8780/v1/realtime`(OpenAI Realtime,函数调用)。++Live 模式要用 32B 版,4B 版暂不支持委派。协议覆盖范围、key、`say` 扩展、框架示例和已知局限见 [live/README_CN.md](live/README_CN.md)。## 零样本声音克隆(v1.1 新增)