Skip to main content

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 API
  • MHUB_CLIENT_ID : Client ID for the Model Hub API
  • MHUB_CLIENT_SECRET : Client Secret for the Model Hub API
  • ONEACCOUNT_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

  1. Optionally:

    • Install the bundled OpenCode configuration in your project by running:
    uvx mhub_proxy --install-config
    

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.

  1. 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"
  1. Use the /connect command in Opencode and choose SecureGPT OpenAI or SecureGPT Anthropic as your provider. You can use any values for the API key as the proxy does not validate it.

  2. 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:

  1. Open Task Scheduler and create a new task.

ts1

  1. In the "General" tab, give the task a name (e.g., "Start mhub_proxy") and select "Run whether user is logged on or not".

ts1

  1. In the "Triggers" tab, create a new trigger that begins "At startup".

ts1

  1. In the "Actions" tab, create a new action that starts a program with the following settings:

    • Program/script: powershell.exe
    • Add arguments:
-NoProfile -ExecutionPolicy Bypass -WindowStyle Hidden -Command "Start-Process -WindowStyle Hidden -FilePath 'powershell.exe' -ArgumentList '-NoProfile -Command uvx mhub_proxy'"

ts1

  1. 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_proxy in the background when needed.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mhub_proxy-1.0.8.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mhub_proxy-1.0.8-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

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

Hashes for mhub_proxy-1.0.8.tar.gz
Algorithm Hash digest
SHA256 78d2d00d59ab7185bd90037a804eae399bfdfebab658aa7ff05eed672f29f57b
MD5 15159b1188ef270deea8d2091bdf8d2c
BLAKE2b-256 f87b6edd612f47c532e2143cf0759779b639af7ebe69e3368687f4ed92ffb4cb

See more details on using hashes here.

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

Hashes for mhub_proxy-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 33194c4b810ccf8d08db3481135b2b5d61660ad151d23b9f9bcf20e435bfa1da
MD5 88d0ee58dbbb9e05398f64eab78da38f
BLAKE2b-256 d62975792a74c7ca68ccf62135eff407ea87df14484656cff9b5d6120a3354a5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page