Skip to content

Commit 98f5fa6

Browse files
authored
refactor: rename Mux to Relay (#128)
* refactor: rename Flux to Mux and update Go to 1.27.2 * refactor: centralize Mux version metadata from VERSION * ci: update analysis tools for Go 1.27 * ci: build gosec with Go 1.27-compatible tools * feat: scripted mock provider + benchmarks and llms.txt * refactor: rename Mux to Relay
1 parent 50f8182 commit 98f5fa6

466 files changed

Lines changed: 3772 additions & 3772 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.env.example‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# mux environment variables — copy to .env and fill in
1+
# relay environment variables — copy to .env and fill in
22

33
# Provider credentials, one per registry entry in catalog/registry/providers.go
44
# (registry SortOrder). Or store them in the OS keychain — see
@@ -39,12 +39,12 @@ ANTHROPIC_MODEL=claude-sonnet-4-5
3939
GEMINI_MODEL=gemini-2.0-flash
4040

4141
# Optional: inject custom HTTP headers into every provider request
42-
# MUX_CUSTOM_HEADERS="X-Custom: value1\nX-Other: value2"
42+
# RELAY_CUSTOM_HEADERS="X-Custom: value1\nX-Other: value2"
4343

4444
# Model catalog (dynamic discovery)
45-
# MUX_MODEL_CATALOG_URL=
46-
# MUX_MODEL_CATALOG_PATH=
47-
# MUX_MODEL_CATALOG_REFRESH=
45+
# RELAY_MODEL_CATALOG_URL=
46+
# RELAY_MODEL_CATALOG_PATH=
47+
# RELAY_MODEL_CATALOG_REFRESH=
4848

4949
# Local config/state directory
50-
MUX_CONFIG_DIR=~/.mux
50+
RELAY_CONFIG_DIR=~/.relay

‎.github/CODEOWNERS‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# CODEOWNERS for mux (universal LLM provider runtime)
1+
# CODEOWNERS for relay (universal LLM provider runtime)
22
* @GrayCodeAI/maintainers
33

44
# Engine core

‎.github/ISSUE_TEMPLATE/bug_report.yml‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ body:
1111
of the form as you can — the more we know, the faster we can fix it.
1212
1313
Before submitting:
14-
- Search [existing issues](https://github.com/GrayCodeAI/mux/issues) to avoid duplicates.
14+
- Search [existing issues](https://github.com/GrayCodeAI/relay/issues) to avoid duplicates.
1515
- If this is a security issue, please **do not** file a public issue. See `SECURITY.md`.
1616
1717
- type: textarea
1818
id: what-happened
1919
attributes:
2020
label: What happened?
2121
description: A clear, concise description of the bug.
22-
placeholder: When I call `MuxClient.Chat(...)` against <provider>, I expected X but got Y.
22+
placeholder: When I call `RelayClient.Chat(...)` against <provider>, I expected X but got Y.
2323
validations:
2424
required: true
2525

@@ -30,7 +30,7 @@ body:
3030
description: Minimal Go snippet (or curl/CLI invocation) that reliably reproduces the problem.
3131
render: go
3232
placeholder: |
33-
client := client.Client(&client.MuxConfig{
33+
client := client.Client(&client.RelayConfig{
3434
Provider: client.DetectProvider(),
3535
})
3636
resp, err := client.Chat(ctx, msgs, client.ChatOptions{Model: "..."})
@@ -70,10 +70,10 @@ body:
7070
placeholder: "claude-opus-4-20250514"
7171

7272
- type: input
73-
id: mux-version
73+
id: relay-version
7474
attributes:
75-
label: mux version
76-
description: Output of `mux version` or the `mux.Version` constant / git SHA you built from.
75+
label: relay version
76+
description: Output of `relay version` or the `relay.Version` constant / git SHA you built from.
7777
placeholder: "0.1.0"
7878
validations:
7979
required: true

‎.github/ISSUE_TEMPLATE/config.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
blank_issues_enabled: false
22
contact_links:
33
- name: Security vulnerability
4-
url: https://github.com/GrayCodeAI/mux/security/advisories/new
4+
url: https://github.com/GrayCodeAI/relay/security/advisories/new
55
about: Please report security issues privately via a GitHub Security Advisory. See SECURITY.md.
66
- name: Question / discussion
7-
url: https://github.com/GrayCodeAI/mux/discussions
7+
url: https://github.com/GrayCodeAI/relay/discussions
88
about: Have a question or want to discuss an idea? Open a discussion instead of an issue.

‎.github/ISSUE_TEMPLATE/feature_request.yml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ body:
77
- type: markdown
88
attributes:
99
value: |
10-
Thanks for proposing a feature. mux is the LLM client + skill router
10+
Thanks for proposing a feature. relay is the LLM client + skill router
1111
that backs the graycode-eco ecosystem. Every feature is evaluated against
1212
whether it serves **a single developer** running an AI agent locally.
1313
1414
Before submitting:
15-
- Search [existing issues](https://github.com/GrayCodeAI/mux/issues) to avoid duplicates.
15+
- Search [existing issues](https://github.com/GrayCodeAI/relay/issues) to avoid duplicates.
1616
- For new providers, please open a discussion first — adding a provider
1717
is a long-term maintenance commitment.
1818
@@ -39,15 +39,15 @@ body:
3939
attributes:
4040
label: What problem are you trying to solve?
4141
description: Describe the user problem first. Solutions can come later.
42-
placeholder: When I'm doing X, mux makes me do Y, which costs Z extra tokens / a goroutine leak / ...
42+
placeholder: When I'm doing X, relay makes me do Y, which costs Z extra tokens / a goroutine leak / ...
4343
validations:
4444
required: true
4545

4646
- type: textarea
4747
id: proposal
4848
attributes:
4949
label: Proposed solution
50-
description: How would you like mux to behave? Snippet of API / config / CLI you'd want.
50+
description: How would you like relay to behave? Snippet of API / config / CLI you'd want.
5151
render: go
5252
validations:
5353
required: true
@@ -62,7 +62,7 @@ body:
6262
id: principles
6363
attributes:
6464
label: Developer fit
65-
description: mux avoids enterprise scope. Confirm this feature respects that.
65+
description: relay avoids enterprise scope. Confirm this feature respects that.
6666
options:
6767
- label: Works with zero configuration (sensible defaults).
6868
- label: Does not require a network call to a graycode-eco service.

‎.github/workflows/release.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
# Release workflow for mux (Go library — no binaries).
1+
# Release workflow for relay (Go library — no binaries).
22
# Triggered when a v* tag is pushed; publishes a GitHub Release with
33
# auto-generated notes. Consumers depend on the tag via
4-
# `go get github.com/GrayCodeAI/mux@vX.Y.Z`.
4+
# `go get github.com/GrayCodeAI/relay@vX.Y.Z`.
55

66
name: release
77

‎.gitignore‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Binaries
2-
/mux
2+
/relay
33
bin/
44
*.exe
55
*.test

‎AGENTS.md‎

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# AGENTS.md — Mux
1+
# AGENTS.md — Relay
22

33
Universal LLM provider runtime. One interface for every model. Authentication, routing, streaming, retries, caching — handled.
44

@@ -10,7 +10,7 @@ When starting any new work (feature, fix, refactor, chore), always create a feat
1010

1111
- **Model-agnostic** — single interface for the 28 provider gateways in
1212
`catalog/registry/providers.go` (see README "Supported Providers")
13-
- **Host-neutral engine** — Mux owns provider routing, transport, caching,
13+
- **Host-neutral engine** — Relay owns provider routing, transport, caching,
1414
retry/fallback, and normalized telemetry; hosts own product UX and semantics
1515
- **Streaming-first** — all responses are streamed; blocking is opt-in
1616

@@ -66,7 +66,7 @@ make ci # Full CI suite
6666
method set stable and use it across feature packages
6767
- Streaming tests need careful goroutine management
6868
- `go.work` here should stay minimal; the `graycode-eco` workspace connects
69-
this independent `mux` checkout beside Decoder for local development.
69+
this independent `relay` checkout beside Decoder for local development.
7070
Do not add extra local `replace` directives here without coordinating with
7171
the parent workspace.
7272
- There is usually **no** `go.work` in the parent folder, and that is expected.
@@ -76,33 +76,33 @@ make ci # Full CI suite
7676
decoder against this checkout, use a gitignored module overlay in decoder instead —
7777
`go test -modfile=go.local.mod ./...`. See decoder/AGENTS.md
7878
"Workspace workflow" for the setup. Without that overlay, decoder compiles
79-
against the *published* mux from the module cache, so a green decoder suite
80-
does not exercise local mux changes at all.
79+
against the *published* relay from the module cache, so a green decoder suite
80+
does not exercise local relay changes at all.
8181

8282
## Naming Conventions
8383

8484
- **Provider interface**: `provider/core.Provider` with `Chat()`, `StreamChat()`, `Ping()`, `Name()`
85-
- **Core request types**: `provider/core.MuxMessage`, `MuxResponse`, `MuxTool`, `MuxUsage`
86-
- **Config struct**: `provider/core.MuxConfig` with `Provider`, `APIKey`, `BaseURL`, `Model`, `MaxRetries`
85+
- **Core request types**: `provider/core.RelayMessage`, `RelayResponse`, `RelayTool`, `RelayUsage`
86+
- **Config struct**: `provider/core.RelayConfig` with `Provider`, `APIKey`, `BaseURL`, `Model`, `MaxRetries`
8787
- **Provider implementations**: `provider/adapters/anthropic.go` (`AnthropicClient`), `openai.go` (`OpenAIClient`), `gemini.go` (`GeminiClient`), etc.
8888
- **Compatibility configs**: `provider/adapters.OpenAICompat`, `GrokCompat`, `OpenRouterCompat`
89-
- **Error type**: `MuxError` with `Provider`, `Op`, `StatusCode`, `RequestID`, `Message`, `Err` fields
89+
- **Error type**: `RelayError` with `Provider`, `Op`, `StatusCode`, `RequestID`, `Message`, `Err` fields
9090
- **Stream types**: `StreamResult`, `SSEEvent`, `StreamEvent` — streaming is SSE-based
9191
- **Retry config**: `RetryConfig` embeds `types.RetryConfig` + adds `RetryOn []int` for HTTP status codes
9292
- **Version wiring**: `provider.Version` set via `SetVersion()` from root package — avoids circular import
9393

9494
## API Patterns
9595

9696
- **Provider auto-detection**: `DetectProvider()` checks env vars in priority order (ANTHROPIC_API_KEY, OPENAI_API_KEY, etc.)
97-
- **Client creation**: `provider.NewMuxClient(&core.MuxConfig{...})` or `provider.Client(&core.MuxConfig{...})`
98-
- **Chat method**: `c.Chat(ctx, messages, opts)` — non-streaming, returns `*MuxResponse`
97+
- **Client creation**: `provider.NewRelayClient(&core.RelayConfig{...})` or `provider.Client(&core.RelayConfig{...})`
98+
- **Chat method**: `c.Chat(ctx, messages, opts)` — non-streaming, returns `*RelayResponse`
9999
- **Stream method**: `c.StreamChat(ctx, messages, opts)` — returns `*StreamResult`, caller must `defer sr.Close()`
100100
- **Auto-continuation**: `StreamChatContinue()` transparently retries when `stop_reason == max_tokens`
101101
- **Provider fallback**: `fallback.go` implements fallback chains across providers
102102
- **Rate limiting**: `ratelimit.go` implements token bucket per provider — prevents hitting API limits
103103
- **Semantic caching**: `semantic_cache.go` caches similar prompts — optional, configurable TTL
104104
- **Retry with backoff**: `retry.go` — exponential backoff + jitter, respects `Retry-After` header, retries on 429/500/502/503/529
105-
- **Error hierarchy**: `MuxError` has `IsRetriable()`, `IsAuthError()`, `IsRateLimited()` methods for programmatic handling
105+
- **Error hierarchy**: `RelayError` has `IsRetriable()`, `IsAuthError()`, `IsRateLimited()` methods for programmatic handling
106106
- **SSE parsing**: `parseSSEStream()` reads `bufio.Scanner` with 2MB buffer, emits `SSEEvent` to channel
107107

108108
## Testing Patterns
@@ -125,17 +125,17 @@ make ci # Full CI suite
125125
- **Safe to refactor**: `fallback.go`, `weighted.go` — routing strategies, extend with new strategies
126126
- **Safe to refactor**: `cost_estimator.go`, `cache_analytics.go` — metrics and tracking
127127
- **Do not touch**: `Provider` interface (`Chat`, `StreamChat`, `Ping`, `Name`) — breaking change for all implementations
128-
- **Do not touch**: `MuxMessage`, `MuxResponse`, `ChatOptions` struct field names — serialization contract
129-
- **Do not touch**: `MuxError` struct — used by consumers for error type assertions
130-
- **Do not touch**: `provider/core.MuxConfig` — constructor contract for all consumers
128+
- **Do not touch**: `RelayMessage`, `RelayResponse`, `ChatOptions` struct field names — serialization contract
129+
- **Do not touch**: `RelayError` struct — used by consumers for error type assertions
130+
- **Do not touch**: `provider/core.RelayConfig` — constructor contract for all consumers
131131
- **Safe to extend**: add new provider implementations, new SSE event types, new cache strategies
132132
- **When adding a provider**: create `provider/<provider>.go`, implement `Provider` interface, register in `provider_registry.go`
133133

134134
## Key File Locations
135135

136136
| What | Where |
137137
|---|---|
138-
| Provider interface | `provider/core/core.go` (`Provider`, `MuxConfig`, `MuxMessage`, `ContentPart`) |
138+
| Provider interface | `provider/core/core.go` (`Provider`, `RelayConfig`, `RelayMessage`, `ContentPart`) |
139139
| Chat implementation | `provider/chat.go` (`Chat()`, `StreamChat()`, `StreamChatContinue()`) |
140140
| Host-facing engine facade | `engine/` |
141141
| Provider-neutral core | `provider/core/` |
@@ -153,7 +153,7 @@ make ci # Full CI suite
153153
| Caching | `provider/cache/cache.go`, `provider/cache/semantic_cache.go` |
154154
| Fallback chains | `router/router.go` (fallback providers), `router/deployment_router.go` (fallback deployment stages) |
155155
| Auto-continuation | `provider/resilience/continuation.go` |
156-
| Error types | `provider/core/errors.go` (`MuxError`, `IsRetriable()`, `IsAuthError()`) |
156+
| Error types | `provider/core/errors.go` (`RelayError`, `IsRetriable()`, `IsAuthError()`) |
157157
| Error constants | `types/errors.go` (API error messages, prompt-too-long parsing) |
158158
| Model catalog | `catalog/` (pricing, context windows, capabilities per provider) |
159159
| Credentials | `credentials/` (key storage, env detection, scrubbing) — `HasSecret` is silent on miss (boolean predicate); `LookupSecret` logs `Debug` on `ErrNotFound` and `Warn` on real backend errors |
@@ -162,6 +162,6 @@ make ci # Full CI suite
162162
| Linter config | `.golangci.yml` (govet, ineffassign, misspell — minimal) |
163163

164164
This is an independent repository consumed by Decoder. In the local
165-
`graycode-eco` parent workspace it is checked out beside `decoder` as `../mux`
165+
`graycode-eco` parent workspace it is checked out beside `decoder` as `../relay`
166166
and connected through the parent `go.work`; publish changes here, then update
167167
Decoder's module pin through a separate PR.

0 commit comments

Comments
 (0)