Web2AI API is a local OpenAI-compatible API gateway and desktop application for DeepSeek, Gemini, and Meta AI.
- Desktop UI (
desktop/src/): Manages provider profiles, API keys, gateway status, and a built-in chat playground. - Local Gateway (
desktop/src-tauri/): Runs an embedded HTTP server onhttp://127.0.0.1:8088alongside the desktop app (or standalone viagateway_server). - Unified Routing (
/v1):GET /v1/modelsreturnsprovider:modelIDs across all registered providers, andPOST /v1/chat/completionsdispatches to the matching provider viaProviderRegistry. - Load Balancing & Sessions: Active profiles are selected via Round-Robin (
ProfileLoadBalancer) withX-Session-Idsticky affinity and automatic failover. - Persistence: Profiles, API keys, and session state are stored in local SQLite (
web2ai.db) in the OS application data directory.
web2ai-api/
├── package.json # Root scripts (dev, build, server, test)
├── desktop/
│ ├── src/ # Desktop UI
│ └── src-tauri/
│ └── src/
│ ├── lib.rs # App setup, tray menu, Tauri commands, DB path resolution
│ ├── db/ # SQLite persistence (profiles, api_keys, sessions)
│ ├── load_balancer.rs # Round-Robin & sticky session failover
│ ├── session/ # VirtualSessionManager & session locking
│ ├── chat_service.rs # Chat & SSE streaming execution
│ ├── providers/ # ProviderRegistry + DeepSeek, Gemini, MetaAI
│ ├── server/ # HTTP router (/health, /docs, /v1/*)
│ └── bin/gateway_server.rs # Standalone HTTP server binary
└── docs/ # Project documentation