Skip to content

m-gpux Documentation

Welcome to the official docs for m-gpux, a production-focused CLI toolkit for Modal GPU operations.

One CLI to manage profiles, launch GPU runtimes, run repeatable tasks, deploy LLM APIs, and track cloud costs.

What is m-gpux?

m-gpux turns Modal's serverless GPU platform into a streamlined developer experience:

Capability Description
Multi-profile management Add, switch, and remove Modal identities, all stored in ~/.modal.toml
Dev Boxes GPU/CPU boxes on Modal Sandboxes with SSH / VS Code Remote-SSH, pause & resume, and file sync
Budgets & Prices $/hour in every picker, per-account monthly budgets with auto-stop, live price table
Published Images Build dependencies once, start in seconds on every account
Interactive GPU Hub Guided wizard to launch Jupyter Lab or vLLM inference on Modal
Session Manager Track running Hub/dev sessions, pull remote workspaces, view logs, and stop apps
Projects Define and run repeatable tasks from mgpux.toml and keep a run history
Workload Presets Save compute, dependency, and exclude settings for Jupyter Lab
LLM API Server Deploy any HuggingFace model as an OpenAI-compatible endpoint with Bearer token auth, streaming, and warm containers
API Key Management Create, list, show, and revoke sk-mgpux-* keys stored locally in ~/.m-gpux/api_keys.json
Billing Dashboard Inspect 7/30/90-day usage per profile or aggregated across all accounts
App Lifecycle Stop any running m-gpux app (Jupyter or LLM servers) from one command

Quick Install

pip install m-gpux

Or from source:

git clone https://github.com/PuxHocDL/m-gpux.git
cd m-gpux && pip install -e .

Requirements

Python 3.10+, Modal 1.6.4+ installed with m-gpux, and at least one Modal account with token_id / token_secret.

Start Here

Page What you'll learn
Getting Started Install, add your first profile, and launch a GPU session in 5 minutes
Command Reference Every command, flag, and option with examples
Dev Boxes SSH / VS Code into a GPU box, pause and resume it
Costs, Budgets & Images GPU catalog, prices, budgets, published images
Session Manager Manage tracked dev and Hub sessions
Workload Presets Save and rerun common launch configs
Projects & Run Anywhere Define a task, run it on Modal, or pick another provider
Recipes Practical flows for dev boxes, training, and file recovery
Architecture How m-gpux works internally: proxy layer, template generation, profile resolution
FAQ & Troubleshooting Common errors and how to fix them

Common Workflows

1. Open A Dev Box

cd my-project
m-gpux dev up
m-gpux dev code     # VS Code Remote-SSH into /workspace
m-gpux dev pause    # snapshot + stop; `dev resume` continues later

m-gpux dev up starts a Modal Sandbox with your folder in /workspace and writes an m-gpux-<name> host to ~/.ssh/config.

m-gpux sessions list
m-gpux sessions pull <session-id> --to ./m-gpux-workspace

2. Launch Jupyter on a GPU

m-gpux account add
m-gpux hub

The hub generates a modal_runner.py script, shows it for review, then executes modal run to start a GPU-backed Jupyter Lab with a public URL.

3. Deploy an LLM as an OpenAI-compatible API

m-gpux serve keys create --name prod
m-gpux serve deploy

The wizard walks through:

  1. Model 11 presets or a custom HuggingFace model ID
  2. GPU choose the hardware for inference
  3. Context length max sequence length
  4. Engine tuning GPU memory utilization, max concurrent sequences, tensor parallel size
  5. Keep warm 0 scales to zero, 1+ keeps container(s) always running
  6. API key pick an existing key or auto-create one

After deploy, monitor your server with the live dashboard:

m-gpux serve dashboard

4. Run a project task on Modal

m-gpux init
m-gpux up
m-gpux runs list

Commit mgpux.toml to share the task configuration. See Projects & Run Anywhere for task settings and CI setup.

5. Save a Jupyter Lab preset

m-gpux preset create
m-gpux preset run rl-a100

The Hub can save your settings as a preset when you configure a Jupyter Lab session.

6. Check costs across all accounts

m-gpux billing usage --days 7 --all

Aggregates compute spend from every configured profile into a single Rich table.

7. Stop running apps and release GPUs

m-gpux stop --all
m-gpux serve stop

Pro workflow

Keep one profile for personal experiments and one for team workloads, then run m-gpux billing usage --all weekly to track total burn across both.

Supported GPUs

m-gpux supports all Modal GPU types:

# GPU VRAM Best for
1 T4 16 GB Light inference, exploration
2 L4 24 GB Cost/performance balance
3 A10G 24 GB Training and inference
4 L40S 48 GB Large-batch inference
5 A100 40 GB High-performance training
6 A100-40GB 40 GB Ampere 40GB variant
7 A100-80GB 80 GB Large models (30B+)
8 RTX PRO 6000 48 GB Pro workstation GPU
9 H100 80 GB Hopper architecture
10 H100! 80 GB H100 reserved (guaranteed)
11 H200 141 GB HBM3e, next-gen Hopper
12 B200 Blackwell architecture
13 B200+ B200 reserved (guaranteed)