Professional CLI toolkit for Modal GPU workflows, account management, and billing visibility
Project description
m-gpux
Professional CLI tooling for ModalGPU workflows: account profiles, interactive runtimes, web hosting, Docker Compose deployments, model serving, vision training, sessions, and billing visibility.
Highlights
- Interactive GPU Hub for Jupyter, Python scripts, browser Bash sessions, and vLLM inference.
- Runtime selection for Modal images, including Python 3.10, 3.11, 3.12, 3.13, 3.14, or a custom supported version.
- Docker Compose deployment on Modal with subprocess, VM, and sandbox multi-container modes.
- VS Code extension support for launching Hub workflows from the editor.
- Web hosting for ASGI, WSGI, and static sites with persistent Modal URLs.
- OpenAI-compatible LLM API serving with auth, streaming, warmup, logs, and metrics.
- Vision workflows for sample data generation, training, prediction, evaluation, and export.
- Multi-profile Modal account management, sessions tracking, stop commands, and billing reports.
Installation
Requirements:
- Python 3.10 or newer.
- Modal credentials configured through
modal setuporm-gpux account add. - The
modalCLI available on your PATH.
Install from PyPI:
pip install m-gpux
Install from source:
git clone https://github.com/PuxHocDL/m-gpux.git
cd m-gpux
pip install -e .
Quick Start
# Add and inspect Modal profiles
m-gpux account add
m-gpux account list
# Launch the guided GPU hub
m-gpux hub
# Train a tiny vision demo
m-gpux vision sample-data
m-gpux vision train --dataset ./data/m-gpux-vision-sample
# Host a FastAPI app
m-gpux host asgi --entry main:app
# Analyze and deploy Docker Compose
m-gpux compose check
m-gpux compose up
# Deploy an OpenAI-compatible model endpoint
m-gpux serve deploy
# Review cost usage
m-gpux billing usage --days 30 --all
Core Commands
Accounts
m-gpux account list
m-gpux account add
m-gpux account switch <profile_name>
m-gpux account remove <profile_name>
Profiles are stored in ~/.modal.toml. If the active profile is removed, another existing profile is promoted automatically.
Interactive Hub
m-gpux hub
Hub guides you through profile selection, GPU or CPU selection, action selection, Python runtime selection, environment setup, file upload rules, generated script review, and launch.
Actions include:
- Jupyter Lab on selected Modal compute.
- Local Python script execution on remote GPUs.
- Browser Bash shell with a clean direct
bashsession and optional manualtmux. - vLLM inference using a CUDA base image and the selected Python runtime.
The same Python runtime choice is preserved in generated scripts, session metadata, workload presets, and the VS Code Hub wizard.
Docker Compose
m-gpux compose check
m-gpux compose up
m-gpux compose sync
Compose support can analyze services, ports, commands, environment variables, volumes, Dockerfiles, and x-mgpux metadata before generating Modal deployment code.
Deployment modes:
compose up: runs supported services in a generated Modal app using subprocess orchestration.compose vm up: provisions a Modal GPU container for full-image or VM-style workloads such as Triton.compose sandbox up: runs Compose services as isolated Modal Sandboxes for true multi-container separation.
Sandbox commands:
m-gpux compose sandbox check
m-gpux compose sandbox up
m-gpux compose sandbox ps
m-gpux compose sandbox logs
m-gpux compose sandbox exec <service>
m-gpux compose sandbox down
Recent Compose improvements include Dockerfile WORKDIR detection, target-stage handling, BuildKit mount preprocessing for Modal builders, specialized Triton defaults, minimal image detection, dependency readiness checks, tunnel support, and service lifecycle helpers.
Presets And Dev Shells
m-gpux dev
m-gpux preset create
m-gpux preset run <name>
Dev and preset flows now carry the selected Python runtime through saved workload metadata and regenerated Modal scripts. Existing presets default to Python 3.12 when no runtime has been saved.
Web Hosting
m-gpux host asgi --entry main:app
m-gpux host wsgi --entry app:app
m-gpux host static --dir ./site
Hosting creates persistent Modal URLs for FastAPI, Starlette, Flask, Django, and static folders. Projects can auto-detect dependencies, upload local files, scale to zero, and optionally keep warm replicas.
Model Serving
m-gpux serve deploy
m-gpux serve dashboard
m-gpux serve logs
m-gpux serve warmup
m-gpux serve stop
m-gpux serve keys create
m-gpux serve keys list
m-gpux serve keys show <name>
m-gpux serve keys revoke <name>
serve deploys Hugging Face models behind an OpenAI-compatible API with bearer-token auth, streaming and non-streaming chat completions, warmup, resilient proxying, logs, and a live metrics dashboard.
Vision
m-gpux vision sample-data
m-gpux vision train
m-gpux vision predict
Vision workflows support local image-folder datasets, configurable TorchVision backbones, GPU selection, training knobs, checkpoints, metrics, evaluation reports, and ONNX or TorchScript export.
Sessions, Billing, And Stop
m-gpux sessions list
m-gpux sessions open <id>
m-gpux billing open
m-gpux billing usage --days 7 --all
m-gpux stop
m-gpux stop --all
Use sessions to reopen generated app URLs, billing to inspect Modal usage, and stop to clean up running apps on one or all profiles.
VS Code Extension
The m-gpux-vscode extension mirrors the Hub wizard in VS Code. It can launch Hub actions, inspect accounts, show billing usage, and generate Modal scripts from the current workspace. The Hub wizard now includes the same Python runtime picker as the CLI.
cd m-gpux-vscode
npm install
npm run compile
Examples
Ready-to-deploy sample projects live in examples/:
| Example | Command | Description |
|---|---|---|
examples/host-static |
m-gpux host static --dir . |
Static HTML/CSS/JS site |
examples/host-asgi |
m-gpux host asgi --entry main:app |
FastAPI app with health and demo endpoints |
examples/host-wsgi |
m-gpux host wsgi --entry app:app |
Flask task board with REST CRUD API |
Documentation
- Website: https://puxhocdl.github.io/m-gpux/
- Getting started:
docs/getting-started.md - Commands reference:
docs/commands.md - Compose guide:
docs/compose.md - Presets guide:
docs/presets.md - Sessions guide:
docs/sessions.md - FAQ:
docs/faq.md
Architecture
| Component | Responsibility |
|---|---|
m_gpux/main.py |
CLI entrypoint and plugin registration |
m_gpux/core/ |
Shared console, UI, runner, metrics, state, profiles, and plugin helpers |
m_gpux/plugins/account/ |
Modal profile CRUD and switching |
m_gpux/plugins/hub/ |
Guided GPU runtime launcher |
m_gpux/plugins/compose/ |
Compose analysis, subprocess mode, VM mode, sandbox mode, and sync |
m_gpux/plugins/dev/ |
Browser shell development workflow |
m_gpux/plugins/preset/ |
Workload preset creation and replay |
m_gpux/plugins/host/ |
ASGI, WSGI, and static hosting |
m_gpux/plugins/serve/ |
LLM serving, keys, logs, warmup, dashboard |
m_gpux/plugins/vision/ |
Image classification data, training, prediction, and export |
m-gpux-vscode/ |
VS Code extension |
Troubleshooting
No configured Modal profiles found: runm-gpux account add.modal: command not found: install Modal and make sure the CLI is on your PATH.Script file does not exist in hub mode: run from the script directory or pass the correct path.- Compose deployment fails on a custom image: run
m-gpux compose checkorm-gpux compose sandbox checkto inspect image, Dockerfile, ports, volumes, and command detection.
Contributing
pip install -e .
python -m m_gpux.main --help
For VS Code changes:
cd m-gpux-vscode
npm install
npm run compile
Release
Update versions in pyproject.toml, m_gpux/__init__.py, m-gpux-vscode/package.json, and m-gpux-vscode/package-lock.json, then tag and push:
git tag v<version>
git push origin main v<version>
The GitHub Actions publishing workflow builds and uploads the Python package from release tags.
License
MIT
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 m_gpux-2.8.0.tar.gz.
File metadata
- Download URL: m_gpux-2.8.0.tar.gz
- Upload date:
- Size: 140.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e502c87ebc124a7ce68a2266ac07e8ea116822f9f638828ff6369f6d9de8087
|
|
| MD5 |
2f8805896bcf99efda39d8d6433d04a1
|
|
| BLAKE2b-256 |
6e350bc3ddb0470dfa12025b2266c4e41b044c963a69303ed4f3af23c0433573
|
Provenance
The following attestation bundles were made for m_gpux-2.8.0.tar.gz:
Publisher:
publish-pypi.yml on PuxHocDL/m-gpux
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
m_gpux-2.8.0.tar.gz -
Subject digest:
2e502c87ebc124a7ce68a2266ac07e8ea116822f9f638828ff6369f6d9de8087 - Sigstore transparency entry: 1853230582
- Sigstore integration time:
-
Permalink:
PuxHocDL/m-gpux@e346d19164b20133a078afc2d64ba3a2e0109209 -
Branch / Tag:
refs/tags/v2.8.0 - Owner: https://github.com/PuxHocDL
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@e346d19164b20133a078afc2d64ba3a2e0109209 -
Trigger Event:
push
-
Statement type:
File details
Details for the file m_gpux-2.8.0-py3-none-any.whl.
File metadata
- Download URL: m_gpux-2.8.0-py3-none-any.whl
- Upload date:
- Size: 149.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b047e7cadbd0085a1640788981d85aca649d9e317daed530ad7e352fbaa9458
|
|
| MD5 |
0581c10549cd820bb0eb9ec829e0ef91
|
|
| BLAKE2b-256 |
733f65d620320a764088912e8205013c8a826f792ddcb48c0af556b22749ba2e
|
Provenance
The following attestation bundles were made for m_gpux-2.8.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on PuxHocDL/m-gpux
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
m_gpux-2.8.0-py3-none-any.whl -
Subject digest:
7b047e7cadbd0085a1640788981d85aca649d9e317daed530ad7e352fbaa9458 - Sigstore transparency entry: 1853230628
- Sigstore integration time:
-
Permalink:
PuxHocDL/m-gpux@e346d19164b20133a078afc2d64ba3a2e0109209 -
Branch / Tag:
refs/tags/v2.8.0 - Owner: https://github.com/PuxHocDL
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@e346d19164b20133a078afc2d64ba3a2e0109209 -
Trigger Event:
push
-
Statement type: