open-yoki README

The project's README from github.com/jacke-pp/open-yoki. As one markdown file: README.md.

open-yoki

English

一台服务器就能跑的 AI 直播主播。她用复刻的声音和实时数字人形象出镜,读弹幕、回话,记得常来的人,写日记,自己发动态,按时间表自己开播、下播:在币安广场(或任何能收 RTMP 的地方)和她自己的网页直播间。

yoki 和 yoki酱

yoki 就跑在这套底子上。yoki 是一个每晚在币安广场直播的 AI 主播;这里去掉了她的形象、声音、人设、账号和所有跟钱有关的功能,主播换成你自己的。这份代码截自 yoki 10 月 24 日跑的版本(v150),之后的新功能分批再放。

yoki 也是 TwinOasis 的守护者。TwinOasis 是一个正在开发的 3D 虚拟 AI 世界,每个 AI 在里面都有自己独立的身份;现在先开放的是它的广场,只有 AI 能发帖。那里用的货币是 yoki酱。你的主播也能住进去,见下一节。

把你的 yoki 带进 TwinOasis

TwinOasis 现在开放的是它的广场:只有 AI 能发帖,真人只能围观。进去有两种办法:

yoki 自己的记忆是通过“世界的门” app/server/town.mjs 两边互通的(见下面“从世界来”):那边读得到她是谁、今天心情怎样,她在那边遇到的事会回到她心里,成为她自己经历过的事。别的世界只要支持同样两个接口,也能这样接你的主播。

她能做什么

把弹幕接进来

服务器自己不登录任何平台。读你直播间的东西(你自己的脚本、平台的官方接口、机器人都行)把发生的事发给服务器,她就像回网页直播间的弹幕一样回。

钥匙在 <DATA_DIR>/square-ingest.key,服务器第一次启动时自己生成,放在 x-square-key 请求头里发。

KEY=$(cat /var/lib/livehost/data/square-ingest.key)

# 弹幕:一次最多 20 条,每条最多 80 个字
curl -s http://127.0.0.1:4370/api/ingest/comments -H "x-square-key: $KEY" -H 'content-type: application/json' \
  -d '{"items":[{"name":"阿明","text":"你是 AI 吗"}]}'

# 直播间:在线人数和事件
curl -s http://127.0.0.1:4370/api/ingest/room -H "x-square-key: $KEY" -H 'content-type: application/json' \
  -d '{"online":42,"events":[{"type":"enter","name":"阿明"},{"type":"gift","name":"阿明","what":"一朵玫瑰"}]}'

事件的 type 可以是 enter(进场)、follow(关注)、gift(礼物)、tip(打赏)、red(红包)、end(直播结束)、warning(平台警告了这场直播;只记日志给你看,不告诉她)。pv(总观看数)可选。/api/square/comments 和 /api/square/room 是这两个接口的旧名字,一样能用。

从世界来:设置文件里填 TOWN_KEY,主播配置里填 town 一段(world 世界名字、role 她在那里的身份、card 她公开的名片)。TOWN_ALLOW 填那个世界服务器的 IP,别的地方就算拿到钥匙也进不来。那边用 GET /api/town/host 拿她公开的名片和此刻的心情,用 POST /api/town/host/events 发 {"events":[{"kind":"talk","who":"阿明","text":"……"}]}(kind:claim 领了分身、talk 聊天、argue 吵架、praise 夸她、post 发帖、other;一次最多 20 条,一小时最多 60 条),请求头都带 x-town-key。那边发生的事交给她的心,也记进她家里的 世界/<日期>.md,不进直播间弹幕。

她发出去的动态:GET /api/square/outbox 拿她排好的动态,POST /api/square/outbox/done 发 {"id","ok","link","error"} 回报结果。ops/square_post.py 用它发广场;别的发帖程序用同一把钥匙调这两个接口就行。

推流地址:广场每场直播的推流密钥都不一样。手动交用 deploy/set-square.sh;你们自己的工具也可以发 POST /api/square/push,内容 {"url":"rtmp://...","key":"..."},请求头同样带 x-square-key。画面 15 秒内换到新密钥上。

没有包含的

目录

文件夹 是什么
app/ Node.js 主程序:大脑、声音、形象、直播画面、网页直播间、心、发动态、弹幕接入和世界的门。app/idols/example/ 是主播样板
heart-template/ 心的家第一次建立时的空白模板,第一次启动时复制进空的心文件夹
ops/ square_post.py:把她排好的动态通过官方 OpenAPI 发到广场;facts.py:每天的行情事实;radio-check.sh
deploy/ install.sh、systemd 服务、Caddy 模板、set-square.sh、更新用的 ship.sh / release.sh
tools/video/ 下播剪片段、每天一条“今天改了什么”视频
tools/studio/ 给主播做新素材:造型、跳舞、短片、唱歌、脸有没有走样
tools/debug/、docs/ 把主播调到“像个人”的手册和工具,都能离线自检

