mtga  by BiFangKNT

Local proxy bypasses IDE model provider restrictions

Created 8 months ago
434 stars

Top 68.5% on SourcePulse

GitHubView on GitHub
Project Summary

MTGA is a local proxy solution designed to bypass IDE restrictions on default model service providers, enabling users to connect to custom OpenAI-compatible APIs. It targets developers and power users seeking flexibility in their AI model backend choices, offering a way to integrate various third-party or self-hosted language models within supported IDEs like Trae IDE.

How It Works

The core mechanism involves setting up a local HTTPS proxy server. This involves generating a self-signed Certificate Authority (CA) and server certificates, trusting the CA on the host system, and modifying the system's hosts file to redirect api.openai.com requests to the local proxy. The Python-based proxy server then intercepts these requests, terminates TLS, and forwards them to a user-configured backend API endpoint, returning the response to the IDE. This approach allows the IDE to communicate with custom APIs as if they were the default OpenAI service.

Quick Start & Requirements

  • Windows: Download and run the MTGA_GUI-v{version}-x64.exe (requires administrator privileges). Fill in API URL and model ID in the GUI. A "one-click start" option automates certificate generation, hosts file modification, and proxy server startup.
  • macOS: Download and install MTGA_GUI-v{version}-aarch64.dmg. Run the MTGA_GUI.app, configure API URL, and use the "one-click start" option. This requires manual trust of the generated CA certificate in Keychain Access and administrator privileges for hosts file modification.
  • Prerequisites: Python 3.10+ recommended, administrator privileges for system modifications (certificate installation, hosts file editing, listening on port 443).
  • Documentation: Links to specific troubleshooting guides for macOS "package corrupted" errors and Trae IDE "add model failed" issues are provided.

Highlighted Details

  • Version 1.2.0 introduced a refactored model mapping architecture, allowing flexible backend model switching via configuration groups and MTGA authentication.
  • Automated testing features for model connectivity and chat completion are included, with detailed logs and asynchronous execution.
  • User experience enhancements include a "test connection" button, masked API key display, and persistent user data storage (configs, certificates, hosts backups) in single-file builds.
  • Supports both GUI-based (Windows, macOS) and script-based (Python) local proxy server setup.

Maintenance & Community

The project references its "Star History" and acknowledges contributions from wkgcass/vproxy for its CA directory. Specific details regarding active maintainers, community channels (like Discord/Slack), or a public roadmap are not detailed in the provided README.

Licensing & Compatibility

The README does not explicitly state the project's license. This omission requires further investigation for compatibility, especially concerning commercial use or linking with closed-source applications.

Limitations & Caveats

The project currently only supports APIs adhering to the OpenAI format. Modifying the hosts file to redirect api.openai.com means the original OpenAI API will be inaccessible through the IDE unless the configuration is reverted. Potential port conflicts on port 443 need to be managed, and administrator privileges are mandatory for setup.

Health Check
Last Commit

2 days ago

Responsiveness

Inactive

Pull Requests (30d)
2
Issues (30d)
8
Star History
87 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems") and David Cramer David Cramer(Cofounder of Sentry).

llmgateway by theopenco

1.6%
791
LLM API gateway for unified provider access
Created 9 months ago
Updated 21 hours ago
Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Luis Capelo Luis Capelo(Cofounder of Lightning AI), and
1 more.

any-llm by mozilla-ai

1.2%
2k
Unified interface for LLM providers
Created 6 months ago
Updated 2 days ago
Feedback? Help us improve.