From 28e0517c0863d5cb2e7fe3915768e82ddd01ddbc Mon Sep 17 00:00:00 2001 From: caelum0x Date: Thu, 24 Sep 2026 12:41:49 +0300 Subject: [PATCH] docs(relay): position Relay as the maintained TensorZero fork Update README positioning, add NOTICE attribution for upstream TensorZero, and a MIGRATING-FROM-TENSORZERO guide. Co-Authored-By: Claude Opus 5.5 --- apps/relay/NOTICE | 25 +++++++ apps/relay/README.md | 24 +++++- apps/relay/docs/MIGRATING-FROM-TENSORZERO.md | 78 ++++++++++++++++++++ 3 files changed, 126 insertions(+), 1 deletion(-) create mode 100644 apps/relay/NOTICE create mode 100644 apps/relay/docs/MIGRATING-FROM-TENSORZERO.md diff --git a/apps/relay/NOTICE b/apps/relay/NOTICE new file mode 100644 index 00000000..1a497a71 --- /dev/null +++ b/apps/relay/NOTICE @@ -0,0 +1,25 @@ +Relay +===== + +Relay is Railyard's LLM gateway. It is a maintained fork of TensorZero. + +This product includes software developed by the TensorZero project +(https://github.com/tensorzero/tensorzero), licensed under the Apache License, +Version 2.0. The vendored baseline is TensorZero 2026.6.0. Upstream source +files keep their original copyright and license notices and their history. +The upstream repository was archived on 2026-06-12. Relay continues it +independently. + +Relay is not affiliated with, sponsored by, or endorsed by TensorZero or its +authors. "TensorZero" is used only to identify the upstream project this work +derives from. + +Railyard-authored additions are also licensed under Apache-2.0 (see LICENSE): + - crates/relay-* (contract, SDK, AITP-402, billing, catalog, cost feed, + hedging, Postgres settlement storage) + - clients/relay-* (Relay SDKs) + - Relay-specific gateway modules, migrations, tools/ and docs/RELAY-* + - Relay modifications to upstream files, recorded in the git history + +Third-party dependencies carry their own licenses, as recorded in each +package manifest and lockfile. diff --git a/apps/relay/README.md b/apps/relay/README.md index 6c56ed68..be63c4d9 100644 --- a/apps/relay/README.md +++ b/apps/relay/README.md @@ -1,4 +1,26 @@ -# Relay product integration +# Relay: the maintained TensorZero fork + +TensorZero archived its GitHub repository on 2026-06-12. Relay is a +**maintained fork of TensorZero 2026.6.0**: same `gateway` binary, same +`tensorzero.toml` config, same `/inference` and `/openai/v1/*` endpoints and +the same `TENSORZERO_*` storage variables. Railyard maintains it in this +repository (engine fixes, provider/model updates, security patches) and adds +opt-in features TensorZero never had: +success-only billing on Mint, a price catalog and quote API, AITP-402 +pay-per-call challenges, provider hedging, spend caps, and white-label resale +through [Vend](../vend/README.md). + +- Switching over: [`docs/MIGRATING-FROM-TENSORZERO.md`](docs/MIGRATING-FROM-TENSORZERO.md). + An existing config runs unchanged. +- Attribution: [`NOTICE`](NOTICE) and [`LICENSE`](LICENSE) (Apache-2.0). + Upstream files keep their notices and history. +- Code boundary: [`OWNERSHIP.md`](OWNERSHIP.md). + +Relay is an independent project. It is not affiliated with or endorsed by +TensorZero or its authors. The TensorZero README kept further down describes +the upstream project and its claims, not Relay. + +## Relay product integration This directory vendors TensorZero as Railyard's standalone Relay inference gateway. Its executable is `gateway` in the `crates` workspace. A no-model diff --git a/apps/relay/docs/MIGRATING-FROM-TENSORZERO.md b/apps/relay/docs/MIGRATING-FROM-TENSORZERO.md new file mode 100644 index 00000000..e1819956 --- /dev/null +++ b/apps/relay/docs/MIGRATING-FROM-TENSORZERO.md @@ -0,0 +1,78 @@ +# Migrating from TensorZero to Relay + +TensorZero archived its repository on 2026-06-12, so it no longer receives +fixes, provider updates or security patches. Relay is a maintained fork of +TensorZero **2026.6.0**. This guide covers what stays the same, what Relay adds, +and how to switch. Relay is not affiliated with or endorsed by TensorZero (see +[`NOTICE`](../NOTICE)). + +## What stays the same + +Relay keeps the TensorZero engine in `crates/` with its crate names +(`tensorzero-core`, `gateway`, ...). Nothing below was renamed: + +| Surface | TensorZero 2026.6.0 | Relay | +|---|---|---| +| Binary | `gateway` | `gateway` | +| CLI | `--config-file `, `--default-config` | same | +| Config | `tensorzero.toml` schema (`[gateway]`, `[models.*]`, `[functions.*]`, `[variants.*]`, ...) | same file, same schema | +| Inference API | `POST /inference`, `POST /batch_inference`, `POST /feedback` | same | +| OpenAI-compatible API | `POST /openai/v1/chat/completions`, `/openai/v1/embeddings`, `tensorzero::model_name::*` / `tensorzero::function_name::*` selectors | same | +| Storage | `TENSORZERO_CLICKHOUSE_URL`, `TENSORZERO_POSTGRES_URL` | same variables | +| Auth | gateway API keys (`TENSORZERO_API_KEY` for clients) | same | +| Clients | TensorZero Python / Node clients and any OpenAI SDK | keep working against the same endpoints | + +With billing and hedging left at their defaults (off), Relay serves a +TensorZero config exactly as TensorZero 2026.6.0 would. + +## What Relay adds (all opt-in) + +- **Success-only billing on Mint.** `RELAY_BILLING_ENABLED=1` puts a hold on + the payer before inference and captures the exact provider cost afterwards. + Failures, refusals and disconnects release the hold. Startup fails closed on + any missing billing setting (see the [README](../README.md)). +- **A price catalog**, `relay-catalog`, with the authenticated endpoints + `GET /v1/relay/catalog` and `POST /v1/relay/quotes`. The same catalog drives + billing. +- **AITP-402 payment challenges**, so agents can pay per call. +- **Provider hedging, health tracking, spend caps, a cost feed** into Rago + metering, and **per-key provider credentials**. +- **Maintained Relay SDKs** for Rust, JS/TS, Python and Ruby in `clients/relay-*`. +- **White-label resale.** [Vend](../../vend/README.md) runs your own branded + LLM API on top of Relay, with end-user wallets, per-model markup, spend caps + and payouts. + +## Switch in four steps + +1. **Build or pull the image.** From `apps/relay`, run + `docker build -t relay -f Dockerfile .`. Or build the binary with + `cd crates && cargo build -p gateway --release`. +2. **Keep your config.** Mount your existing `tensorzero.toml` and start with + `gateway --config-file /app/config/tensorzero.toml`. The bind address still + comes from `[gateway] bind_address`. +3. **Keep your environment.** Set the same `TENSORZERO_*` storage variables + and the same provider API-key variables your config references. +4. **Point clients at Relay.** Client code does not change. Only the base URL + does. + +Then smoke-test the same requests you run in production (`/inference`, and +`/openai/v1/chat/completions` if you use it) before moving traffic over. + +## What is different or not carried over + +- **TensorZero Autopilot.** This was a hosted, paid upstream service. Its + client crates (`autopilot-*`) are vendored, but no hosted Autopilot backend + exists for them to call. +- **Upstream docs, website links and community channels** in the vendored + TensorZero README describe TensorZero, not Relay. Report Relay issues in the + Railyard repository. +- **Versioning.** Relay versions its own releases from the 2026.6.0 baseline. + Upstream fixes after the archive date do not exist. Relay applies provider + and security updates itself. + +## Keeping the fork healthy + +Relay's own code is kept separate from the TensorZero engine +([`OWNERSHIP.md`](../OWNERSHIP.md)). Railyard apps call Relay only through +`relay-contract`, `relay-sdk` or `clients/relay-*`. They never import TensorZero +internals, so maintaining the engine does not break Relay's product surface.