Skip to content

Repository files navigation

AI Router

AI Router

One local gateway. Four AI protocols. Any model.

Route OpenAI, Anthropic, Gemini, and compatible model APIs through one local endpoint.

English · 简体中文

Release Build License

Setup

macOS or Linux:

curl -fsSL https://raw.githubusercontent.com/soooooollee/ai-router/main/install.sh | sh

npm on macOS, Linux, or Windows:

npm install --global https://github.com/soooooollee/ai-router/releases/latest/download/airoute-cli.tgz

Homebrew on macOS or Linux:

brew install soooooollee/ai-router/airoute

Or build from source with Go 1.24+:

git clone https://github.com/soooooollee/ai-router.git
cd ai-router
make build
export PATH="$PWD/bin:$PATH"

Create the configuration and start AI Router:

air init
air start

The default configuration is stored in the operating system's user configuration directory, not the current working directory: %AppData%\airoute\airoute.yaml on Windows, ~/Library/Application Support/airoute/airoute.yaml on macOS, and usually ~/.config/airoute/airoute.yaml on Linux. Use --config PATH or AIROUTE_CONFIG to override it.

Web console: http://127.0.0.1:12667.

Model gateway: http://127.0.0.1:12666.

Useful commands:

air init       Create airoute.yaml in the user configuration directory
air start      Start in the background
air stop       Stop the background instance
air restart    Restart the background instance
air logs -f    Follow background logs
air serve      Run in the foreground for debugging
air status     Show runtime status
air ui         Open the Web console
air check      Validate airoute.yaml
air doctor     Run configuration diagnostics
air client-state backup           Back up managed clients, usage, audit data, and the local credential master key
air client-state verify --backup  Verify a client-state backup before restore
air client-state restore --backup Restore a verified backup while AI Router is stopped
air --help     Show all commands

License

AI Router is licensed under the MIT License.

About

Local-first AI protocol gateway and model router for OpenAI, Anthropic, and Gemini APIs

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages