relay

module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 4, 2026 License: AGPL-3.0

README

Wyolet Relay

A high-throughput LLM router in Go. Put one endpoint in front of every provider, pool your own API keys for failover and higher effective rate limits, and self-host the whole thing. Built for teams running millions of LLM requests a day.

docker run -p 8080:8080 -p 8081:8081 wyolet/relay:standalone

A full relay with Postgres bundled and the catalog pre-seeded — admin UI on :8081, OpenAI/Anthropic-compatible API on :8080. The master key, admin password, and admin token are auto-generated on first boot and printed to the logs (and persisted on the data volume). See Quickstart for your first request.

Why Relay

  • One API, every upstream. OpenAI- and Anthropic-shape endpoints (OpenAI, Anthropic, Bedrock, Vertex, Azure OpenAI, Ollama, Together, Groq, Fireworks — anything speaking either wire protocol). Drop-in for your existing OpenAI/Anthropic SDK code.
  • Key pooling that multiplies your rate limits. Load-balanced, failover across many keys, with per-key circuit breakers (auth / quota / rate-limit / server-error aware). On an upstream auth failure a key is re-resolved out-of-band — the request fails over immediately and the rotated key heals in the background.
  • BYO keys, your secret store. Resolve keys from env, an AES-GCM Postgres store, or fetch-only external backends (AWS / Azure / GCP Secret Manager, Vaultwarden/Bitwarden, 1Password). External secrets stay in memory, never persisted.
  • Infra-grade performance. < 2 ms p50 added latency, 5–10k RPS/pod, k8s-native. Postgres-backed catalog fans out to every pod via NOTIFY/LISTEN in ~1s with zero PG round-trips on the hot path; responses stream byte-for-byte from upstream.
  • Self-hostable, AGPL-3.0. Your keys, your data, your infra. Generated typed OpenAPI for both planes, so clients get full type information free.

Quickstart — first request in ~2 minutes

1. Start the relay (the docker run above). Also on GitHub Container Registry as ghcr.io/wyolet/relay:standalone.

2. Run the setup wizard. Open http://localhost:8081, log in with the admin credentials you set (RELAY_ADMIN_TOKEN / RELAY_ADMIN_PASSWORD). The wizard walks you through adding a provider key and minting a relay key — copy the relay-key plaintext when it's shown (it's shown exactly once).

3. Call it like the OpenAI API:

curl http://localhost:8080/openai/v1/chat/completions \
  -H "Authorization: Bearer <your-relay-key>" \
  -H "Content-Type: application/json" \
  -d '{"model":"gpt-4o","messages":[{"role":"user","content":"hello"}]}'

The bundled image is single-node with embedded Postgres — perfect for a try-out, not for production. For that, run the lean image (wyolet/relay:latest) against a managed Postgres; see other ways to run below.

Status

