$ show lbjlaq/Antigravity-Manager
Antigravity-Manager is a professional-grade desktop application (Tauri + React + Rust) that serves as an AI account manager and local proxy gateway. It manages multiple AI service accounts (Google Gemini, Anthropic Claude, OpenAI) by handling OAuth token lifecycle, device fingerprinting, quota tracking (5-hour rolling and 7-day weekly buckets), and subscription tier management (Free/Pro/Ultra). The built-in reverse proxy (Axum HTTP server) translates between different AI provider protocols (OpenAI, Anthropic, Gemini), supports streaming, handles rate limiting with adaptive retry, and provides intelligent request routing with account failover. It also syncs its configuration to popular AI CLI tools (Claude Code, OpenCode, Hermes, etc.) and includes a comprehensive monitoring dashboard, IP security filtering (CIDR blacklist/whitelist), user token management, and a warmup scheduler to prevent quota decay. The application runs as a Tauri desktop app with optional headless/Docker mode for containerized deployment.
The LLM identified 4 files worth highlighting for reuse:
Defines a ClientAdapter trait for pluggable client-specific behavior (e.g., OpencodeAdapter). Each adapter implements signature matching strategies (Fifo/Baseline), beta header injection, and thinking-budget fetching. The pattern enables new CLI tools to be supported by implementing a single trait without modifying core proxy logic.
Provides a CanonicalUsage structure that unifies usage metadata from Gemini, Anthropic, and OpenAI protocols. Handles cached/uncached/reasoning token aggregation and scaling (e.g., Claude token scaling). This component cleanly abstracts away provider-specific counting semantics and can be reused in any multi-provider proxy system.
Implements core context management: purification of tool call/result pairs, multi-language-aware token estimation (ASCII ~4 chars/token, CJK ~1.5 chars/token with 15% safety margin), and tool message trimming for aggressive context window bundling. A reusable algorithm for any LLM proxy needing efficient context usage.
Provides AES-256-GCM encryption for sensitive credentials (OAuth tokens, API keys) with keys derived from machine hardware IDs, supporting both legacy and v2 formats. Includes atomic file I/O for safe persistence. Well-isolated and could be extracted into a standalone credential vault helper.