claude-code-mux  by 9j

High-performance AI routing proxy for multi-provider LLM access

Created 2 weeks ago

New!

381 stars

Top 74.8% on SourcePulse

GitHubView on GitHub
Project Summary

Claude Code Mux is a high-performance Rust-based AI routing proxy designed to enhance AI workflows with multi-model intelligence and provider resilience. It targets developers and power users seeking to integrate diverse LLM providers, offering automatic failover, intelligent routing, and cost optimization for seamless AI interaction.

How It Works

This lightweight proxy acts as an intermediary, routing requests to over 18 supported AI providers. It employs Rust for exceptional performance, achieving minimal latency (<1ms overhead) and low memory usage (~5MB RAM). Core functionalities include priority-based provider failover, task-type-based routing (e.g., websearch, reasoning), and regex-driven model name transformation. It maintains full Anthropic API compatibility and supports Server-Sent Events (SSE) streaming for real-time responses.

Quick Start & Requirements

  • Installation: Recommended via pre-built binaries from GitHub Releases. Alternatively, install via cargo install claude-code-mux or build from source (cargo build --release).
  • Prerequisites: Rust 1.70+ required for building from source.
  • Run Command: Execute ccm start to launch the server and access the web-based admin UI at http://127.0.0.1:13456.
  • Configuration: A default config.toml is auto-generated at ~/.claude-code-mux/ on first run.

Highlighted Details

  • Modern Admin UI: Features an intuitive web interface with auto-save and URL-based navigation for managing configurations.
  • OAuth 2.0 Support: Enables FREE API access for Claude Pro/Max, ChatGPT Plus/Pro, and Google AI Pro/Ultra subscribers via their respective OAuth flows.
  • Multi-Provider Ecosystem: Integrates with 18+ providers including OpenAI, Anthropic, Google Gemini/Vertex AI, Groq, and more, with automatic API format translation.
  • Intelligent Routing: Supports dynamic routing based on task type (websearch, reasoning, background, default) and custom regex patterns for model name transformation.
  • Provider Failover: Implements automatic, priority-based fallback to alternative providers when a primary service becomes unavailable.
  • High Performance: Achieves ~5MB RAM usage and sub-millisecond routing overhead due to its Rust implementation.
  • Unified API: Offers full compatibility with the Anthropic Messages API, simplifying integration.

Maintenance & Community

Contribution is encouraged via GitHub issues for bug reports and feature requests, and pull requests for code submissions. Detailed contribution guidelines are available in the repository.

Licensing & Compatibility

The project is released under the permissive MIT License, allowing for broad compatibility and commercial use without significant restrictions.

Limitations & Caveats

While robust, advanced configuration of routing rules and regex patterns may require a learning curve. The system's reliability is dependent on the availability and API consistency of the integrated third-party providers. OAuth setup involves browser-based authorization flows.

Health Check
Last Commit

1 week ago

Responsiveness

Inactive

Pull Requests (30d)
5
Issues (30d)
10
Star History
381 stars in the last 14 days

Explore Similar Projects

Feedback? Help us improve.