Skip to content
View cuihuan's full-sized avatar

Block or report cuihuan

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Content in all repositories owned by your account will be closed.
Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. Markdown is supported. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
cuihuan/README.md

cuihuan

I build LLM gateways — and I measure the ones I don't build.

Production routing infra for 100+ models · reproducible benchmarks · evidence over vendor claims

Synthorai awesome-ai-gateway stars followers stack


package main

type Engineer struct {
	Now, Research, Rule, Before string
	Method                      []string
}

// Solo founder. I run an LLM API gateway in production and publish what I learn
// tearing the rest of them apart.
var cuihuan = Engineer{
	Now:      "Synthorai — an LLM API gateway (Go + React, multi-cloud, blue-green on AWS)",
	Research: "how AI gateways actually behave: cost, protocol fidelity, data retention",
	Method:   []string{"black-box probes", "reproducible benchmarks", "dated evidence"},
	Rule:     "Don't trust the claims. Measure the behavior.",
	Before:   "globalization architecture @ DiDi — i18n · l10n · data governance",
}

🔬 Research — measuring the LLM routing layer

Three tools, one thesis: every number about an AI gateway should be reproducible by a stranger.

Project What it measures Try it
awesome-ai-gateway
awesome list
A decision tree over 160+ gateways, an 8-chapter handbook on how they work and fail, a reproducible cost benchmark, and dated evidence behind every claim — including what I exclude and why. CC0, no vendor money, no affiliate links. Data ships as an API; CI-gated; refreshed daily. 🧭 Picker · 💰 Cost calc · 🌐 Live
llm-gateway-bench Black-box probe for any OpenAI-compatible gateway. Point it at a base URL with your own key and it scores you against the best on five axes — trust, price, speed, stability, cache — and fingerprints the behavior underneath. Keys never leave your machine. 🌐 Live
modelprobe
Go
Dependency-free availability prober: one deliberately tiny real call per model, 2xx = up, non-zero exit on any outage so CI goes red. Single static binary, stdlib only. Skips models that already served live traffic — the cheapest call is the one you don't make. 📦 pkg.go.dev

Selected findings

  • 106× cost spread for the identical 100K-token job — $0.03 vs $3.01 — same task, different model behind the same API.
  • Fake streaming: relays that buffer the entire completion, then replay it as SSE. Your TTFT metric is fiction.
  • Model substitution: gateways that answer with a model you didn't ask for, while echoing the name you did.
  • Inflated usage: billed token counts that don't reconcile with what actually went upstream.
  • Who keeps your prompts: a data-retention / ZDR matrix built from terms and probes, not from vendor blog posts.

🏗 Systems — what runs in production

  clients ──▶  gateway (Go)  ──┬──▶  Anthropic · OpenAI · Gemini
                   │           ├──▶  Bedrock · Vertex   (SigV4 / OAuth)
                   │           └──▶  regional & first-party upstreams
                   │
                   ├─ protocol translation .... OpenAI ⇄ Anthropic ⇄ Gemini, SSE both ways
                   ├─ routing ................. priority, failover, per-key channel binding
                   ├─ accounting .............. per-token billing, prompt-cache ledger (Redis + MySQL)
                   ├─ integrity ............... inbound redaction on the bytes that actually leave
                   └─ observability ........... synthetic probes, cost ledger, alerting

  ship: merge → GitHub Actions → blue-green on AWS → probe → report

The interesting problems live in the seams: billing correctness (a cache-hit accounting bug is a refund), protocol fidelity (reasoning params silently downgraded upstream, streams that die mid-JSON), and honest error attribution (never dress up your own 400 as the upstream's 502).


🔌 Upstream — wiring a provider into the agent ecosystem

Open PRs adding a new OpenAI-compatible provider across the agent stack:

BerriAI/litellm · pipecat-ai/pipecat · agno-agi/agno · livekit/agents · langbot-app/LangBot · danielmiessler/Fabric · charmbracelet/catwalk · anomalyco/models.dev · CherryHQ/cherry-studio-docs · yincongcyincong/MuseBot

Earlier work — awesome-privacy-chinese stars lead contributor, privacy-compliance engineering for Chinese tech · 2019_nCov stars outbreak data visualization, 2020.


🧰 Stack


📊 Stats
GitHub stats Activity graph
synthorai.io · open to talking about routing, billing correctness, and anything you can benchmark

Pinned Loading

  1. international-explore/awesome-privacy-chinese international-explore/awesome-privacy-chinese Public

    [WIP]国内隐私合规技术交流

    478 74

  2. awesome-ai-gateway awesome-ai-gateway Public

    ⚡ Awesome AI Gateway — pick an AI gateway from 160+ (LiteLLM, OpenRouter, Portkey, Kong, Higress, new-api, Bifrost) by cost, security & compliance, see what consolidated in 2026, learn how they act…

    HTML 94 41