Flow CLI & SDK
Run GPU workloads on Mithril from the shell or from Python.
Flow procures GPUs through Mithril, spins up InfiniBand-connected instances, and runs your
workloads. It is one engine with two projections: the CLI is what you meet first, and
import flow is the same engine for programs. Every CLI verb runs on the SDK.
First hour
The same three commands flow --help teaches:
uv tool install flow-compute # or: pipx install flow-compute
flow setup # Mithril account, API key and project
flow tutorial # Guided first GPU run with health checks
flow run 'nvidia-smi' # Run a command on a GPU
flow run without -i bids on the cheapest instance type with live capacity, prints the
choice with its hourly price, and asks before any bid above $20/hour. Add --dry-run to see
the configuration without bidding:
$ flow run 'nvidia-smi' --dry-run
╭─ Task Configuration ─────────────────────────────────────────────╮
│ Name run-0972ae │
│ Command nvidia-smi │
│ Instance Type a100 │
│ Market Price $8.00/hr (cheapest with live capacity) │
│ Priority Med │
│ Max Bid $6.00/hr │
│ Code Upload auto (timeout 600s) → /workspace (host+container) │
╰──────────────────────────────────────────────────────────────────╯
✓ Configuration is valid
Then watch, inspect and stop what you started:
flow status # List and monitor tasks
flow logs <task> -f # Stream task logs
flow ssh <task> # SSH into a running task
flow cancel <task> # Cancel a task
$ flow status
╭─ ❊ Flow • 9 completed ────────────────────────────────────────────╮
│ │
│ # Status Task Type │
│ 1 ✓ completed cli-welcome 1×A100 │
│ 2 ✓ completed post-training-sanity-1 1×A100·40G │
│ 3 ✓ completed pretraining-pending-a100-40g 1×A100·40G │
│ 4 ✓ completed post-training-fine-tune 8×H100 │
│ 5 ✓ completed inference-serving 1×H100 │
│ 6 ✓ completed pretraining-train-8xa100 8×A100 │
│ 7 ✓ completed post-training-sanity-2 1×A100·40G │
│ 8 ✓ completed reasoning-rollout-b200 8×B200 │
│ 9 ✓ completed pretraining-2048-h100 256×8×H100 │
│ │
╰───────────────────────────────────────────────────────────────────╯
The same first hour from Python:
import flow
task = flow.run("nvidia-smi", instance_type="a100")
for line in task.log_stream():
print(line, end="")
Optional assistant integrations:
flow claude # Install Flow skills for Claude Code
flow codex # Install Flow skills for Codex
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.
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 quickly once capacity is allocated. | flow dev for a GPU workstation or flow run to 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 | Self-serve access to spot and reserved capacity, subject to account access and market availability. | Spot capacity plus 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)
Workflows
Research mode
flow run→ reproducible batch jobs from a command, a YAML file or a SLURM script.flow dev→ interactive development on an allocated GPU workstation.import flow→ the same engine for pipelines and orchestration.
# Launch a batch job on discounted H100s
flow run 'python train.py' -i 8xh100
# Run a saved configuration
flow run task.yaml
# Frictionlessly leverage an existing SLURM script
flow run job.slurm
# Serverless-style decorator
@app.function(instance_type="a100")
def train(lr: float) -> dict:
...
Infrastructure mode
flow instance create -i 8xh100 -N 20→ request a 20-node GPU clusterflow volume create -s 10000 --interface file→ provision 10 TB of persistent, high-speed storageflow ssh instance -- nvidia-smi→ run across all nodes in parallel
$ flow instance create -i 8xh100 -N 20 --dry-run
╭─ Instance Configuration ────────────────────────────────╮
│ Name interactive-47fa95 │
│ Instances 20 × 8xh100 │
│ Max Bid $64.00/hr per instance ($1280.00/hr total) │
│ Code Upload disabled │
╰─────────────────────────────────────────────────────────╯
✓ Configuration is valid
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 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 - Linux or macOS for native CLI workflows. On Windows, use WSL2; native Windows is not fully validated.
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: use WSL2 for the Flow CLI, then run the macOS/Linux command inside WSL.
curl -LsSf https://astral.sh/uv/install.sh | sh
2) Install Flow
-
Global CLI (uv):
uv tool install flow-compute flow setup
-
Global CLI (pipx):
pipx install flow-compute flow setup
Providers
Flow talks to one provider per configuration. Mithril is the default and the only provider
installed by the base package; flow setup --provider (or FLOW_PROVIDER) selects the active
one. The SkyPilot provider is an optional extra, pip install 'flow-compute[skypilot]', and
is not installed by default. Switching providers means switching configurations; a single
config does not span providers.
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
Advanced Task Configuration
# Distributed training example (32 GPUs, Mithril groups for InfiniBand connectivity by default)
task = flow.run(
"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",
instance_type="a100",
data_mounts={
"/datasets": "s3://ml-bucket/imagenet", # S3 via s3fs
"/models": "volume://pretrained-models" # Persistent storage
}
)
The vocabulary is the same on every surface (instance_type, env, data_mounts, ...);
see docs/vocabulary.md.
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
Metadata
Release files for flow-compute 3.25.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| flow_compute-3.25.0.tar.gz | 1.9 MB | Details |
Built distributions (wheels)
Total release size: 86.9 MB
Release files / flow_compute-3.25.0.tar.gz
| Download URL | flow_compute-3.25.0.tar.gz |
|---|---|
| Size | 1.9 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ab56bc3385030c778a3266784226e1cb05833e5e2884ab95ed7c40a7b1543f2b
|
|
BLAKE2b-256 checksum How to use checksums |
997e7d86becc3bcd17423d928cfc2678a1bfc135496e397c44e6ba8cfb5e363f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / flow_compute-3.25.0-py3-none-any.whl
| Download URL | flow_compute-3.25.0-py3-none-any.whl |
|---|---|
| Size | 2.2 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c81ff660db03cae63f26762bc4e43f3f9ad25f9327c3c3a0f782e685eb2ebe40
|
|
BLAKE2b-256 checksum How to use checksums |
e9c2c69c1f13dc726c171ed479fbf8e8a264ad1ea6f0c96152fc101217d412ed
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / flow_compute-3.25.0-cp313-cp313-manylinux_2_28_x86_64.whl
| Download URL | flow_compute-3.25.0-cp313-cp313-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 5.3 MB |
| Tags | CPython 3.13 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
0ed2bd3c069f48747aff9ade839afba68fed39e10a36ad8c83128fec56a1f5ba
|
|
BLAKE2b-256 checksum How to use checksums |
1eb63f9de858c54f58ab358555f7255c3c5625c533a4cc5bba0a08868da3bad1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / flow_compute-3.25.0-cp313-cp313-manylinux_2_28_aarch64.whl
| Download URL | flow_compute-3.25.0-cp313-cp313-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 5.2 MB |
| Tags | CPython 3.13 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
4ce18125536bd3640a9f1b00db3296bbf447973cf1f986e2ce7ad8bc7e5732ed
|
|
BLAKE2b-256 checksum How to use checksums |
563576d55952ef75eba32b9f262e7ef8ab9629e222fdf180956f17b7dfeddef0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / flow_compute-3.25.0-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | flow_compute-3.25.0-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 5.0 MB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
f319c111df0bbdd3e0da9ae7526160fd36d7816a5986714c22d74a76c1f69fd1
|
|
BLAKE2b-256 checksum How to use checksums |
5e12d5cbb10d5e66f1ff09af74e1c6a58c18f47442989380e8abafb7f50100ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / flow_compute-3.25.0-cp313-cp313-macosx_10_12_x86_64.whl
| Download URL | flow_compute-3.25.0-cp313-cp313-macosx_10_12_x86_64.whl |
|---|---|
| Size | 5.1 MB |
| Tags | CPython 3.13 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
7a67e408de924e09dc7ca59ef6b065437216060dacb4ae490c9dfe16440dce11
|
|
BLAKE2b-256 checksum How to use checksums |
d9b34e5c7d3d3f75f147793f1936ee54e4592b2297142f5307c774d7845db406
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / flow_compute-3.25.0-cp312-cp312-manylinux_2_28_x86_64.whl
| Download URL | flow_compute-3.25.0-cp312-cp312-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 5.3 MB |
| Tags | CPython 3.12 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
f717516af53a2d89dad20bbfaa27fa6d2f0111cc14dde507c507298082e18a2c
|
|
BLAKE2b-256 checksum How to use checksums |
6872f4bf51df8bb4bc297e6caf3d727e7d9f37c684d5b7c13b463190761ba8c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / flow_compute-3.25.0-cp312-cp312-manylinux_2_28_aarch64.whl
| Download URL | flow_compute-3.25.0-cp312-cp312-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 5.2 MB |
| Tags | CPython 3.12 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
efdb740d97e774f25a674d7d4aa9b3fbac65d378c96ae8a23f4f8f16e3b8a165
|
|
BLAKE2b-256 checksum How to use checksums |
0871424988b83a99be29d50adbc5b3951e31c24355ee169b07f4b6e2794613d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / flow_compute-3.25.0-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | flow_compute-3.25.0-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 5.0 MB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
3138f24368b6acea0cbd8aef0de8f36bbaee6ab272895f17d1ab5d5c3d19b1e3
|
|
BLAKE2b-256 checksum How to use checksums |
aa769704361dfa789943a61740bc740a5fc0c66a4cddf475dcb0f4a80af24711
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / flow_compute-3.25.0-cp312-cp312-macosx_10_12_x86_64.whl
| Download URL | flow_compute-3.25.0-cp312-cp312-macosx_10_12_x86_64.whl |
|---|---|
| Size | 5.1 MB |
| Tags | CPython 3.12 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
ab38c17c5f8cceced51d014358a945204220561f897184e4638b3a8797204e5c
|
|
BLAKE2b-256 checksum How to use checksums |
48c3a64cda72ca2632f18a7e5ff715bd9e81c002a95f8ab7eff23f2b975eb904
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / flow_compute-3.25.0-cp311-cp311-manylinux_2_28_x86_64.whl
| Download URL | flow_compute-3.25.0-cp311-cp311-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 5.3 MB |
| Tags | CPython 3.11 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
558e7fb1e3bcd2644f1d968431ce680c358da2be4dcac74b6089ea820e060126
|
|
BLAKE2b-256 checksum How to use checksums |
95cb2d419b5c85050a66668c04a2a0795e1787c0b34be72946a6b4ae07b8c504
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / flow_compute-3.25.0-cp311-cp311-manylinux_2_28_aarch64.whl
| Download URL | flow_compute-3.25.0-cp311-cp311-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 5.2 MB |
| Tags | CPython 3.11 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
0f69979222179316b1de5dbb96b517916423deda5cc00e89bcddc4e801ced915
|
|
BLAKE2b-256 checksum How to use checksums |
8e648c29fe2b1d29933626eb83791d3fdb8fb7617c4a3f0a305ba7e179079994
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / flow_compute-3.25.0-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | flow_compute-3.25.0-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 5.0 MB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
d9479fa22f0297e101231b7839517ed9b0b3cc22866ac9d3cfa6b791e180808a
|
|
BLAKE2b-256 checksum How to use checksums |
cd4f89689c172f214aa2fe10bfeae3f3532e2c5d709f7bc5f51399a5fdfed70a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / flow_compute-3.25.0-cp311-cp311-macosx_10_12_x86_64.whl
| Download URL | flow_compute-3.25.0-cp311-cp311-macosx_10_12_x86_64.whl |
|---|---|
| Size | 5.1 MB |
| Tags | CPython 3.11 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
dc481bb92dd428edcbf951f3dc02d4b7196d5a193f5b6f3c6a8528a6db70a3c5
|
|
BLAKE2b-256 checksum How to use checksums |
123345dd949980250d82a522d4bd96b73ab1d42054e63d3a24e007cbf315d293
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / flow_compute-3.25.0-cp310-cp310-manylinux_2_28_x86_64.whl
| Download URL | flow_compute-3.25.0-cp310-cp310-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 5.3 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
e152c643f6f91a6d3a8c61a38c98e46636a724b6c28003616f0f1b45be916ad2
|
|
BLAKE2b-256 checksum How to use checksums |
157a44e36753624312ad969497b1b3e6cd15d343f8e170295b22912bb3ef0f79
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / flow_compute-3.25.0-cp310-cp310-manylinux_2_28_aarch64.whl
| Download URL | flow_compute-3.25.0-cp310-cp310-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 5.2 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
d2213dd311cbaaad240ab9ce4ac2629a2df7474a94604ca3aa678f5e4a2c6c31
|
|
BLAKE2b-256 checksum How to use checksums |
091ec53cb7cebe5bbc4702d3acdbc614133f360d6b9a8ff8d72a749fd9f2f8e3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / flow_compute-3.25.0-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | flow_compute-3.25.0-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 5.0 MB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
5629dca74938b1c4df3a20b19d48d06976cad0fe0c2d1006b0a7d648e218ee58
|
|
BLAKE2b-256 checksum How to use checksums |
acfad768f763af02fcf4cb80b467b7a74e18567df3defeb03b9c0b9d52b8fe78
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|
Release files / flow_compute-3.25.0-cp310-cp310-macosx_10_12_x86_64.whl
| Download URL | flow_compute-3.25.0-cp310-cp310-macosx_10_12_x86_64.whl |
|---|---|
| Size | 5.1 MB |
| Tags | CPython 3.10 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
32faf3450f1d8f7e1ba126b1adf441b7fc6eaf2490692bb53da8f8f066215bba
|
|
BLAKE2b-256 checksum How to use checksums |
e1b5fa387a4fbecb8981ecc287b559a0b9dd15727180a96569569c05e2a03239
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.15.0
|