Wiremux Wiremux
Install Wiremux with WinGet
winget install --id=Wiremux.Wiremux -e Wiremux maps Chat Completions, Messages, Responses, Gemini, and Converse through one IR.
winget install --id=Wiremux.Wiremux -e Wiremux maps Chat Completions, Messages, Responses, Gemini, and Converse through one IR.

Wiremux turns Chat Completions, Messages, Responses, Gemini, and
Converse into one in-process request (IrRequest), then writes
another dialect. The same TOML profiles refresh vendor tokens. Your
application still runs the tool loop.
| Crate | Job |
|---|---|
wiremux (docs) | Dialect maps (decode / encode / stream) plus optional CLI and loopback proxy |
wiremux-auth (docs) | Profile catalog and TokenProvider (static, OAuth, GCP, Azure, AWS) |
Maps-only hosts depend on wiremux with default-features = false.
That path does not pull clap, tokio, reqwest, or aws-lc.
This repository may be ahead of crates.io. Host attach notes in
docs/CONSUME.md pin the published cut.
MSRV is 1.95 (see rust-toolchain.toml).
cargo add wiremux --no-default-features
cargo add wiremux-auth
CLI and proxy:
cargo install wiremux --locked
GitHub Release archives, provenance, and the other installers are
described in SUPPORT.md.
Decode a vendor JSON body into IrRequest, then encode another wire.
The profile supplies vendor quirks. The load below skips shipped and
user profiles, so encode uses an empty quirk set.
use wiremux::{LoadOptions, Wire, decode, encode, load_profile_for_wire};
let src = br#"{"model":"gpt-4o","messages":[{"role":"user","content":"ping"}]}"#;
let (ir, _loss) = decode(Wire::ChatCompletions, src).unwrap();
let profile = load_profile_for_wire(
Wire::Messages,
&LoadOptions {
include_shipped: false,
include_user_config: false,
..LoadOptions::default()
},
)
.unwrap();
let (_out, _loss) = encode(Wire::Messages, &ir, &profile).unwrap();
Encode-side loss is preserve, degrade, drop, or harderror.
Run the same program from this tree:
cargo run -p wiremux --example remap --no-default-features
That example prints the encoded JSON. Loss, when there is any, is the Debug form of the report on stderr.
wiremux map prints the encoded body on stdout and one stderr line
per change. It has no --dump-loss flag.
degrade sampling.max_tokens: messages requires max_tokens
wiremux map --from chat --to messages request.json
Wires: chat-completions (CLI also accepts chat), messages,
responses, gemini, converse. Profile TOML uses
wire = "chat-completions", not wire = "chat".
Shipped vendors are ordinary TOML. A gist uses the same schema, so a
rotated token URL, client id, or beta header does not need a crate
release. A profile cannot run a command or treat a URL as a script.
$VAR, ${VAR}, and {env:VAR} expand to environment variables.
wiremux profile list
wiremux profile validate openai
wiremux auth status openai
| Situation | Result |
|---|---|
No profile id (--profile or the positional argument) | Exits 1 |
Profile login field | The command follows that field |
openai-codex-oauth | Exits 2. Shipped login is none until a public Wiremux client id exists. Set pkce or device, and a client id. |
login = "setup-token" (shipped Anthropic) | Prints setup_token_hint and exits 2 |
wiremux profile ingest writes user-dir profiles from
models.dev (default) or LiteLLM
(--source litellm). --dry-run prints the paths and does not
write. Catalog misses fail closed.
wiremux profile ingest --dry-run
Loopback only (127.0.0.1). Incoming harness dialect is --from.
Upstream comes from --profile.
wiremux proxy --from chat-completions --profile ollama --dump-loss
The default listen address is 127.0.0.1:0. After bind, stdout prints
listening on 127.0.0.1:. Point the harness at that address.
A bad --listen value and --read-timeout-secs 0 are reported
before the profile is loaded.
--dump-loss prints loss.encode: plus each loss event on stderr
per request.
How a host application should pin, wrap TokenProvider, and map at
the adapter boundary: docs/CONSUME.md.
Architecture (IR, loss, what stays in the host):
docs/ARCHITECTURE.md.
Copy-paste examples: examples/.
0.x. Public IR and error enums are #[non_exhaustive]. Dual license
MIT OR Apache-2.0.
This crate is not a LiteLLM clone, not a desktop switcher, and not a subscription pool. It does not ship a public Claude-Pro-in-Codex, Cline, or OpenCode preset.
See CONTRIBUTING.md. make check is the local
gate. Commits need git commit -s (DCO). Questions:
SUPPORT.md. Maintainer rules:
GOVERNANCE.md.
Security reports go to SECURITY.md, not a public
issue.