videogen/docs/relay/REFERENCE-PORTS.md
caelum0x d56639a594
Some checks are pending
build-images / api (push) Waiting to run
build-images / worker-gpu (push) Waiting to run
build-images / web (push) Waiting to run
codeql / Analyze (javascript-typescript) (push) Waiting to run
codeql / Analyze (python) (push) Waiting to run
perf / API hot-path micro-smoke (budgeted) (push) Waiting to run
perf / Desktop engine crates (release build check) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (comfy-workflow-schema) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (effects-core) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (eventbus-types) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (growth-analytics) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (trends-schema) (push) Waiting to run
vision2026-ci / API phase modules (ruff + pytest) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (provider-adapter-kit) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (publishing-connectors) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (render-core) (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (shot-template-schema) (push) Waiting to run
vision2026-ci / Python SDK resource tests (push) Waiting to run
vision2026-ci / Desktop engine crates (test + clippy + fmt) (push) Waiting to run
vision2026-ci / Alembic upgrade + drift check (push) Waiting to run
vision2026-ci / Shared packages (TS≡Python golden parity) (caption-engine) (push) Waiting to run
Menivor — open source release (MIT), free to use and fork
Paid, hosted product at menivor.com, now retired as a company project.
Fresh squashed history of the cleaned working tree (secret-scanned,
no .env, no customer data, no outreach logs). Built on
MoneyPrinterTurbo (MIT, harry0703) — see NOTICE.
2026-12-04 02:10:26 +03:00

4.3 KiB

Relay / Mint — open-source Rust reference ports

Reuse-first (per repo rules): don't hand-roll what proven Apache/MIT Rust projects already do. This maps real OSS to our build. Plans only — nothing vendored yet. License-filtered: prefer MIT/Apache; GPL = study-only, never linked.

Relay (inference gateway) — adopt/port

Project ★ License Role in Relay
tensorzero/tensorzero 11.7k Apache-2.0 Primary skeleton — Rust LLM gateway + observability + evals; closest twin to Relay. Fork/port as the base, graft our Mint settlement + AITP-402 + hedged routing on top.
katanemo/plano (ex-archgw) 7k Apache-2.0 Routing + guardrails data-plane — smart LLM routing, provider failover, PII/guardrails. Reference for relay-router + relay-guardrails.
api7/aisix 108 Apache-2.0 OpenAI-compatible AI gateway by the APISIX team — reference for the OpenAI-compat surface + plugin model.
majiayu000/litellm-rs 105 MIT LiteLLM-in-Rust — 100+ providers via OpenAI format. Mine its provider dialect maps for relay-providers manifests.
jeremychone/rust-genai 853 Apache-2.0 Multi-provider client (OpenAI/Anthropic/Gemini/DeepSeek/xAI/Ollama). Candidate backing lib for relay-providers / relay-normalize.
64bit/async-openai 2k MIT Battle-tested OpenAI request/response/stream types — reuse instead of re-deriving.
EricLBuehler/mistral.rs 7.6k MIT Fast local inference — powers Relay's first-class local/self-host provider.
huggingface/candle 20.9k Apache-2.0 Rust ML framework — local model serving + tokenizers for relay-tokenize.

⚠️ Helicone/ai-gateway (622★, GPL-3.0) — "fastest AI gateway"; likely the project we were half-remembering. Study for ideas only; do NOT vendor/link its code into proprietary Relay (copyleft).

Agent-economy apps (from the ideation workflow) — adopt

Project ★ License Role
0xPlaygrounds/rig 8.3k MIT Rust framework for modular LLM agents — foundation for any agent-marketplace / agent-runtime app that pays via AITP-402.

Mint (AI-token settlement) — NET-NEW (our moat)

None of the above do payments/ledger/settlement. Mint stays built from our own spec (docs/mint/*). We may borrow patterns (append-only ledger, ed25519 receipts) from general Rust crates, but the AIT token + AITP-402 protocol is proprietary differentiation.

DECISION (final): our own gateway + harvested catalog & dialects

We build our OWN gateway engine. We do NOT fork. From the OSS we harvest the two tedious, factual layers and then improve on the engine ourselves — "not stealing, copying-the-facts and improving."

  1. Harvest the provider + model catalog — every provider name, model id, context length, modality, and pricing (prompt/completion/image/request) — from TensorZero + litellm-rs + genai + async-openai + (facts only) Helicone. These are facts/interface, not copyrightable → replicate into relay-catalog + seed ProviderManifest data. This is RP1's grunt work, free.
  2. Study how each provider is called — the per-provider request/response/ stream dialect (auth header, body shape, SSE framing, tool-call format, usage field). Encode each as a data-driven ProviderManifest (config, not code) in relay-providers. Read the OSS to learn the shape; write our own impl.
  3. Write our own improved engine — hedged/SLO-aware routing, Mint settlement, AITP-402, provider-manifest hot-onboarding, semantic cache. This is the moat.
  4. Optional deps only if clearly net-positive: async-openai/genai types (MIT/Apache) may be pulled as libs; otherwise our own types.
  5. Local providers = mistral.rs + candle (MIT/Apache).

License hygiene (non-negotiable)

  • Provider/model names, ids, pricing, API request shapes = facts → free to replicate.
  • Apache/MIT code (TensorZero, litellm-rs, genai, async-openai) → may adapt a snippet with attribution in THIRD_PARTY_NOTICES.md.
  • Helicone = GPL-3.0 → study for which providers / what tricks only; copy no code.

RP0 (already building, clean-room) is exactly "our own gateway" — it stays and is the right foundation. No fork. The harvest above feeds RP1 (multi-provider).