How bifangknt/mtga works
MTGA is a Windows/macOS desktop app that exposes a local OpenAI Chat Completions-compatible proxy for IDEs and forwards requests to configured model providers. The main workflow is IDE request → local proxy → provider-specific execution → response; users configure targets and start the services in the GUI. The README documents the UI/actions/services/domain layering and startup certificate and hosts operations. Several backend subsystems are represented from documented capabilities and indexed modules; their internal call wiring was not sampled, so uncertain links are omitted.
Main entry points: commands Application commands · proxy_orchestration.py Proxy orchestration · actions Action handlers · components GUI panels
Components 20
Desktop interface
- GUI panels
app/components - Frontend state
app/composables/useMtgaStore.ts - Tauri API bridge
app/composables/useMtgaApi.ts
Command orchestration
- Application commands
python-src/mtga_app/commands - Action handlers
python-src/modules/actions
Model proxy
- Configuration
python-src/modules/services/config_service.py - Proxy orchestration
python-src/modules/services/proxy_orchestration.py - Proxy server
python-src/modules/proxy/proxy_server.py - Model routing
python-src/modules/proxy/model_routing.py - Upstream adapter
python-src/modules/proxy/upstream_adapter.py - Provider execution
python-src/modules/mlitellm
Local services
- Certificate management
python-src/modules/cert - Hosts management
python-src/modules/hosts/hosts_manager.py - System prompts
python-src/modules/services/system_prompt_service.py - Update checks
python-src/modules/services/update_service.py
Runtime foundations
- User data and resources
python-src/modules/runtime/resource_manager.py - Platform privileges
python-src/modules/platform/privileges.py
Other components
- MTGA user
- Trae IDE
- Model provider
Connections 19
- MTGA user → GUI panels: configures and starts
README.md - GUI panels → Frontend state: uses state
- Frontend state → Tauri API bridge: invokes commands
app/composables/useMtgaStore.ts - Tauri API bridge → Application commands: dispatches commands
- Application commands → Action handlers: routes operations
python-src/mtga_app/commands/model_tests.py - Action handlers → Configuration: uses services
README.md - Action handlers → Proxy orchestration: uses services
README.md - Application commands → Proxy orchestration: starts proxy
python-src/mtga_app/commands/proxy.py - Trae IDE → Proxy server: sends API requests
README.md - Proxy server → Model routing: routes requests
- Model routing → Upstream adapter: selects upstream
- Upstream adapter → Provider execution: executes provider call
README.md - Provider execution → Model provider: forwards request
README.md - Proxy orchestration → Certificate management: prepares certificate
README.md - Proxy orchestration → Hosts management: updates hosts
README.md - Application commands → System prompts: manages prompts
- Application commands → Update checks: checks updates
- Certificate management → User data and resources: uses resource paths
python-src/modules/cert/ca_metadata.py - Hosts management → Platform privileges: uses privileges
python-src/modules/hosts/hosts_manager.py