How edward-lyz/codex-mixin works
Codex Mixin is a cross-platform local gateway and control plane for connecting custom model providers to official Codex and other clients. The main request path is a client calling the local API, where the server handles authentication and protocol-specific requests, the gateway routes model work, and upstream transport communicates with providers. Users also manage providers, models, configuration, and service state through CLI/TUI and desktop controls. The README documents Fusion, client integrations, and usage/benchmark observability; their detailed wiring is not fully visible in the sampled source.
Main entry points: routes.rs HTTP routes · cli/mod.rs CLI commands · server/mod.rs Request handlers · router.rs Model routing
Components 23
User controls
- CLI commands
src/cli/mod.rs - Terminal console
tui/mod.rs - macOS controls
macos/MenuBarApp.swift - Windows app
windows/windows/runner/main.cpp - Service lifecycle
src/cli/service.rs
Gateway runtime
- HTTP routes
src/server/routes.rs - Request handlers
src/server/mod.rs - Protocol conversion
src/protocol/mod.rs - Model routing
src/gateway/router.rs - Upstream transport
src/upstream/mod.rs
Providers and models
- Provider registry
src/provider/registry.rs - Model discovery
src/provider/discovery.rs - Model catalog
src/catalog/service.rs
Configuration and telemetry
- Config management
src/config.rs - Encrypted config
src/config/storage.rs - Capability state
src/provider/capabilities/storage.rs - Usage and benchmarks
src/server/routes.rs
Integrations and Fusion
- Fusion workflow
src/fusion/engine.rs - Client integration
src/clients/mod.rs - Client configurations
src/clients/files.rs
Other components
- Codex and clients
- Operator
- Model providers
Connections 24
- Codex and clients → HTTP routes: API requests
- HTTP routes → Request handlers: dispatches
- Request handlers → Model routing: routes models
- Request handlers → Protocol conversion: converts protocols
- Model routing → Provider registry: resolves providers
- Model routing → Upstream transport: sends requests
- Upstream transport → Model providers: calls upstream
- Operator → CLI commands: runs commands
- Operator → Terminal console: uses console
- Operator → macOS controls: uses controls
- Operator → Windows app: uses controls
- Terminal console → CLI commands: invokes commands
- CLI commands → Config management: manages settings
- Config management → Encrypted config: reads and writes
- CLI commands → Provider registry: manages providers
- Provider registry → Model discovery: discovers models
- Model discovery → Capability state: stores probe state
- Service lifecycle → HTTP routes: starts gateway
- Service lifecycle → Client integration: syncs models
- Client integration → Client configurations: updates files
- HTTP routes → Model catalog: serves catalog
- HTTP routes → Usage and benchmarks: serves metrics
- Operator → Fusion workflow: requests review
- Fusion workflow → Upstream transport: runs model stages