Metadata-Version: 2.4
Name: m-gpux
Version: 4.1.0
Summary: Professional CLI toolkit for Modal GPU workflows, account management, and billing visibility
Author: PuxHocDL
License-Expression: MIT
Project-URL: Homepage, https://github.com/PuxHocDL/m-gpux
Project-URL: Documentation, https://puxhocdl.github.io/m-gpux/
Project-URL: Repository, https://github.com/PuxHocDL/m-gpux
Project-URL: Issues, https://github.com/PuxHocDL/m-gpux/issues
Keywords: modal,gpu,cli,machine-learning,orchestration
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: modal>=1.6.4
Requires-Dist: huggingface-hub<2,>=0.36.0
Requires-Dist: typer>=0.29.1; python_version < "3.11"
Requires-Dist: typer>=0.29.3; python_version >= "3.11"
Requires-Dist: rich>=15.0.0
Requires-Dist: tomlkit>=0.15.3
Provides-Extra: mcp
Requires-Dist: mcp<3,>=2.3; extra == "mcp"
Provides-Extra: dev
Requires-Dist: build>=1.6.1; extra == "dev"
Requires-Dist: pyyaml>=6.0.4; extra == "dev"
Requires-Dist: ruff>=0.17.6; extra == "dev"
Requires-Dist: twine>=6.2.0; extra == "dev"
Provides-Extra: docs
Requires-Dist: mkdocs>=1.6.1; extra == "docs"
Requires-Dist: mkdocs-material>=9.7.7; python_version < "3.11" and extra == "docs"
Requires-Dist: mkdocs-material>=9.8.2; python_version >= "3.11" and extra == "docs"
Dynamic: license-file

<div align="center">
  <a href="https://puxhocdl.github.io/m-gpux/">
    <img alt="m-gpux logo" src="https://raw.githubusercontent.com/PuxHocDL/m-gpux/main/m-gpux-vscode/resources/icon.png" width="96">
  </a>
  <h1>m-gpux</h1>
  <p><strong>A GPU workbench for short tasks and long training runs.</strong></p>

  <p>
    <a href="https://pypi.org/project/m-gpux/"><img alt="PyPI - License" src="https://img.shields.io/pypi/l/m-gpux"></a>
    <a href="https://pypistats.org/packages/m-gpux"><img alt="PyPI - Downloads" src="https://img.shields.io/pypi/dm/m-gpux"></a>
    <a href="https://pypi.org/project/m-gpux/"><img alt="Version" src="https://img.shields.io/pypi/v/m-gpux?label=version"></a>
    <a href="https://pypi.org/project/m-gpux/"><img alt="Python" src="https://img.shields.io/pypi/pyversions/m-gpux"></a>
    <a href="https://marketplace.visualstudio.com/items?itemName=puxpux.m-gpux"><img alt="VS Code Marketplace" src="https://img.shields.io/visual-studio-marketplace/v/puxpux.m-gpux?label=VS%20Code"></a>
  </p>
</div>

m-gpux runs small GPU jobs on Modal, Kaggle, or Colab and continues long Hugging Face training runs across a route you configure. Training stages save checkpoints, metrics, and final weights to a private Hugging Face repository. The local dashboard tracks progress and can request a checkpoint before releasing the GPU.

> [!TIP]
> Just getting started? Run `m-gpux dev up` inside a project folder. You get a GPU box you can `ssh` or open in VS Code, and `m-gpux dev pause` snapshots it so you can pick up tomorrow with your packages and files intact.

## Quickstart

```bash
pip install m-gpux         # also installs the `modal` CLI that m-gpux drives
m-gpux account add         # paste a `modal token set ...` command
```

```bash
cd my-project
m-gpux dev up              # pick an account and a GPU; this folder lands in /workspace
m-gpux dev code            # open it in VS Code (Remote-SSH)
m-gpux dev pause           # snapshot everything, stop paying for compute
```

If you'd rather click through a menu, `m-gpux hub` launches Jupyter or vLLM on any GPU from one guided wizard.

