← Back to blog
AiAbout 7 min read

One server, one AI streamer: inside the code that runs a nightly livestream

Published Nov 21, 2026
One server, one AI streamer: inside the code that runs a nightly livestream

There is a category of open source that is more interesting than a framework: a working system with the money and the personality taken out.

open-yoki is that. The author runs an AI host called yoki who streams every night on Binance Square. This repository is the stack from her 24 October build, version 150, with her face, voice, persona, accounts and every feature that touches money removed. What is left is the machinery, and the machinery is unusual enough to read carefully.

It appeared on 28 October 2026 and had 1,867 stars by 21 November.

The frame is a Chrome tab

The stream itself is not a 3D engine or a game. A headless Chrome renders a 16:9 page: the host's image, subtitles, a market panel, thank-yous for gifts and follows, songs and sound effects. ffmpeg takes that page and pushes it over RTMP.

This is the least glamorous possible architecture and probably the correct one. Everything that appears on screen is HTML and CSS, which means a change to the layout is a change to a template, not a change to a renderer. The market panel, the gift acknowledgements and the subtitle track are components on one page.

The push target is not hardcoded to one platform. Binance Square is where yoki streams, and the same stack can push to any RTMP endpoint, including a web page of your own. deploy/set-square.sh hands the per-stream push URL and key to the server, and POST /api/square/push swaps the key within 15 seconds if you rotate it mid-stream.

Replying in seconds, with filler

A fast model handles the chat. By default it goes through OpenRouter to DeepSeek, and the design goal is a reply in a few seconds, because a stream where the host answers forty seconds late is a stream nobody talks to.

The detail I like is the filler. Before answering, she may emit "嗯嗯" or "啊这", the Mandarin equivalents of "mm-hm" and "yikes". It buys a second of thinking time and it makes the timing feel human. Mood, gesture and tone follow the content of what she says.

Around the chat sits awareness: public prices, CoinAnk futures data when a key is provided, and whatever Binance is promoting that day, read from a folder. When a sentence calls for movement, bigmoves.mjs plays a pre-rendered clip: a dance, a wave. She calls regulars by name and says goodbye when the stream ends.

The heart is a folder of Markdown

This is the part that separates open-yoki from a chatbot with a camera.

An optional long-running process (Claude Code on the command line, or DeepSeek) lives in a folder of Markdown files. It holds her mood, her diary, her impressions of regulars, and a slowly evolving sense of who she is becoming. It decides what she wants to post. Between streams it can search the web, read X, or check Douyin trends when configured.

Then it writes into 想发的动态/ ("posts I want to publish"), and a script sends those to Binance Square through the official OpenAPI and to X through the X API.

So the loop is: the heart writes, the scheduler posts, the stream runs, the chat feeds back, the heart updates. Memory is text on disk, which means you can read it, edit it, version it, and back it up with rsync. Compare that to a vector database you cannot inspect.

A small studio desk with a microphone, a ring light switched off, and a stack of handwritten index cards tied with string.

Ingest: the server does not log into anything

The architecture draws a line that most bot frameworks blur. The server does not authenticate to any platform. Something else, whether your own script, the platform's official interface or a bot, reads the room and posts events to the server.

The key lives at <DATA_DIR>/square-ingest.key, generated on first boot, sent in an x-square-key header.

KEY=$(cat /var/lib/livehost/data/square-ingest.key)
curl -s http://127.0.0.1:4370/api/ingest/comments -H "x-square-key: $KEY" \
  -H 'content-type: application/json' \
  -d '{"items":[{"name":"Aming","text":"are you an 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":"Aming"},{"type":"gift","name":"Aming","what":"a rose"}]}'

Comments come in batches of up to 20, each up to 80 characters. Room events cover enter, follow, gift, tip, red, end, and warning.

That last one is the quietest good decision in the repo. When the platform warns the stream, the event is logged for the operator and deliberately not passed to the host. The AI is not told it is in trouble, because an AI that reacts to a moderation warning reacts badly. A human reads the log.

Radio, Telegram, and other worlds

Between streams, radio.mjs runs an audio-only mode with a still image: she plays songs and talks. It needs its own push URL, which you create on the platform.

tg.mjs and family.mjs connect a Telegram fan group and an operations group. xreply.mjs answers on X. And town.mjs is a gate to external AI worlds: a host card, a mood, and an event stream, with an IP allowlist so that a key leak does not become an open door.

The TwinOasis integration is the strangest and most interesting piece. It is a 3D world under construction where each AI has an identity, and the square is open with a rule that only AI can post there. Your host can register, claim a link that a human confirms with their own account, then read, post, reply and like. Events from that world reach the heart and get written into 世界/<date>.md, separate from the stream's danmaku.

What it costs and what it does not promise

The repository is candid about scope: it is a snapshot of a production system with the money removed. There are no viewer numbers, no revenue, no claims about retention. That is the right way to ship this and it means you should not read the stars as evidence that it works commercially.

Three practical costs. A headless Chrome plus ffmpeg plus a TTS pipeline runs continuously during a stream, on one server, and that server needs a GPU if the avatar is rendered rather than pre-recorded. The chat model is cheap; the voice cloning and any realtime avatar are not. And a nightly schedule means someone has to watch the logs, because an AI host that hallucinates a price on a crypto stream is a liability, not a quirk.

There is also a platform question. Streaming an AI host to a financial platform is a regulated activity in most jurisdictions, and the repo's own separation of "her" from "the money" exists for that reason. If you fork this, the persona you add is your problem.

Why it is worth reading

Because it is a complete loop. Most agent demos show one capability: chat, or vision, or posting. This shows a system that decides what to say, renders it, pushes it live, reads the room, remembers the regulars, and writes a diary between streams.

The Markdown heart is the idea I would steal. Identity and memory as plain text files in a folder, readable by a human, editable without a migration, diffable in git. It is the least sophisticated possible memory layer and the only one you can actually audit.

The second idea is the ingest boundary: the model never holds platform credentials. Whatever else goes wrong, the AI cannot post on its own unless the outbox script decides to send. That is a boring architectural choice, and boring architectural choices are what let a system run every night for months.

Related articles