Area State
Catalog (8 entities, snapshot, NOTIFY listener) Shipped
Admin API (auth, CRUD, sessions) Shipped
Data-plane /v1/* (chat completions, messages, responses, embeddings, models) Shipped
Adapter dispatch per HostBinding Shipped
Canonical protocol pkg/relay/v1/ (typed item array, six-event streams) Shipped (PR #185)
Cross-vendor translation via canonical (Anthropic ↔ canonical ↔ CC verified end-to-end) Shipped (PRs #186–187)
Generic app/adapter/ framework (no per-vendor packages in app/) Shipped (PR #189)
Mock-based smoke (make smoke-mock) Shipped — fixture replay through real Caddy edge
Secret backends (env, stored, AWS/Azure/GCP/Vaultwarden/1Password) Shipped — fetch-only, in-memory; 1Password behind cgo build tag
Secret rotation healing (pipeline.KeyAgent) Shipped — out-of-band re-resolve on auth failure
Catalog /catalog/resolve + /catalog/graph Shipped — snapshot-backed ref expansion + minimal picker graph
Observability emit (OTel + ClickHouse) Scaffolding present; rewiring is roadmap A2
Multi-tenancy (Org/Workspace/Project) roadmap B2
Postgres-backed users + signup roadmap B1; today identity is YAML
Real authz (Casbin) roadmap B3; today is "any authenticated caller can do anything"
Batch API roadmap D

See docs/roadmap.md for the full picture and docs/canonical-protocol.md for the relay-canonical protocol design.

Other ways to run

Official images (:latest lean, :standalone all-in-one, and :<version> tags) are published to Docker Hub (wyolet/relay) and GHCR (ghcr.io/wyolet/relay) by the maintainers; this repository does not build or publish them in CI. To build your own from source, use the Dockerfile / docker-bake.hcl, or docker compose up --build below.

Docker Compose (standalone — bundled services)

Requires Docker. Bundles its own Postgres (plus optional ClickHouse, Valkey, Jaeger), and builds the relay image from source. Run it from the repo root — the root docker-compose.yml wires the whole stack:

cp .env.example .env
# REQUIRED: set a master key in .env — generate one with:
#   openssl rand -base64 32
docker compose up --build

Data plane: http://localhost:5100 · control plane + admin UI: http://localhost:5103. The image bakes in the catalog and seeds it into the bundled Postgres on first boot — no extra steps to get a populated catalog. (You still add your own host keys + a relay key to serve traffic, via the UI or the control API.)

Run from source (dev)

Requires Go 1.25+, Docker, and make. Ephemeral Postgres via compose. Seeding from source needs a local clone of the catalog data — the wyolet/relay-catalog repo's data/ tree (cloned alongside this repo below):

# Catalog data, cloned next to this repo.
git clone https://github.com/wyolet/relay-catalog ../relay-catalog

# Bring the test PG up.
docker compose -f deploy/compose/docker-compose.test.yml up -d --wait

# Run the binary.
RELAY_PG_DSN='postgres://relay:relay@127.0.0.1:5499/relay_test?sslmode=disable' \
  RELAY_AUTO_SEED_IF_EMPTY=1 \
  RELAY_CATALOG_DIR=../relay-catalog/data \
  RELAY_CONFIG_DIR=./config \
  RELAY_PORT=5199 \
  RELAY_CONTROL_PORT=5198 \
  RELAY_STATE_BACKEND=memory \
  RELAY_ADMIN_TOKEN=devtoken \
  RELAY_ADMIN_PASSWORD=devpass-min-8-chars \
  RELAY_COOKIE_SECURE=false \
  go run ./cmd/relay

On first boot the relay auto-seeds the catalog from RELAY_CATALOG_DIR into the empty Postgres (providers, hosts, models, bindings, pricing, policies). Omit RELAY_CATALOG_DIR to start with an empty catalog and populate it via the control API. (The Docker image above bakes the catalog in, so it needs no clone.)

Verify:

# Inference healthcheck (public)
curl localhost:5199/healthz

# Control version (public)
curl localhost:5198/version

# Admin CRUD with break-glass bearer
curl -H 'Authorization: Bearer devtoken' localhost:5198/providers

Tear down:

docker compose -f deploy/compose/docker-compose.test.yml down -v

Architecture

Two listeners on separate ports, sharing one in-memory catalog snapshot:

                ┌───────────────────────────┐
                │   Postgres (truth)        │
                │   + Redis (hot state)     │
                └───────────────────────────┘
                            ▲
                            │ NOTIFY catalog_events
                            │
                   ┌────────┴────────┐
                   │  app/catalog    │
                   │  Snapshot       │  COW reconciler, dependency-ordered
                   │  + Listener     │  apply, debounced ~1s
                   └────────┬────────┘
                            │
        ┌───────────────────┴───────────────────┐
        │                                       │
┌───────▼────────┐                     ┌────────▼────────┐
│ Inference plane│                     │ Control plane   │
│ RELAY_PORT     │                     │ RELAY_CONTROL_  │
│                │                     │ PORT            │
│ /v1/*          │                     │ /auth/*         │
│ /healthz       │                     │ /{kind}/...     │
│                │                     │ /master-key/... │
│ relay-key auth │                     │ session cookie  │
│                │                     │  + admin token  │
└────────┬───────┘                     └─────────────────┘
         │
         ▼
   app/pipeline ────► app/api/<adapter> ────► upstream
   (orchestration)    (wire format)

Component responsibilities (full breakdown in CLAUDE.md):

  • app/catalog — immutable snapshot, COW reconciler, NOTIFY listener. Reads are O(1) by id or by name. Writes go through app/X.Store → PG → NOTIFY → listener → reconciler → atomic snapshot swap.
  • app/pipeline — pure orchestration. Reserve rate-limit budget → pick a host key → call upstream via Adapter.Call → stream response → detached post-flight (commit + RecordSuccess + OnSuccess callback). Knows nothing about catalog snapshots, JSON shapes, or HTTP routing.
  • app/api/{openai,anthropic} — adapter implementations. Build the upstream HTTP request, classify response status for retry, extract usage tokens. Pure shape parsers live separately under pkg/api/<shape> (vendorable).
  • app/httpapi/{inference,control} — huma + chi HTTP layer. Each plane has its own generated OpenAPI spec.

API surface

Inference plane (data plane)
POST   /v1/generate                  relay canonical shape (provider-neutral)
POST   /openai/v1/chat/completions   OpenAI Chat Completions shape
POST   /openai/v1/responses          OpenAI Responses shape
POST   /openai/v1/embeddings         OpenAI Embeddings (byte-pass)
POST   /anthropic/v1/messages        Anthropic Messages shape
GET    /v1/models                    list models accessible to the relay key
GET    /healthz                      liveness + PG ping (public)
GET    /openapi.json                 generated typed spec

Auth: Authorization: Bearer <relay-key>. Relay keys are managed via the control plane.

Namespace convention: each vendor shape is served under its own prefix (/openai/..., /anthropic/...); the bare /v1 namespace belongs to relay's own canonical shape. POST /v1/generate accepts a canonical v1.Request and returns canonical — the provider-neutral surface that carries cross-cutting features like cache_config to any upstream regardless of the model's HostBinding adapter.

Control plane (admin)

Uniform CRUD across eight kinds:

GET    /{plural}                 list
GET    /{plural}/{ref}           read by slug or id
POST   /{plural}                 create (server stamps id + slug)
PUT    /{plural}/by-id/{id}      update
DELETE /{plural}/by-id/{id}      delete

Plurals: providers, hosts, models, host-keys, rate-limits, policies, pricings, relay-keys.

Plus:

POST   /auth/login               username + password → session cookie
POST   /auth/logout              destroy session
GET    /auth/whoami              return the authenticated caller
POST   /master-key/generate      mint a candidate RELAY_MASTER_KEY
POST   /reload                   force full snapshot rebuild from PG
GET    /version                  build version
GET    /openapi.json             generated typed spec

Auth: either a valid relay_session cookie (set by /auth/login) OR Authorization: Bearer ${RELAY_ADMIN_TOKEN} (break-glass).

Configuration

Env var Default Description
RELAY_PG_DSN (required) Postgres connection string.
RELAY_PORT 8080 Inference plane listener port.
RELAY_CONTROL_PORT (empty = off) Control plane listener port.
RELAY_STATE_BACKEND memory memory or redis.
RELAY_REDIS_ADDR (empty) Required when RELAY_STATE_BACKEND=redis.
RELAY_AUTO_SEED_IF_EMPTY (empty) When 1 and PG is empty, seed from RELAY_CONFIG_DIR.
RELAY_CONFIG_DIR config YAML config tree for auto-seed + identity.
RELAY_ADMIN_TOKEN (empty) Break-glass control-plane bearer. Empty disables.
RELAY_MASTER_KEY (empty) 32-byte base64 master key for stored-mode HostKeys. Generate via POST /master-key/generate.
RELAY_COOKIE_SECURE (unset = true) Set to false for HTTP-only local dev.
RELAY_SHUTDOWN_DEADLINE_S 15 Graceful shutdown budget.
RELAY_PG_LOG quiet (standalone image only) Bundled Postgres logs to a file on the data volume, quieted to warnings. Set stdout to stream raw PG logs to the container.
(rich parsing) on Moved to the parsing settings section (PUT /settings/parsing {"richParsing": false}). Hot-reloaded; no env var, no restart.

Auth model

Caller Endpoint Mechanism
Browser → control /auth/*, /{kind}/*, /master-key/*, /reload relay_session cookie (scs + kv-backed)
Operator / CI → control same Authorization: Bearer ${RELAY_ADMIN_TOKEN}
Customer code → inference /v1/* Authorization: Bearer <relay-key>

Passwords are bcrypt-aware: hashes starting with $2a$ / $2b$ / $2y$ go through bcrypt.CompareHashAndPassword; plain-text passwords work for legacy YAML but log a deprecation warning.

Future-proof seams (already wired):

  • app/actor.Actor in context.Context — handlers read it via actor.From(ctx), never the cookie or token directly.
  • app/authz.Authorizer interface — every CRUD mutation routes through Authorize(ctx, action, resource). v1 implementation grants any authenticated caller; swap to Casbin / OpenFGA later without touching handlers.

JWT for programmatic API access is a planned third caller type (docs/roadmap.md B4).

Performance

p50 p99 RPS per pod
Live (real Redis + PG + LB) < 2 ms overhead 10 ms (SLO), 15 ms (public) 5–10k
In-process bench (kv.Mem) < 100 µs < 500 µs

The 18× gap is unavoidable I/O — Redis Lua RTT, LB hop, container network. Bench numbers are the architectural lower bound (regression gate); live numbers are what you can promise customers.

Hot-path rules (CLAUDE.md):

  • Zero PG calls on the request path.
  • One Redis Lua call (rate-limit reserve) is the goal; not three round-trips.
  • Post-flight (Limiter.Commit, Selector.RecordSuccess, OnSuccess) runs in a detached goroutine — never blocks the response.
  • All emits (usage, spans, payload capture) are async via bounded channels with drop-on-full.

Note: the in-process bench harness was retired with the legacy pipeline; a new harness against app/pipeline.Pipeline.Run is docs/roadmap.md A3.

Repository layout

Full breakdown in CLAUDE.md. Short version:

app/                  application: catalog, pipeline, http handlers, 8 entities
pkg/                  shared, vendorable: shapes, ratelimit, kv, ids, slug, ...
internal/             composition root: config, identity, storage, usage
cmd/relay/            binary entrypoint
cmd/litellm-import/   regenerate config YAML from LiteLLM JSON
config/               operator-authored YAML catalog
migrations/postgres/  versioned SQL up + down
deploy/compose/       dev pg, test pg, smoke stack
docs/                 design notes + roadmap + runbook

Development

# Unit tests
go test ./...

# Integration suite (spins up ephemeral pg, tears down)
make test-integration

# Regenerate config YAMLs from LiteLLM
go run ./cmd/litellm-import --out config

# Rebuild the dev stack
make dev

See CONTRIBUTING.md for the build/test workflow, the load-bearing codebase rules, and PR conventions. make lint-rules enforces the canonical-protocol import boundaries (rules 1/2/4/10).

Roadmap

The roadmap is split by product phase — docs/roadmap.md is the index:

  • roadmap-oss.md — the open-source core: batch orchestration, webhooks, new adapters, observability, and launch readiness.
  • roadmap-enterprise.md — on-prem: authN/authz, SSO, audit, HA, air-gap, security-review readiness.
  • roadmap-saas.md — hosted multi-tenant: billing, quotas, tenant isolation, compliance.
  • roadmap-v2.md — beyond v1: the Tool Gateway + icebox.

License

AGPL-3.0. Network use triggers the copyleft — run a modified relay as a service and you must publish your changes. Commercial / enterprise licensing is a separate arrangement.

Directories

Path Synopsis
app
actor
Package actor carries the identity of the caller making a request.
Package actor carries the identity of the caller making a request.
adapter
Package adapter provides the generic adapter framework: a Spec type that bundles wire-shape metadata (inbound URL paths, upstream URL path, auth strategy, canonical translator, token extractor), a generic pipeline.Adapter implementation parameterised by path and auth strategy, a Registry of Specs, and a generic route mounter that iterates registered specs.
Package adapter provides the generic adapter framework: a Spec type that bundles wire-shape metadata (inbound URL paths, upstream URL path, auth strategy, canonical translator, token extractor), a generic pipeline.Adapter implementation parameterised by path and auth strategy, a Registry of Specs, and a generic route mounter that iterates registered specs.
adapters
Package adapters names the wire protocol the relay speaks to an upstream.
Package adapters names the wire protocol the relay speaks to an upstream.
authz
Package authz answers "can this actor perform this action on this resource?" — a deliberate seam so the v1 always-allow implementation can later be swapped for Casbin / OpenFGA / Keto without touching call sites.
Package authz answers "can this actor perform this action on this resource?" — a deliberate seam so the v1 always-allow implementation can later be swapped for Casbin / OpenFGA / Keto without touching call sites.
batch
Package batch is the batch subsystem: it accepts bulk inference submissions, runs each item as a background job (via the jobq module), and exposes submit/poll/cancel/results over the customer-facing /v1 surface.
Package batch is the batch subsystem: it accepts bulk inference submissions, runs each item as a background job (via the jobq module), and exposes submit/poll/cancel/results over the customer-facing /v1 surface.
binding
Package binding is the domain layer for the HostBinding entity — the first-class join that declares "Model M is served by Host H, via wire adapter A, under upstream name U, priced by Pricing P."
Package binding is the domain layer for the HostBinding entity — the first-class join that declares "Model M is served by Host H, via wire adapter A, under upstream name U, priced by Pricing P."
catalog
Snapshot assembly.
Snapshot assembly.
catalogembed
Package catalogembed composes manifest YAML into the SDK catalog embed schema.
Package catalogembed composes manifest YAML into the SDK catalog embed schema.
catalogvalidate
Package catalogvalidate is the cross-entity graph linter for the catalog repo's `data/` tree.
Package catalogvalidate is the cross-entity graph linter for the catalog repo's `data/` tree.
catalogview
Package catalogview builds consumer-facing read projections of catalog data for the admin/UX surface ("API UX"): a model's hosts, its pricing per host, the policies that grant it.
Package catalogview builds consumer-facing read projections of catalog data for the admin/UX surface ("API UX"): a model's hosts, its pricing per host, the policies that grant it.
host
Package host is the domain layer for the Host entity — a serving endpoint the relay forwards requests to.
Package host is the domain layer for the Host entity — a serving endpoint the relay forwards requests to.
hosthealth
Package hosthealth records and reads per-host runtime reachability — the observed-state counterpart to host.Spec.
Package hosthealth records and reads per-host runtime reachability — the observed-state counterpart to host.Spec.
hostkey
Package hostkey is the domain layer for the HostKey entity — a credential the relay uses to authenticate to a Host (a serving endpoint).
Package hostkey is the domain layer for the HostKey entity — a credential the relay uses to authenticate to a Host (a serving endpoint).
httpapi
Package httpapi holds the HTTP layer for both Relay planes.
Package httpapi holds the HTTP layer for both Relay planes.
httpapi/control
GET /catalog/graph — the whole catalog as a minimal graph for the admin model picker.
GET /catalog/graph — the whole catalog as a minimal graph for the admin model picker.
httpapi/inference
Package inference's Dispatch is the shape-agnostic per-request flow.
Package inference's Dispatch is the shape-agnostic per-request flow.
keypool
Package keypool implements per-key circuit-breaker state and configurable Pool selection over healthy keys.
Package keypool implements per-key circuit-breaker state and configurable Pool selection over healthy keys.
manifest
Package wire handles conversion between the operator-facing YAML/JSON wire format and the domain structs in the app/* entity packages.
Package wire handles conversion between the operator-facing YAML/JSON wire format and the domain structs in the app/* entity packages.
meta
Package meta holds the identity primitives every domain entity carries: UUIDv7 id, DNS-1123 slug name, free-text display name, and provenance.
Package meta holds the identity primitives every domain entity carries: UUIDv7 id, DNS-1123 slug name, free-text display name, and provenance.
metricslog
Package metricslog is the Prometheus observer on the lifecycle spine.
Package metricslog is the Prometheus observer on the lifecycle spine.
model
Package model is the domain layer for the Model entity — a container for a family of dated checkpoints (Snapshots).
Package model is the domain layer for the Model entity — a container for a family of dated checkpoints (Snapshots).
modelref
Package modelref parses the catalog reference DSL used by Policy grants and the /catalog/resolve admin endpoint.
Package modelref parses the catalog reference DSL used by Policy grants and the /catalog/resolve admin endpoint.
payloadlog
Package payloadlog is the second lifecycle observer (after app/usagelog): it captures the full request + response bodies of opted-in requests for audit, debug, and replay, and pushes them to a Sink (file today, S3 next) off the hot path.
Package payloadlog is the second lifecycle observer (after app/usagelog): it captures the full request + response bodies of opted-in requests for audit, debug, and replay, and pushes them to a Sink (file today, S3 next) off the hot path.
pipeline
Package pipeline orchestrates one inference request: reserve inbound budget, acquire an upstream key (and its upstream reservation) via policy.Service, call the adapter, stream back, commit in post-flight.
Package pipeline orchestrates one inference request: reserve inbound budget, acquire an upstream key (and its upstream reservation) via policy.Service, call the adapter, stream back, commit in post-flight.
policy
Package policy is the domain layer for the Policy entity — the named group that bundles Models (m:n), ProviderKeys (m:n), and an optional single RateLimit (m:1, the one rule set that applies to traffic through this Policy).
Package policy is the domain layer for the Policy entity — the named group that bundles Models (m:n), ProviderKeys (m:n), and an optional single RateLimit (m:1, the one rule set that applies to traffic through this Policy).
pricing
Package pricing is the domain layer for the Pricing entity — a named rate sheet owned by a Host and applied to one or more Models.
Package pricing is the domain layer for the Pricing entity — a named rate sheet owned by a Host and applied to one or more Models.
provider
Package provider is the domain layer for the Provider entity — the vendor / author of a Model.
Package provider is the domain layer for the Provider entity — the vendor / author of a Model.
proxy
Package proxy is the second inference flow: transparent forwarding of caller-supplied upstream credentials.
Package proxy is the second inference flow: transparent forwarding of caller-supplied upstream credentials.
ratelimit
Package ratelimit is the domain layer for the RateLimit entity — a named rule set (requests / tokens / concurrency caps) attachable to a Policy, ProviderKey, or Model.
Package ratelimit is the domain layer for the RateLimit entity — a named rule set (requests / tokens / concurrency caps) attachable to a Policy, ProviderKey, or Model.
relaykey
Package relaykey is the domain layer for the RelayKey entity — an inbound API key the relay issues to a client.
Package relaykey is the domain layer for the RelayKey entity — an inbound API key the relay issues to a client.
routing
PolicyAllows answers "is this Model reachable through this Policy?" without picking a binding or a key — the question /v1/models needs to answer.
PolicyAllows answers "is this Model reachable through this Policy?" without picking a binding or a key — the question /v1/models needs to answer.
secret
agent.go implements pipeline.KeyAgent: the out-of-band handler for failed upstream keys.
agent.go implements pipeline.KeyAgent: the out-of-band handler for failed upstream keys.
seed
Package seed orchestrates loading YAML config into Postgres for the app/ arch.
Package seed orchestrates loading YAML config into Postgres for the app/ arch.
session
Package session wraps alexedwards/scs/v2 with a kv.Store-backed session store and the small amount of glue that turns scs payloads into our app/actor.Actor.
Package session wraps alexedwards/scs/v2 with a kv.Store-backed session store and the small amount of glue that turns scs payloads into our app/actor.Actor.
settings
Package settings is the typed-sectioned config layer.
Package settings is the typed-sectioned config layer.
settingswatch
Package settingswatch applies a value-typed settings section to a live consumer, re-applying whenever the section changes.
Package settingswatch applies a value-typed settings section to a live consumer, re-applying whenever the section changes.
transport/ws
Package ws is a customer-facing WebSocket transport for the inference data plane.
Package ws is a customer-facing WebSocket transport for the inference data plane.
usagelog
Package usagelog is the first consumer of pkg/lifecycle's Hook + Collector surface.
Package usagelog is the first consumer of pkg/lifecycle's Hook + Collector surface.
bench
fakeanthropic
Package fakeanthropic is a test stub that replays captured Claude Code session responses as a minimal Anthropic Messages API server.
Package fakeanthropic is a test stub that replays captured Claude Code session responses as a minimal Anthropic Messages API server.
fakeanthropic/cmd command
Command fakeanthropic runs a minimal fake Anthropic Messages API that replays captured Claude Code session responses.
Command fakeanthropic runs a minimal fake Anthropic Messages API that replays captured Claude Code session responses.
loadgen command
Command loadgen sends a steady-rate stream of /v1/messages requests at a Relay endpoint.
Command loadgen sends a steady-rate stream of /v1/messages requests at a Relay endpoint.
replay command
Command replay exercises Relay's /v1/messages endpoint against every turn from a captured Claude Code session JSONL.
Command replay exercises Relay's /v1/messages endpoint against every turn from a captured Claude Code session JSONL.
cmd
catalog-embed command
catalog-embed reads the public catalog YAML tree and writes sdk/catalog/catalog.json.
catalog-embed reads the public catalog YAML tree and writes sdk/catalog/catalog.json.
catalog-schemas command
catalog-schemas dumps JSON Schema files for every catalog wire kind, one file per kind under <out>/.
catalog-schemas dumps JSON Schema files for every catalog wire kind, one file per kind under <out>/.
catalog-validate command
catalog-validate runs the schema-generic graph linter (catalogvalidate.ValidateGraph) against a directory of YAML manifests and prints findings.
catalog-validate runs the schema-generic graph linter (catalogvalidate.ValidateGraph) against a directory of YAML manifests and prints findings.
icon-import command
icon-import downloads provider icons from OpenRouter's events/all-providers.json into a target directory (typically the relay-ui repo's public/provider/ folder).
icon-import downloads provider icons from OpenRouter's events/all-providers.json into a target directory (typically the relay-ui repo's public/provider/ folder).
litellm-import command
Package main implements the litellm-import CLI for the new app/ architecture.
Package main implements the litellm-import CLI for the new app/ architecture.
relay command
Command relay is the wyolet-relay data + control plane binary.
Command relay is the wyolet-relay data + control plane binary.
relay-stats command
relay-stats — thin HTTP client for the relay control plane's /usage/events + /usage/summary endpoints.
relay-stats — thin HTTP client for the relay control plane's /usage/events + /usage/summary endpoints.
relay/web
Package web embeds the relay-ui single-page app and serves it from the control plane.
Package web embeds the relay-ui single-page app and serves it from the control plane.
internal
config
Package config centralizes all RELAY_* env var parsing for the relay binary.
Package config centralizes all RELAY_* env var parsing for the relay binary.
identity
Package identity owns the User catalog kind and the SecretRef resolution machinery used to pull credential material out of the environment, files, or (discouraged) inline literals — pydantic-SecretStr style.
Package identity owns the User catalog kind and the SecretRef resolution machinery used to pull credential material out of the environment, files, or (discouraged) inline literals — pydantic-SecretStr style.
storage
Package storage owns the Postgres connection pool and runs migrations.
Package storage owns the Postgres connection pool and runs migrations.
jobq module
migrations
postgres
Package pgmigrations embeds the postgres migration SQL files.
Package pgmigrations embeds the postgres migration SQL files.
pkg
crypto
Package crypto provides AES-GCM-256 encryption primitives and master-key helpers for Relay's stored-secret subsystem.
Package crypto provides AES-GCM-256 encryption primitives and master-key helpers for Relay's stored-secret subsystem.
filter
Package filter is a declarative, allowlist-based query engine for list endpoints.
Package filter is a declarative, allowlist-based query engine for list endpoints.
ids
Package ids generates immutable resource identifiers.
Package ids generates immutable resource identifiers.
kv
lifecycle
Package lifecycle is the in-process hook registry every request-runner (pipeline, proxy, future ws/batch) fires events into.
Package lifecycle is the in-process hook registry every request-runner (pipeline, proxy, future ws/batch) fires events into.
metrics
Package metrics owns the Prometheus registry and the /metrics HTTP handler.
Package metrics owns the Prometheus registry and the /metrics HTTP handler.
payload
Package payload is the storage contract for request/response body capture: the Record shape and the Sink/Reader interfaces its backends satisfy.
Package payload is the storage contract for request/response body capture: the Record shape and the Sink/Reader interfaces its backends satisfy.
payload/clickhouse
Package clickhouse provides a ClickHouse-backed implementation of payload.Sink, payload.Reader, and payload.Closer — the Langfuse-style "text bodies in ClickHouse" backend for the Logs view.
Package clickhouse provides a ClickHouse-backed implementation of payload.Sink, payload.Reader, and payload.Closer — the Langfuse-style "text bodies in ClickHouse" backend for the Logs view.
payload/file
Package file is the JSONL file backend for payload logging: one Record per line.
Package file is the JSONL file backend for payload logging: one Record per line.
payload/s3
Package s3 is the object-store backend for payload logging: one JSON object per Record.
Package s3 is the object-store backend for payload logging: one JSON object per Record.
ratelimit
Package ratelimit implements a sliding-window-counter rate limiter with a two-phase Reserve/Commit API.
Package ratelimit implements a sliding-window-counter rate limiter with a two-phase Reserve/Commit API.
secret
Package secret is the relay's unified secret-resolution layer: a backend-agnostic Ref pointing at a credential, and a Resolver that turns it into plaintext.
Package secret is the relay's unified secret-resolution layer: a backend-agnostic Ref pointing at a credential, and a Resolver that turns it into plaintext.
secret/aws
Package aws resolves secret.KindAWS refs by fetching from AWS Secrets Manager.
Package aws resolves secret.KindAWS refs by fetching from AWS Secrets Manager.
secret/azure
Package azure resolves secret.KindAzure refs by fetching from Azure Key Vault.
Package azure resolves secret.KindAzure refs by fetching from Azure Key Vault.
secret/bitwarden
Package bitwarden resolves KindBitwarden secrets by fetching encrypted vault data from Vaultwarden/Bitwarden and decrypting client-side.
Package bitwarden resolves KindBitwarden secrets by fetching encrypted vault data from Vaultwarden/Bitwarden and decrypting client-side.
secret/gcp
Package gcp resolves secret.KindGCP refs by fetching from GCP Secret Manager.
Package gcp resolves secret.KindGCP refs by fetching from GCP Secret Manager.
secret/onepassword
Package onepassword resolves secret.KindOnePassword refs via the official 1Password Go SDK and a service-account token.
Package onepassword resolves secret.KindOnePassword refs via the official 1Password Go SDK and a service-account token.
slug
Package slug derives DNS-1123-compatible identifiers from free-text display names, with deterministic collision suffixes.
Package slug derives DNS-1123-compatible identifiers from free-text display names, with deterministic collision suffixes.
usage/clickhouse
Package clickhouse provides a ClickHouse-backed implementation of usage.Sink, usage.Reader, and usage.Closer.
Package clickhouse provides a ClickHouse-backed implementation of usage.Sink, usage.Reader, and usage.Closer.
usage/file
Package file is the JSONL file backend for usage logging: a Sink that appends one event per line and a Reader that scans the same file.
Package file is the JSONL file backend for usage logging: a Sink that appends one event per line and a Reader that scans the same file.
usage/postgres
Package postgres implements usage.Sink, usage.Reader, and usage.Closer backed by PostgreSQL.
Package postgres implements usage.Sink, usage.Reader, and usage.Closer backed by PostgreSQL.
usage/valkey
Package valkey is a TTL-bounded usage Sink + Reader backed by pkg/kv.
Package valkey is a TTL-bounded usage Sink + Reader backed by pkg/kv.
sdk module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL