CLI and SDK for submitting and managing GPU workloads
Project description
Flow CLI & SDK
Python → Petaflops in 15 seconds. Flow procures GPUs through Mithril, spins InfiniBand-connected instances, and runs your workloads—zero friction, no hassle.
Background
There's a paradox in GPU infrastructure today: Massive GPU capacity sits idle, even as AI teams wait in queues—starved for compute. Mithril, the AI-compute omnicloud, dynamically allocates GPU resources from a global pool (spanning Mithril's first-party resources and 3rd-party partner cloud capacity) using efficient two-sided auctions, maximizing surplus and reducing costs. Mithril seamlessly supports both reserved-in-advance and just-in-time workloads—maximizing utilization, ensuring availability, and significantly reducing costs.
Infrastructure mode
flow instance create -i 8xh100 -N 20
╭─ Instance Configuration ────────────────────────────────╮
│ │
│ Name multinode-run │
│ Command sleep infinity │
│ Image nvidia/cuda:12.1.0-runtime-ubuntu22.04 │
│ Working Dir /workspace │
│ Instance Type 8xh100 │
│ Num Instances 20 │
│ Max price $12.29/hr │
│ │
╰─────────────────────────────────────────────────────────╯
flow instance list
╭─────────────────────────────── ❊ Flow ────────────────────────────────╮
│ │
│ # Status Instance GPU Owner Age │
│ 1 ● running multinode-run 8×H100·80G alex 0m │
│ 2 ● running interactive-77c31e A100·80G noam 5h │
│ 3 ○ cancelled dev-a100-test A100·80G alex 1d │
│ │
╰───────────────────────────────────────────────────────────────────────╯
Research mode (in early preview)
flow submit "python train.py" # -i 8xh100
⠋ Bidding for best‑price GPU node (8×H100) with $12.29/h100-hr limit_price…
✓ Launching on NVIDIA H100-80GB for $1/h100-hr
Quick Start
# Optional: install uv
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install via uv or pipx (or see installer scripts in scripts/)
uv tool install flow-compute
# or: pipx install flow-compute
flow setup # Sets up your authentication and configuration
flow dev # Interactive box. sub-5-second dev loop after initial VM config
Why choose Flow
Status quo GPU provisioning involves quotas, complex setups, and queue delays, even as GPUs sit idle elsewhere or in recovery processes. Flow addresses this:
Dynamic Market Allocation – Efficient two-sided auctions ensure you pay the lowest market-driven prices rather than inflated rates.
Simplified Batch Execution – An intuitive interface designed for cost-effective, high-performance batch workloads without complex infrastructure management.
Provision from 1 to thousands of GPUs for long-term reservations, short-term "micro-reservations" (minutes to weeks), or spot/on-demand needs—all interconnected via InfiniBand. High-performance persistent storage and built-in Docker support further streamline workloads, ensuring rapid data access and reproducibility.
Why Flow + Mithril?
| Pillar | Outcome | How |
|---|---|---|
| Iteration Velocity and Ease | Fresh containers in seconds; from idea to training or serving instantly. | flow dev for DevBox or flow submit to programmatically launch tasks |
| Best price-performance via market-based pricing | Preemptible secure jobs for $1/h100-hr | Blind two-sided second-price auction; client-side bid capping |
| Availability and Elasticity | GPUs always available, self-serve; no haggling, no calls. | Uncapped spot + overflow capacity from partner clouds |
| Abstraction and Simplification | InfiniBand VMs, CUDA drivers, auto-managed healing buffer—all pre-arranged. | Mithril virtualization and base images preconfigured + Mithril capacity management. |
"The tremendous demand for AI compute and the large fraction of idle time makes sharing a perfect solution, and Mithril's innovative market is the right approach." — Paul Milgrom, Nobel Laureate (Auction Theory and Mechanism Design)
Key Concepts to Get Started
Core Workflows
Infrastructure mode
flow instance create -i 8xh100 -N 20→ spin up a 20-node GPU cluster in secondsflow volume create -s 10000 -i file→ provision 10 TB of persistent, high-speed storageflow ssh instance -- nvidia-smi→ run across all nodes in parallel
In research preview
Research mode
flow dev→ interactive loops in seconds.flow submit→ reproducible batch jobs.- Python API → easy pipelines and orchestration.
Examples
# Launch a batch job on discounted H100s
flow submit "python train.py" -i 8xh100
# Frictionlessly leverage an existing SLURM script
flow submit job.slurm
# Serverless‑style decorator
@app.function(gpu="a100")
Ideal Use Cases
- Rapid Experimentation – Quick iterations for research sprints.
- Instant Elasticity – Scale rapidly from one to thousands of GPUs.
- Collaborative Research – Shared dev environments with per-task cost controls.
Flow is not yet ideal for: always‑on ≤100 ms inference, strictly on‑prem regulated data, or models that fit on laptop or consumer-grade GPUs.
Architecture (30‑s view)
Your intent ⟶ Flow Execution Layer ⟶ Global GPU Fabric
Flow SDK abstracts complex GPU auctions, InfiniBand clusters, and multi-cloud management into a single seamless and unified developer interface.
Installation
Requirements
- Python 3.10 or later
- Recommended: use
uvto auto-manage a compatible Python when installing the CLI
1) Install uv — optional but recommended
Installation guide: docs.astral.sh/uv/getting-started/installation
- macOS/Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh
- Windows (PowerShell):
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
2) Install Flow
-
Global CLI (uv):
uv tool install flow-compute flow setup
-
Global CLI (pipx):
pipx install flow-compute flow setup
Under the Hood (Advanced)
- Bid Caps – Protect budgets automatically.
- Self-Healing – Spot nodes dynamically migrate tasks.
- Docker/Conda – Pre-built images or dynamic install.
- Multi-cloud Ready – Mithril (with Oracle, Nebius integrations internal to Mithril), and more coming
- SLURM Compatible – Run
#SBATCHscripts directly.
Python SDK (Research Preview)
Advanced Task Configuration
# Distributed training example (32 GPUs, Mithril groups for InfiniBand connectivity by default)
task = flow.run(
command="torchrun --nproc_per_node=8 train.py",
instance_type="8xa100",
num_instances=4, # Total of 32 GPUs (4 nodes × 8 GPUs each)
env={"NCCL_DEBUG": "INFO"}
)
# Mount S3 data + persistent volumes
task = flow.run(
"python analyze.py",
gpu="a100",
mounts={
"/datasets": "s3://ml-bucket/imagenet", # S3 via s3fs
"/models": "volume://pretrained-models" # Persistent storage
}
)
Key Features Summary
- Distributed Training – Multi-node InfiniBand clusters auto-configured
- Code Upload – Automatic with
.flowignore(or.gitignorefallback) - Live Debugging – SSH into running instances (
flow ssh) - Cost Protection – Built-in
max_price_per_hoursafeguards - Jupyter Integration – Connect notebooks to GPU instances
Documentation: https://docs.mithril.ai/cli-and-sdk/quickstart
Further Reading
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 Distributions
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 flow_compute-3.0.0.tar.gz.
File metadata
- Download URL: flow_compute-3.0.0.tar.gz
- Upload date:
- Size: 1.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7c04a4aac4b82afe486c1ef9b5a99ac02078be2a1f03a67d05c1db23b7be625
|
|
| MD5 |
c0879c192b7b4585a6ef3f05f71b2b77
|
|
| BLAKE2b-256 |
5cb0db85516f492551f75386d4597dd03c5c0503b64c7df33718b8dbed7f388a
|
File details
Details for the file flow_compute-3.0.0-py3-none-any.whl.
File metadata
- Download URL: flow_compute-3.0.0-py3-none-any.whl
- Upload date:
- Size: 1.5 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61a4d603b98e9ac232ec9aa96149e642299f1a31ff3c7b485cdf57c9b4ad3988
|
|
| MD5 |
0b5c82454fc8d117c39397ac20d85cda
|
|
| BLAKE2b-256 |
dbf6726713928734185075233059e8611482f29b48d3418f2069c5e3da3a0590
|
File details
Details for the file flow_compute-3.0.0-cp314-cp314-macosx_11_0_arm64.whl.
File metadata
- Download URL: flow_compute-3.0.0-cp314-cp314-macosx_11_0_arm64.whl
- Upload date:
- Size: 4.3 MB
- Tags: CPython 3.14, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4065ef5bc047e32181f183a11a3a06fa4d71a2275e5099e0ea685505099625b
|
|
| MD5 |
d60453b126e2db175210b46394aca7e8
|
|
| BLAKE2b-256 |
b98bdda49f7c6e10396777dff28046cc58eda1e6ce788b1708ea383a8fe0ff02
|
File details
Details for the file flow_compute-3.0.0-cp311-cp311-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: flow_compute-3.0.0-cp311-cp311-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 4.6 MB
- Tags: CPython 3.11, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2f3c241a03bfd399d812806a9fb6d0022f4d3482250c5f26adef9eb060fdb2c3
|
|
| MD5 |
1621ebeb19ed465970a546c474287158
|
|
| BLAKE2b-256 |
8776f64452fc1ac61c8e3ee8a30df2d58e878a84ce0757085a68fe35ef2777d8
|
File details
Details for the file flow_compute-3.0.0-cp311-cp311-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: flow_compute-3.0.0-cp311-cp311-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 4.4 MB
- Tags: CPython 3.11, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c2738079a0cb216c108bbd2ada5b0e63ff7a23ca96505d3f092f215cf7146a9
|
|
| MD5 |
e8da645e988dfc5d13e169677071a80e
|
|
| BLAKE2b-256 |
168b70f486dd6525b7cf56e3d22292bc3aeb18ecb307226aa6dd5d64aaf6817f
|