OpenAI-compatible local proxy for enterprise LLM endpoints
Project description
mhub_proxy
mhub_proxy is a local OpenAI/Anthropic-compatible proxy that lets CLI tools (for example, Opencode) send OpenAI/Anthropic-style requests to SecureGPT.
Requirements:
uv is required to install and run the proxy.
curl -LsSf https://astral.sh/uv/install.sh | sh
Or, using pip:
pip install uv
Install mhub_proxy
Install as a uv tool:
uv tool install mhub_proxy
Required environment variables
Before starting the proxy, define the variables used by mhub_proxy/config.py:
MHUB_API_URL: URL of the Model Hub APIMHUB_CLIENT_ID: Client ID for the Model Hub APIMHUB_CLIENT_SECRET: Client Secret for the Model Hub APIONEACCOUNT_LOGIN_URL: URL of the OneAccount login API
Optional:
MHUB_PROXY_HOST(default:127.0.0.1)MHUB_PROXY_PORT(default:8123)MHUB_PROXY_LOG_LEVEL(default:info)
Run the proxy
Start the proxy with:
uvx mhub_proxy
By default, the proxy runs on http://127.0.0.1:8123.
Use with Opencode
-
Optionally:
- Install the bundled OpenCode configuration in your project by running:
uvx mhub_proxy --install-config
- Or, add an
opencode.jsonfile to the root of your project and configure it to point to the proxy URL (see the Opencode Documentation or this example).
IMPORTANT: Notice how for OpenAI models the API version is included in the model ID, e.g. gpt-5.1-2025-11-13@2025-01-01-preview.
This is required for the proxy to correctly route requests to the Model Hub API.
- Start Opencode from a terminal inside your project directory.
Note: The included opencode.json points Opencode to the local proxy URL:
"baseURL": "http://127.0.0.1:8123/openai"
"baseURL": "http://127.0.0.1:8123/claude"
-
Use the
/connectcommand in Opencode and chooseSecureGPT OpenAIorSecureGPT Anthropicas your provider. You can use any values for the API key as the proxy does not validate it. -
Choose a model from the Model Hub and start using Opencode as normal!
Automatic startup (Windows)
To automatically start the proxy when your PC boots up, you can create a scheduled task:
- Open Task Scheduler and create a new task.
- In the "General" tab, give the task a name (e.g., "Start mhub_proxy") and select "Run whether user is logged on or not".
- In the "Triggers" tab, create a new trigger that begins "At startup".
-
In the "Actions" tab, create a new action that starts a program with the following settings:
- Program/script:
powershell.exe - Add arguments:
- Program/script:
-NoProfile -ExecutionPolicy Bypass -WindowStyle Hidden -Command "Start-Process -WindowStyle Hidden -FilePath 'powershell.exe' -ArgumentList '-NoProfile -Command uvx mhub_proxy'"
- Save the task and run it to verify that the proxy starts correctly.
Notes
- The proxy expects OpenAI chat-completions style traffic from your CLI tool.
- If startup fails, first verify that all required environment variables are set.
- The installed OpenCode plugin checks proxy health at session start and will launch
uvx mhub_proxyin the background when needed.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mhub_proxy-1.0.8.tar.gz.
File metadata
- Download URL: mhub_proxy-1.0.8.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78d2d00d59ab7185bd90037a804eae399bfdfebab658aa7ff05eed672f29f57b
|
|
| MD5 |
15159b1188ef270deea8d2091bdf8d2c
|
|
| BLAKE2b-256 |
f87b6edd612f47c532e2143cf0759779b639af7ebe69e3368687f4ed92ffb4cb
|
File details
Details for the file mhub_proxy-1.0.8-py3-none-any.whl.
File metadata
- Download URL: mhub_proxy-1.0.8-py3-none-any.whl
- Upload date:
- Size: 13.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33194c4b810ccf8d08db3481135b2b5d61660ad151d23b9f9bcf20e435bfa1da
|
|
| MD5 |
88d0ee58dbbb9e05398f64eab78da38f
|
|
| BLAKE2b-256 |
d62975792a74c7ca68ccf62135eff407ea87df14484656cff9b5d6120a3354a5
|