How lazygophers/aidog works
AiDog is a local-first Tauri desktop AI API gateway. Users configure provider credentials and routing groups in the UI, point an AI client at the local proxy, and receive routed, converted upstream responses; requests are also metered and logged for monitoring. The README documents provider aggregation, failover/load balancing, model mapping, middleware, protocol conversion, coding-assistant integrations, MCP/Skills, encrypted import/export, and backups. The graph combines those documented capabilities with sampled frontend and Rust paths; several subsystem links are omitted where source wiring was not sampled.
Main entry points: mod.rs Local SQLite · handler.rs Proxy handler · App.tsx App shell · forward.rs Request forwarding
Components 23
Desktop management
- App shell
src/App.tsx - Platform setup
src/pages/platforms/usePlatformForm.ts - Platform controls
src/components/platforms/usePlatformCards.ts - Group management
src/pages/Groups/usePlatformDrag.ts - System settings
src/pages/AppSettings/useSystemSettings.ts
Gateway runtime
- Proxy handler
src-tauri/crates/aidog_core/src/gateway/proxy/handler.rs - Request forwarding
src-tauri/crates/aidog_core/src/gateway/proxy/forward.rs - Group routing
src-tauri/crates/aidog_core/src/gateway/proxy/group_info.rs - Middleware rules
src-tauri/crates/aidog_core/src/gateway/proxy/middleware_body.rs - Provider adapters
src-tauri/crates/aidog_adapter/src/lib.rs - Protocol conversion
src-tauri/crates/aidog_adapter/src/converter/mod.rs - Local kernel
src-tauri/crates/aidog_kernel/src/main.rs
Assistant integrations
- MCP management
src/pages/Mcp/useMcpData.ts - Skills management
src/pages/Skills/useSkillsData.ts - Coding assistant setup
src-tauri/crates/aidog_core/src/gateway/codex.rs
Monitoring and data
- Usage statistics
src-tauri/crates/aidog_stats/src/query_stats.rs - Request logging
src-tauri/crates/aidog_core/src/gateway/proxy/log.rs - Local SQLite
src-tauri/crates/aidog_core/src/gateway/db/mod.rs - Backup scheduling
src-tauri/crates/aidog_backup/src/scheduler.rs - Import and export
src-tauri/crates/aidog_core/src/gateway/import_export/mod.rs
Other components
- Administrator
- AI client
- AI providers
Connections 26
- Administrator → App shell: manages
- App shell → Platform setup: opens setup
- App shell → Group management: opens groups
- App shell → System settings: opens settings
- Platform setup → Local SQLite: saves config
- Group management → Local SQLite: updates membership
- Platform controls → Local SQLite: updates platform
- AI client → Proxy handler: sends request
- Local kernel → Proxy handler: starts
- Proxy handler → Middleware rules: applies rules
- Proxy handler → Group routing: selects group
- Proxy handler → Request forwarding: dispatches
- Request forwarding → Protocol conversion: converts request
- Request forwarding → Provider adapters: selects adapter
- Provider adapters → AI providers: calls API
- AI providers → Request forwarding: returns response
- Proxy handler → Request logging: records request
- Proxy handler → Usage statistics: records usage
- Usage statistics → Local SQLite: queries
- Request logging → Local SQLite: writes logs
- System settings → Local SQLite: persists settings
- MCP management → Local SQLite: manages config
- Skills management → Local SQLite: manages records
- Coding assistant setup → Local SQLite: reads configuration
- Backup scheduling → Local SQLite: backs up
- Import and export → Local SQLite: imports and exports