For the same workflows inside your editor, install the [m-gpux VS Code extension](https://marketplace.visualstudio.com/items?itemName=puxpux.m-gpux).

> [!TIP]
> Juggling several Modal accounts? `m-gpux budget set 20` caps what each one may spend this month, and the **AUTO** account picker always lands on the account with the most budget left.

## m-gpux ecosystem

The CLI works on its own, and each piece below plugs into the same accounts, presets, and budgets.

- **[CLI](https://pypi.org/project/m-gpux/)** — dev boxes, Hub, project tasks, model serving, budgets, and billing from one command
- **[VS Code extension](https://marketplace.visualstudio.com/items?itemName=puxpux.m-gpux)** — an Overview panel for accounts, credit, sessions and runs, Modal GPUs as notebook kernels, and every wizard in the sidebar
- **[Documentation](https://puxhocdl.github.io/m-gpux/)** — guides for every workflow, plus the full command reference

## Why use m-gpux?

m-gpux wraps Modal's primitives (Sandboxes, Functions, Servers, Volumes, named Images) into workflows that fit how you already develop.

- **Dev boxes that survive the night** — Sandboxes running `sshd`, reachable with plain `ssh` or VS Code Remote-SSH. `pause` snapshots the whole filesystem and `resume` boots it back in seconds; `sync push/pull` moves files both ways
- **Every GPU, priced up front** — T4 through H100, H200, B200, and B300, including multi-GPU containers (`H100:8`), with $/hour in every picker and `m-gpux billing rates` for the live price table
- **Many accounts, one budget** — per-account monthly limits, budget-aware AUTO selection, a warning before you launch on an account that's nearly empty, and `budget check --stop` to shut down apps on accounts that go over
- **Your own OpenAI-compatible endpoint** — `m-gpux serve deploy` puts any Hugging Face model behind vLLM with API keys, streaming, warmup, logs, and a live metrics dashboard
- **Kaggle & Colab too** — `m-gpux kaggle` and `m-gpux colab` drive Kaggle notebooks and Colab runtimes across many accounts: weekly GPU hours and compute units at a glance, AUTO picks the account with the most left, kernels pushed as any account (Colab CLI works on Windows)
- **A local control plane** — `m-gpux ui` opens a web dashboard on localhost: every account's credit and workspace, live apps, containers and sandboxes across accounts, sessions, endpoints and GPU prices, with stop / logs / budget actions
- **Scripts as an async API** — `m-gpux gateway deploy` exposes the tasks you declare in `mgpux.gateway.toml` as an authenticated job API: submit JSON, poll for results, each task autoscaling on its own CPU or GPU
- **A project file for your repo** — `mgpux.toml` declares tasks (GPU fallback lists, images, secrets, volumes); `m-gpux up train` runs one and records the result. A GitHub Action runs the same task from CI
- **Run where there is capacity** — `m-gpux run train.py` uses free Kaggle GPU hours first, then Colab, then the Modal account with the most credit
- **Workspaces in sync** — `m-gpux secrets sync hf HF_TOKEN --to all` and `m-gpux image sync` put the same Secrets and images on every account; `m-gpux volume` browses and moves data on any of them
- **Pinged, not polling** — Discord, Slack, Telegram, ntfy or webhook notifications when runs finish, apps run too long or credit runs low
- **Starts in seconds, not minutes** — `m-gpux image build` bakes your dependencies once and publishes them to every account; Hub and dev boxes offer them as the base image
- **Nothing hidden** — every workflow generates a plain Modal script you can read and edit before it runs

## Resources

- [Documentation](https://puxhocdl.github.io/m-gpux/) — getting started, guides, and FAQ
- [Command reference](https://puxhocdl.github.io/m-gpux/commands/) — every command and option
- [Dev boxes](https://puxhocdl.github.io/m-gpux/dev-container/) — SSH, VS Code, pause/resume, and sync in depth
- [Projects & Run Anywhere](docs/projects.md) — repeatable tasks, run history, and CI
- [Long Training](docs/training.md) — GPU routes, checkpoint recovery, and safe shutdown
- [Agent tools](docs/agent-tools.md) — local MCP, repository skill, and provider source maps
- [Costs, budgets & images](https://puxhocdl.github.io/m-gpux/costs/) — GPU catalog, prices, budgets, and published images
- [Architecture](https://puxhocdl.github.io/m-gpux/architecture/) — plugins, the generated-script pattern, and how third-party plugins add commands
- [Issues](https://github.com/PuxHocDL/m-gpux/issues) — bug reports and feature requests

## Contributing

```bash
git clone https://github.com/PuxHocDL/m-gpux.git
cd m-gpux
pip install -e ".[dev,docs]"
m-gpux --help
```

Each command group is a plugin in `m_gpux/plugins/<name>/plugin.py`, registered in both `m_gpux/plugins/__init__.py` and the `m_gpux.plugins` entry-point group in `pyproject.toml`.

Run the same checks used by CI before opening a pull request:

```bash
ruff check m_gpux tests
python -m unittest discover -s tests -v
mkdocs build --strict

cd m-gpux-vscode
npm ci
npm run typecheck
npm run compile

cd ../m-gpux-ui
npm ci
npm run build
```

## License

[MIT](LICENSE)
