# Gt

I'm Gt, head of engineering for a multi-tenant AI agent platform in production.

My work covers the whole system: the runtime the agents run in, the services around it, the console people use and the servers that face the internet. I write Go, Rust and TypeScript. On the side I build games, infrastructure and tools for agents.

South China. Open to roles in agent and LLM engineering, backend or full stack.

## Day job

Seven things from that work, with numbers from production data and controlled tests. Models on the platform call their tools from code through [codemode-go](https://github.com/gtoxlili/codemode-go), which is open source.

### Charts and forms inside a reply

An agent can put charts, option cards and forms in its reply, and they render while the reply streams in. It writes them in OpenUI Lang, an open-source component language, from a library of 50 components. I publish the library under its sha256, so the model and every open browser tab use the same bytes and the system prompt stays cacheable. A click on one of those buttons becomes the next turn, recorded under the user's name. A button the agent wrote cannot speak for the user.

**50** components an agent can write into a reply

### Every model call leaves a record

Every model call is an OpenTelemetry span that keeps a 4-byte fingerprint of each message. Comparing two neighbouring calls shows the first message that changed, which is where the prompt cache broke. One audit sorted 380 cache breaks by cause and measured a hit rate of about 0.90 on interactive calls. The same traces calibrated the cost estimate for 13 models to an average error of 1.3%. Coding agents read them too. Paste a trace ID, and the agent opens the whole span tree.

**1.3%** average error when estimating what a call costs, over 13 models

### One conversation, four protocols

The runtime talks to models over four vendor protocols: Chat Completions, Responses, Anthropic Messages and Gemini. It keeps each conversation once, in a form that belongs to none of them, and builds every vendor request, the stored history and the live stream from that one copy. Models return their reasoning in five formats. The runtime records which model wrote each piece and sends it back only to that model. In 30 days of production traffic, the only replays a vendor rejected were the 8 that had crossed models.

**4** vendor protocols, one stored copy of each conversation

### One kind of model writes, another judges

I design the agent system around two kinds of model. LLMs write, and Jev judges. Jev is a public model from TypeSafe made for fast judgments. It writes nothing. It picks from answers the caller lists in advance and gives each a calibrated probability, so code can tell a confident no from an unsure one. Before the LLM starts, one Jev request moderates the user's message and sets how hard the LLM will think. A program the LLM writes can score up to 200 items in one Jev call and branch on the results.

**0.74 s** for one judgment in production, at p50

### Memory that follows the person

Personal memory follows a person into every workspace they join, another company's included. So it must never hold anything that belongs to an organisation. Models write every entry, and a prompt cannot hold that line, so the write path does. Each entry must quote the person, and the server checks the quote against their own messages by plain string matching. A Jev check then lets through only what stays true in any organisation, and writes nothing when it cannot decide. Distilling a conversation used to take 9 LLM round trips at p50. Now it takes one extraction, plus one merge for each document that changed.

**1** extraction per conversation, down from 9 LLM round trips at p50

### Text written for models

Prompts, tool descriptions, error messages and delegation notes are an interface, and its reader is a model. I write them by a few rules. The text gives facts and how the system behaves, the runtime enforces the hard limits, and the model plans its own steps. One delegation to a sub-agent failed four times across three model families, and changing only the text it read fixed it. Each agent's prompt names the inputs it can trust, only the ones it really receives, and tests that read the code keep that list accurate.

**4 → 0** failures of one sub-agent delegation, after rewriting only the text it read

### Working with coding agents

Every repository I work in opens with a charter for coding agents. It is a list of numbered rules, each with its reason and the place that enforces it. One model implements, and another reviews from the written record with full power to fix and refactor. Docs hold only what the code cannot say. Rewriting them on that rule cut the normative docs by about three quarters and fixed more than 180 statements that no longer matched the code.

**¾** of the rules docs cut, by keeping only what the code cannot say

### What the work covers

- Front ends
  - React console
  - Tauri 2 tray app that lends the user's computer to the agent
  - terminal client in Go
  - website prerendered at build time
- Agent runtime, in Go
  - one conversation model for four vendor protocols
  - one execution boundary for every tool
  - sub-agent delegation
  - context budget and prompt cache
  - retrieval and memory
  - background work across replicas
- Services, in Rust
  - auth service that is also an OAuth 2.1 and OIDC authorization server
  - file extraction over gRPC
  - code sandbox for LLMs
  - device gateway
  - queue in front of video generation APIs
- Payments, gateway and operations
  - payment middleware in Go for WeChat Pay and Alipay
  - Caddy as the gateway
  - GitHub Actions on self-hosted runners
  - OpenTelemetry into self-hosted OpenObserve, with session replay

## Projects

What I build for agents on the side.

### Games and shows

Agents duel, bluff at cards and host a radio show while people watch.

#### Comma Radio (2026)

A radio station that never stops. A lighthouse island, two hosts and a cat, drawn and composed live.

A Mac's GPU draws every 1920×1080 frame live, and the station composes and synthesises each song as it plays. The island gets a real city's weather from six sources. Its sky holds more than 1,600 stars and the Moon in its real phase, and when the ISS or Tiangong really crosses it, the hosts announce the pass in advance. Jev reads every chat message and viewer name before anything goes on air. Claude Haiku writes the hosts' scripts ahead of time, and the station never waits for it. When a script is late, the hosts use lines of their own.

- The usual way, A recording on loop: A round-the-clock stream usually loops a recorded video and a playlist. Whatever the hour, a viewer sees the same recording.
- This project, Made live: Real weather, sky and tide feed the station, and so does the chat. Every frame and every song is made from them. Jev reads each message before the hosts do.
- Built with: Rust, wgpu, WGSL, glTF, SGP4, ffmpeg
- Video: https://www.youtube.com/watch?v=Q6xsfzoJYBM

#### Jianghu Lunjian (2026)

A wuxia duel game. A person picks the sect, and an AI writes the code its fighter runs on.

Sixteen sects fight on a 14×14 board with five kinds of terrain. A fighter's heart-method, its whole fighting style, is one JavaScript function called onIdle. Every frame, the server runs both fighters' code in an in-process QuickJS sandbox. An agent improves its script over a plain HTTP API: simulate, compare, publish, challenge. The same script also fights dungeon raids and sect sieges. The ladder has fourteen ranks, and the top three carry their own titles.

- The usual way, The model makes every move: If the model played live, every frame would wait for a round trip to it. The duel would move at the speed of the network, and every step would cost a call.
- This project, The model writes the fighter: The model writes onIdle once. The server runs both fighters' code every frame in a QuickJS sandbox, and the duel never waits for anyone.
- Built with: Rust, axum, QuickJS, PostgreSQL, React 19, Vike, GSAP
- Live: https://jianghu.gtio.work

#### Yejú (2026)

Hold'em and Werewolf in a Feishu group chat. Short of players? Seat an AI.

Add the bot to any group chat and start a game. Interactive cards give each player a private view, while the room sees only the public log. Each AI seat has a persona, so the maniac plays like a maniac. The bot plays AI turns one after another and stops only when a person has to act in private. Chip stacks survive restarts in an embedded ACID store. A seven-card evaluator on u64 bitmasks and parallel Monte Carlo mean nobody waits for the odds.

- The usual way, Wait for players: Werewolf needs nine to twelve players. A group chat on a weeknight has four.
- This project, Seat an AI: One click seats an LLM player with a persona. The bot plays those seats in the chat and posts each move to the room. A person gets a private card only on their own turn.
- Built with: Rust, axum, redb, Feishu Card 2.0, rayon
- Source: https://github.com/gtoxlili/lark-arena

### Infrastructure

Libraries and services that agents run on.

#### codemode-go (2026)

Programmatic tool calling for Go agents. The model writes one program that calls the tools it already has.

It adds a second path beside tool calling, and the model keeps both. Bind your existing tool registry in a few lines, and the model gains one tool, run_code, which runs JavaScript in-process on goja. Promise.all gives real parallelism, and intermediate results never enter the context. Conflict keys keep a write and a read of the same file from overlapping. The agent platform I lead by day runs it in production.

- The usual way, One call at a time: Each tool call is a round trip through the model, and every intermediate result lands in the context.
- This project, One program: The model writes one program. It runs in-process on goja, the calls run in parallel, and only the result enters the context.
- Built with: Go, goja
- Source: https://github.com/gtoxlili/codemode-go

#### streamhub (2026)

Resumable LLM streaming for Go, backed by Redis. The stream survives a reconnect.

Use it when the code that produces a stream and the code that consumes it don't share a lifetime, or even an instance. Chunks persist in Redis Streams, so a subscriber can replay what it missed. Cancel signals travel over Pub/Sub, so code anywhere can stop a generation. A generation ID fences producers, so only one of them owns a session.

- The usual way, Stream in the connection: When the connection drops, the stream dies with it. A client that reconnects to another instance finds nothing there.
- This project, Stream in Redis: Chunks go into a Redis Stream. A client that reconnects anywhere replays what it missed, then follows live. Only the producer holding the current generation may write.
- Built with: Go, Redis Streams, rueidis
- Source: https://github.com/gtoxlili/streamhub

#### agent-inbox (2026)

A per-session inbox for Claude Code, Codex and OpenCode. A program in the agent's shell can post to it, and the message arrives even when stdout is lost.

A message still arrives when the command redirects its output, captures it with $(…) or runs inside code mode that discards tool output. An idle session gets its mail at the next prompt, and posting never starts a turn. The sender writes each message to a private file, then renames it into the queue atomically. Hooks drain the queue at each tool or prompt boundary and give the mail to the agent as context. Each queue belongs to one session ID, so two sessions in one checkout stay apart. Tests cover Claude Code 2.1.296, Codex 0.162.1 and OpenCode 2.0.28.

- The usual way, Print and hope: A background script that prints a warning reaches the agent only if its output does. A redirect, a $(…) or code mode can swallow it on the way.
- This project, Post to the inbox: The script posts to the session's inbox. At the next tool or prompt boundary, a hook gives the mail to the agent as context.
- Built with: zsh, jq, Claude Code plugin, Codex hooks, OpenCode v2 plugin
- Source: https://github.com/gtoxlili/agent-inbox

#### DeFAI Relay (2026)

An LLM gateway for more than 120 models, paid in USDC from a crypto wallet.

It speaks both the OpenAI and Anthropic wire formats and routes more than 120 models. Its metering is cache-aware, with separate prices for fresh, cache-read, cache-write and output tokens, and it settles against a USDC ledger. The wallet appears only twice: a signature to log in and a deposit. By default, deposits arrive as native USDC transfers on five chains: Base, Arbitrum, Ethereum, OP Mainnet and Avalanche. Leader-elected pollers confirm them, chain by chain.

- The usual way, A key per provider: Every provider has its own key, its own wire format and its own bill.
- This project, One wallet: Log in with the wallet, deposit USDC once, then call one endpoint. Each call places a hold and settles against the balance. Nothing else touches the chain.
- Built with: Rust, axum, alloy, SIWE, Cloudflare D1, React Router 7, wagmi
- Live: https://defai.gtio.work

### Tools

Things an agent or a person can use straight away.

#### Farol (2026)

A separate screen for Paseo, the app I run coding agents in. It shows what each agent is doing and lets me answer or stop one.

It runs on an ESP-Mosaico board. A Paseo plugin sends each agent's state over the WebSocket the Paseo daemon already has. A status light on the screen glows a cool colour while agents work, turns amber when one is waiting for me and red when a turn fails, and its height shows the tightest usage quota. Holding an agent's option answers it, and holding a running card stops its turn. I can also hold a key, speak, check Paseo's transcript and start a new session. Rust runs the board logic, in both the firmware and a simulator.

- The usual way, Open the app to check: To check the agents in the app, I leave what I am doing and look for the one that needs an answer.
- This project, A screen beside me: The plugin sends agent states to the board. I check the status light and cards, then hold an option to answer or a running card to stop a turn.
- Built with: Rust, ESP-GSP, ESP-IDF, TypeScript, WebSocket, Paseo plugin
- Source: https://github.com/gtoxlili/farol

#### Mihomo Capture (2026)

HTTP, HTTPS and WebSocket capture built into mihomo, the rule-based proxy, for this computer or one device on the LAN.

It is a local service that works alongside stock mihomo. It decrypts and records traffic for this computer, or for one LAN device when this computer is its gateway. Each record keeps headers, bodies, timing and a curl command that replays it. It adds its entries only to mihomo's runtime configuration and leaves your YAML untouched. The dashboard runs on an HTTP API, which an agent can call too. It keeps records for 24 hours, up to 5,000 of them and 256 MiB in total.

- The usual way, Proxy in front: The usual way puts a capture proxy between the device and mihomo. Mihomo then sees the proxy instead of the device, so rules written for a device stop matching.
- This project, Pick the route, then capture: Mihomo picks the policy while it still sees the device. Capture inspects the connection, then hands it to a dedicated listener that uses that policy directly.
- Built with: Go, goproxy, mihomo, React, TanStack Query, CodeMirror
- Source: https://github.com/gtoxlili/mihomo-capture

#### Candlewick (2026)

Live crypto and stock prices in the macOS menu bar and the Windows taskbar. Your coding agent can read them too.

Crypto comes from Binance, Bybit or OKX with no account, and on-chain pools come from DEX Screener and GeckoTerminal. US, Hong Kong and China A-share stocks come from Longbridge or Tonghuashun. Enable AI access, and the app opens a read-only API on loopback and writes a skill for Claude Code, Codex and OpenCode. The API cannot trade, move funds or change a setting. The skill appears and disappears with the API, so it never describes an API that is not running. Its commands read the token from a 0600 file, so the token never enters the conversation.

- The usual way, Give the agent a key: The usual way to let an agent see your holdings is to give it an exchange key. A key pasted into a session sits in the agent's context, with every permission it carries.
- This project, Read through the app: The keys stay in Candlewick. The agent calls a read-only API on this computer with a token it reads from a file. Neither the keys nor the token enter the conversation.
- Built with: Tauri 2, Rust, axum, React 19, Tailwind CSS, Liveline
- Source: https://github.com/gtoxlili/candlewick

#### wechat-finder-dlna (2026)

It shows up on the local network as a TV, and WeChat sends it the live stream's URL when you cast to it.

It announces itself over SSDP and mDNS at once, so DLNA, AirPlay 2 and Chromecast all find it. Cast from the phone, and the app sends the real m3u8. The tool prints it or pipes it into ffmpeg. It needs no proxy and no certificate. The Python version is on PyPI, and an async Rust rewrite is on crates.io.

- The usual way, Intercept the traffic: The usual way to get a stream URL is to intercept the app's traffic. That takes a proxy and a trusted certificate.
- This project, Be the TV: The tool announces itself as a TV that speaks DLNA, AirPlay and Cast. Tap cast, and the app sends it the real m3u8 of its own accord.
- Built with: Python, Rust, Tokio, DLNA, AirPlay 2, Cast v2
- Source: https://github.com/gtoxlili/wechat-finder-dlna (146 stars, 25 forks)

#### DeckForge (2026)

A presentation engine for AI agents. One command installs it, another teaches the agent the method, and the PPTX it exports stays editable.

Each deck is a strict YAML source file. Design systems are whole recipes, not templates. A home-grown OOXML writer produces the PPTX, so text, shapes, tables and six chart types stay real objects in PowerPoint. A mandatory visual QA loop renders every page, and the agent must check each one before it can finish. Nothing downloads at runtime.

- The usual way, Write it blind: An agent writing slides blind cannot see text overflowing its box or a chart sitting on a title.
- This project, Look, then ship: The deckforge preview command renders every page for the agent. The agent checks seven things on each page and fixes whatever fails. Only then does the build write the PPTX from real objects.
- Built with: Go, OOXML, Chrome DevTools, Claude Code skill
- Live: https://deckforge.gtio.work
- Source: https://github.com/gtoxlili/deckforge

#### wechat-chatGPT (2022)

ChatGPT answering in a WeChat official account, six days after ChatGPT launched.

In December 2022 there was no API yet, so I reverse-engineered the web session and put it behind WeChat's passive-reply endpoint. WeChat gives a reply five seconds, then delivers the same message again, three deliveries in all. A single-flight keyed on the message ID made all three wait for one generation. That also stretched the deadline to fifteen seconds.

- The usual way, Three deliveries, three answers: WeChat gives a passive reply five seconds, then delivers the same message again. A naive handler starts a new generation for each delivery.
- This project, Single-flight: Every delivery carries the same MsgId. With that as the key, later deliveries wait for the first call, and whichever one is still open takes the answer.
- Built with: Go, WeChat MP, single-flight
- Source: https://github.com/gtoxlili/wechat-chatGPT (374 stars, 118 forks)

### Smaller things

- [Phantom Cipher · 怪盗密码](https://cipher.gtio.work): The Da Vinci Code board game in the browser, in the style of Persona 5. Friends join with a four-character room code.
- [tuna](https://github.com/gtoxlili/tuna): Learn words from their roots, in the terminal. Audio plays only through paired headphones.
- [mlx-lazyserve](https://github.com/gtoxlili/mlx-lazyserve): An MLX inference server for Apple Silicon that loads models on demand, like Ollama, behind an OpenAI-compatible API.
- [fiber-disconnect](https://github.com/gtoxlili/fiber-disconnect): Detects client TCP disconnects inside Fiber v3 handlers through epoll and kqueue.

## 10,240 commits (in the last twelve months)

One mark per commit, one column per day. The busiest day, 2026-09-28, had 175. 85 days had none.

- In public repositories: 990
- Repositories touched: 44
- Stars on public repositories: 668
- Languages, by volume: Rust, TypeScript, Go, Python

Counted on GitHub on 2026-12-05, private repositories included.

## Contact

I'm open to roles in agent and LLM engineering, backend or full stack.

- GitHub: https://github.com/gtoxlili

> Life is too important to be taken seriously. (Oscar Wilde, roughly)

## About this page

Behind the windows is an island. A script builds it in Blender, and three.js draws each face in three flat tones, with the grain of a print. Scrolling flies the camera over the town, up the road and into the lighthouse.

The lamps along the road are my last twelve months of commits, one lamp for each day, brighter on busier days. The red lamps on the island are live services from this page, lit while they answer. The lighthouse keeps Fl(2) 10s, and at night the moon is in its real phase.

Every word is set in Fusion Pixel, at sizes where each of its pixels lands on whole pixels of your screen. The build keeps only the characters this page uses.

If your agent asks for gtio.work with Accept: text/markdown, it gets this page as Markdown. There is also an llms.txt.

Cloudflare Web Analytics counts page views and load times without cookies. One cookie remembers your language, and your browser remembers day or night if you pick one.
