gtio.work

About

Gt

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

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 ChinaOpen to roles in agent and LLM engineering, backend or full stack.

GitHub ▸

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, which is open source.

  • Charts and forms inside a reply50components an agent can write into 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.

  • Every model call leaves a record1.3%average error when estimating what a call costs, over 13 models

    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.

  • One conversation, four protocols4vendor protocols, one stored copy of each conversation

    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.

  • One kind of model writes, another judges0.74 sfor one judgment in production, at p50

    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.

  • Memory that follows the person1extraction per conversation, down from 9 LLM round trips at p50

    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.

  • Text written for models4 → 0failures of one sub-agent delegation, after rewriting only the text it read

    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.

  • Working with coding agents¾of the rules docs cut, by keeping only what the code cannot say

    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.

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. A red lamp beside a project means its live service is answering right now.

Games and shows

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

Jianghu Lunjian, screenshot, two-colour printComma Radio, screenshot, two-colour print
  • Comma Radio逗号电台2026A radio station that never stops. A lighthouse island, two hosts and a cat, drawn and composed live.
    A round-the-clock stream usually loops a recorded video and a playlist. Whatever the hour, a viewer sees the same recording.

    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.

    Built with Rust, wgpu, WGSL, glTF, SGP4, ffmpeg

    Video ▸

  • Jianghu Lunjian江湖论剑LiveA wuxia duel game. A person picks the sect, and an AI writes the code its fighter runs on.
    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.

    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.

    Built with Rust, axum, QuickJS, PostgreSQL, React 19, Vike, GSAP

    jianghu.gtio.work ▸

  • Yejú夜局2026Hold'em and Werewolf in a Feishu group chat. Short of players? Seat an AI.
    Werewolf needs nine to twelve players. A group chat on a weeknight has four.

    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.

    Built with Rust, axum, redb, Feishu Card 2.0, rayon

    Source ▸

Infrastructure

Libraries and services that agents run on.

DeFAI Relay, screenshot, two-colour print
  • codemode-go2026Programmatic tool calling for Go agents. The model writes one program that calls the tools it already has.
    Each tool call is a round trip through the model, and every intermediate result lands in the context.

    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.

    Built with Go, goja

    Source ▸

  • streamhub2026Resumable LLM streaming for Go, backed by Redis. The stream survives a reconnect.
    When the connection drops, the stream dies with it. A client that reconnects to another instance finds nothing there.

    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.

    Built with Go, Redis Streams, rueidis

    Source ▸

  • agent-inbox2026A 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 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.

    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.

    Built with zsh, jq, Claude Code plugin, Codex hooks, OpenCode v2 plugin

    Source ▸

  • DeFAI RelayLiveAn LLM gateway for more than 120 models, paid in USDC from a crypto wallet.
    Every provider has its own key, its own wire format and its own bill.

    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.

    Built with Rust, axum, alloy, SIWE, Cloudflare D1, React Router 7, wagmi

    defai.gtio.work ▸

Tools

Things an agent or a person can use straight away.

DeckForge, screenshot, two-colour print
  • Farol2026A 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.
    To check the agents in the app, I leave what I am doing and look for the one that needs an answer.

    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.

    Built with Rust, ESP-GSP, ESP-IDF, TypeScript, WebSocket, Paseo plugin

    Source ▸

  • Mihomo Capture2026HTTP, HTTPS and WebSocket capture built into mihomo, the rule-based proxy, for this computer or one device on the LAN.
    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.

    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.

    Built with Go, goproxy, mihomo, React, TanStack Query, CodeMirror

    Source ▸

  • Candlewick2026Live crypto and stock prices in the macOS menu bar and the Windows taskbar. Your coding agent can read them too.
    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.

    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.

    Built with Tauri 2, Rust, axum, React 19, Tailwind CSS, Liveline

    Source ▸

  • wechat-finder-dlna2026It shows up on the local network as a TV, and WeChat sends it the live stream's URL when you cast to it.
    The usual way to get a stream URL is to intercept the app's traffic. That takes a proxy and a trusted certificate.

    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.

    Built with Python, Rust, Tokio, DLNA, AirPlay 2, Cast v2

    Source ★ 144 ▸

  • DeckForgeLiveA presentation engine for AI agents. One command installs it, another teaches the agent the method, and the PPTX it exports stays editable.
    An agent writing slides blind cannot see text overflowing its box or a chart sitting on a title.

    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.

    Built with Go, OOXML, Chrome DevTools, Claude Code skill

    deckforge.gtio.work ▸Source ▸

  • wechat-chatGPT2022ChatGPT answering in a WeChat official account, six days after ChatGPT launched.
    WeChat gives a passive reply five seconds, then delivers the same message again. A naive handler starts a new generation for each delivery.

    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.

    Built with Go, WeChat MP, single-flight

    Source ★ 375 ▸

Smaller things

Phantom Cipher, screenshot, two-colour print
  • Phantom Cipher · 怪盗密码The Da Vinci Code board game in the browser, in the style of Persona 5. Friends join with a four-character room code.
  • tunaLearn words from their roots, in the terminal. Audio plays only through paired headphones.
  • mlx-lazyserveAn MLX inference server for Apple Silicon that loads models on demand, like Ollama, behind an OpenAI-compatible API.
  • fiber-disconnectDetects client TCP disconnects inside Fiber v3 handlers through epoll and kqueue.

9,559 commits

in the last twelve months

One mark per commit, one column per day. The busiest day, 2026-09-28, had 175. 101 days had none.
In public repositories
957
Repositories touched
45
Stars on public repositories
665
Languages, by volume
Rust, TypeScript, Go, Python

Counted on GitHub on 2026-11-17, private repositories included.