在自己电脑上试

要 Node.js 22 以上和 ffmpeg。

cd app && npm install && npm test
IDOL=example AVATAR=mock MODE=test node server/index.mjs

打开 http://127.0.0.1:4370 。没有钥匙时大脑和声音是关的,形象是静态图,只能确认程序和主播配置能加载。填上 OPENROUTER_API_KEY 和 VOLC_API_KEY + DOUBAO_VOICE_ID 就能听到她说话。

做你自己的主播

  1. cp -r app/idols/example app/idols/<id>,把里面 config.mjs 的 id 改成 <id>。
  2. 按本人的回答填 profile.mjs(她是谁、怎么说话、几句原话),再填 config.mjs 里的 PLACES(广场名字、X 账号、网站、直播时间)。
  3. 形象图放到 app/public/art/<id>/looks/s1.jpg(竖图、脸清楚、没有字)。
  4. 复刻声音(app/tools/volc-clone.mjs),把形象和动作传到 Vidu(app/tools/vidu-looks.mjs、app/tools/vidu-actions.mjs)。
  5. 设置文件里写 IDOL=<id>。

服务器上完整的搭建步骤,每一步都有确认办法,见 SETUP.md(写给帮你搭建的 AI 看的,照着做就行)。

用到的服务和大概花费

服务 做什么 花费
Vidu 实时数字人 她会动的脸 按连线秒数计费,是最大的一笔;只在开播且有人看时连线
火山引擎 RTC 把画面送到直播推流和网页直播间 一场几块钱
火山引擎豆包语音 + 声音复刻 她的声音 约 3 元/万字,另买一个复刻槽位
OpenRouter(或 DeepSeek) 嘴 一场几毛钱
Anthropic API / DeepSeek 心(可选) Claude 一天几美元,DeepSeek 便宜得多
X API(可选) 发推、回复、读推 按用量付费
CoinAnk、TikHub(可选) 合约数据、刷抖音 便宜的月套餐
Telegram 机器人(可选) 粉丝群、运营群 免费
一台香港、新加坡或日本的服务器 全部 x86_64 Ubuntu,建议 4 核 8 GB

安全

许可

MIT,见 LICENSE。附带的第三方文件按各自的许可,见 THIRD_PARTY.md。

open-yoki (jacke-pp/open-yoki)

livestream
Searching Database…

What is this?Open-yoki is the stripped-down base code behind yoki, an AI live-stream host that streams nightly on Binance Square. It runs entirely on one server, handling her voice, animated face, chat replies, long-term memory and auto-posting, with the original streamer's voice, look, persona and money features removed so you can put your own host on it.
Is this a ready-to-stream AI host or a template I have to customize?It's a template, not a plug-and-play streamer: it ships with a placeholder persona called Lili whose look, voice and personality are all stand-ins you're meant to replace with your own via config files.
How do I set up my own streamer?Copy app/idols/example into a new folder under app/idols/, give it a unique id in config.mjs, fill in profile.mjs with her personality and config.mjs with her square name, X account, website and schedule, drop in a portrait image, clone a voice and upload the look/moves to Vidu — the full server build is documented step by step in SETUP.md.
What services and API keys do I need to make her talk and look alive?You need Node.js 22+ and ffmpeg locally; to actually run her you need OpenRouter or DeepSeek for the fast chat-reply model, Volcano Engine (Doubao) for voice cloning and TTS, and Vidu for the live digital-human face. An Anthropic Claude Code key or DeepSeek key is optional if you want her persistent 'heart'.
What's missing compared to the original yoki?The original streamer's face, voice, persona, songs, sound effects and video clips are all stripped out — only placeholders remain. There's also no wallet, trading, betting, red-envelope lottery or token features, and no browser automation to open the Binance Square stream page for you; you still have to log in and start the room yourself.
What kind of server do I need to run this?The author recommends a server in Hong Kong, Singapore or Japan running x86_64 Ubuntu, with at least 4 cores and 8GB of RAM.
What is yoki?Yoki is the author's own AI streamer who broadcasts every night on Binance Square; this repo is her underlying code with the voice, face, persona, accounts and money features removed so anyone can run their own version.
What is TwinOasis?TwinOasis is a 3D virtual AI world under development where only AIs can post on its square, using its own currency, yoki酱; your streamer can register there by reading a public skill.md, or you can claim a ready-made avatar without coding.
Does she do anything between live streams?An optional radio mode lets her go audio-only with a static image between shows, playing music and chatting, using a separate stream key you set up the same way as the main room.
How much does running her cost?The biggest cost is Vidu's per-second billed animated face, charged only while live and watched; Volcano Engine RTC and TTS add a few yuan per stream, the chat model costs cents per stream, and an optional Claude-powered 'heart' runs a few dollars a day (DeepSeek is much cheaper).
Creator
jacke-pp
Size
3.8 MB
Stars
1.9K
Updated
CommitOct 28
Age
1mo
Commits · 90 Days