AI Switch is a desktop and self-hosted Web app for AI provider and official account switching.
Current foundation includes:
- Tauri 2 + React + TypeScript desktop shell
- Shared Rust core with desktop and Web transports
- Standalone
ai-switch-serverbinary for browser/mobile access - SQLite foundation schema
- Account, session, terminal, and route-proxy workflows
- Settings stored in
~/.ai-switch/settings.json - Web Service settings with token-protected HTTP access
- Tailscale login entry for private remote access
Install dependencies:
corepack enable
pnpm installRun frontend checks:
pnpm typecheck
pnpm test:runRun Rust checks:
pnpm rust:check
pnpm rust:test
pnpm server:checkRun the desktop app in development mode:
pnpm tauri:devBuild the desktop frontend and installer:
pnpm build
pnpm tauri:buildGitHub Actions can build cross-platform release assets manually from the Release workflow.
Required repository secret:
TAURI_SIGNING_PRIVATE_KEY
Optional repository secret:
TAURI_SIGNING_PRIVATE_KEY_PASSWORD
Run the workflow from GitHub Actions with:
tag: release tag such asv0.1.0release_name: optional display namedraft: keeptruefor review before publishingprerelease: settruefor prerelease builds
The workflow builds signed Tauri desktop bundles, ai-switch-server, ai-switch-tsnet, and latest.json updater metadata for GitHub Releases.
Desktop and browser share one React UI. Desktop uses Tauri IPC. Browser mode uses:
POST /api/:commandGET /ws/events- token auth on both endpoints
- Open Settings
- Choose Web Service
- Set host, port, and access token
- Start the service
- Optionally enable Tailscale and click Login with Tailscale
Default bind is 127.0.0.1:3090. Binding to 0.0.0.0 must be explicit.
Build:
pnpm build
pnpm server:buildRun:
$env:AI_SWITCH_HOST = "127.0.0.1"
$env:AI_SWITCH_PORT = "3090"
$env:AI_SWITCH_TOKEN = "replace-me"
$env:AI_SWITCH_STATIC_DIR = "$PWD\dist"
.\src-tauri\target\debug\ai-switch-server.exeRelease binary path:
src-tauri/target/release/ai-switch-server.exe
Optional environment variables:
AI_SWITCH_HOSTdefault127.0.0.1AI_SWITCH_PORTdefault3090AI_SWITCH_TOKENrequired for API and WebSocket accessAI_SWITCH_DATA_DIRoptional data directory overrideAI_SWITCH_STATIC_DIRfrontenddistdirectory for browser UI
Installed desktop builds ship web assets next to the executable under web/. Standalone server mode can also use AI_SWITCH_STATIC_DIR or a sibling web/ / dist/ folder.
- Every
/api/*and/ws/eventsrequest requires the access token - Tailscale login is manual; the app does not auto-login on startup
- Web access still requires the AI Switch token even over Tailscale
This project may study public behavior, public documentation, and public file formats from related tools.