Skip to main content

CLI and SDK for submitting and managing GPU workloads

Project description

Flow CLI & SDK

Python → Petaflops with one CLI. Flow procures GPUs through Mithril, spins up InfiniBand-connected instances, and runs your workloads with a compact CLI and SDK.

PyPI - Version Public repo

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  # Requires a Mithril account, API key, and project access
flow dev   # Interactive GPU development after initial VM setup

Optional assistant integrations:

flow claude  # Install Flow skills for Claude Code
flow codex   # Install Flow skills for Codex

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 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 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)


Key Concepts to Get Started

Core Workflows

Infrastructure mode

  • flow instance create -i 8xh100 -N 20 → request a 20-node GPU cluster
  • flow volume create -s 10000 -i file → provision 10 TB of persistent, high-speed storage
  • flow ssh instance -- nvidia-smi → run across all nodes in parallel

In research preview

Research mode

  • flow dev → interactive development on allocated GPU instances.
  • 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 uv to 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
    

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 #SBATCH scripts directly.

Python SDK (Research Preview)

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",
    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 .gitignore fallback)
  • Live Debugging – SSH into running instances (flow ssh)
  • Cost Protection – Built-in max_price_per_hour safeguards
  • 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

flow_compute-3.21.0.tar.gz (1.6 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

flow_compute-3.21.0-py3-none-any.whl (1.9 MB view details)

Uploaded Python 3

flow_compute-3.21.0-cp313-cp313-manylinux_2_28_x86_64.whl (5.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

flow_compute-3.21.0-cp313-cp313-manylinux_2_28_aarch64.whl (4.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

flow_compute-3.21.0-cp313-cp313-macosx_11_0_arm64.whl (4.8 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

flow_compute-3.21.0-cp313-cp313-macosx_10_12_x86_64.whl (4.9 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

flow_compute-3.21.0-cp312-cp312-manylinux_2_28_x86_64.whl (5.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

flow_compute-3.21.0-cp312-cp312-manylinux_2_28_aarch64.whl (4.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

flow_compute-3.21.0-cp312-cp312-macosx_11_0_arm64.whl (4.8 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

flow_compute-3.21.0-cp312-cp312-macosx_10_12_x86_64.whl (4.9 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

flow_compute-3.21.0-cp311-cp311-manylinux_2_28_x86_64.whl (5.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

flow_compute-3.21.0-cp311-cp311-manylinux_2_28_aarch64.whl (4.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

flow_compute-3.21.0-cp311-cp311-macosx_11_0_arm64.whl (4.8 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

flow_compute-3.21.0-cp311-cp311-macosx_10_12_x86_64.whl (4.9 MB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

flow_compute-3.21.0-cp310-cp310-manylinux_2_28_x86_64.whl (5.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

flow_compute-3.21.0-cp310-cp310-manylinux_2_28_aarch64.whl (4.9 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

flow_compute-3.21.0-cp310-cp310-macosx_11_0_arm64.whl (4.8 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

flow_compute-3.21.0-cp310-cp310-macosx_10_12_x86_64.whl (4.9 MB view details)

Uploaded CPython 3.10macOS 10.12+ x86-64

File details

Details for the file flow_compute-3.21.0.tar.gz.

File metadata

  • Download URL: flow_compute-3.21.0.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.13.3

File hashes

Hashes for flow_compute-3.21.0.tar.gz
Algorithm Hash digest
SHA256 cdf2d68b5f87926715af9826f9120c296eab1747dac6506e4c781c2c35b32536
MD5 cd686c28a1fb3da1a262fa68ea1cac4e
BLAKE2b-256 206a556018bfabbc1374017ae525dda607bc11b6d13ae8fb6c213c3177a3a4f6

See more details on using hashes here.

File details

Details for the file flow_compute-3.21.0-py3-none-any.whl.

File metadata

File hashes

Hashes for flow_compute-3.21.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c7f2d40faf685dab091e64458434ec4d796c8ec1b25d3a606b11722829de55ce
MD5 90cda0ef0728e178a7ab4fc454188db6
BLAKE2b-256 fcfd032263e50a96f4f759b7b43a7c5a57dc1e5ca18b93536e4886dbe6280ac8

See more details on using hashes here.

File details

Details for the file flow_compute-3.21.0-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for flow_compute-3.21.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cbfd7e094c8c49c7ac15fe26e3ffb1aff51ee7bde53c1fcef2addf0232e69934
MD5 95d2036c497d66726b873c18b85671a5
BLAKE2b-256 59523d22a28b90a94000931aa7bdeaa079c7ddccb7cf7050c2b93106fb192896

See more details on using hashes here.

File details

Details for the file flow_compute-3.21.0-cp313-cp313-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for flow_compute-3.21.0-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 01741fca27e8e0640541791fe0220824f8c11e8df8d98d03b719f29b02988d23
MD5 6a2d76b6130a243bf4b6780eb4dd9f28
BLAKE2b-256 2b6ab84a5ab900f4f1ca85e963da9b817cca3ca064205ce24c6fc81b2f8c4205

See more details on using hashes here.

File details

Details for the file flow_compute-3.21.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for flow_compute-3.21.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8c68c8376fb47b85ff44d88ea2cd8d30430a62504869894b882518eb48b73bcb
MD5 85aa103a6a79c5e10236f5b89d8de4ca
BLAKE2b-256 f973138abd55f86b48b0a3907766a12459962fe3536c8436ea0d9c0d0eb5c23f

See more details on using hashes here.

File details

Details for the file flow_compute-3.21.0-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for flow_compute-3.21.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 570627c1a07743ef61798b83ca6b3f14aa2503710fb21e6084726ff03b77f9fd
MD5 e1c0894e64e0c895754e0fa8aea92fe6
BLAKE2b-256 bc0c51ca07b32c0681554fe1cecf3d7aa62fcefea285f487b917fc3581d222f6

See more details on using hashes here.

File details

Details for the file flow_compute-3.21.0-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for flow_compute-3.21.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a29bddd1fd2c8bc58790f21bbcb04e6222dfd55a30794d85de88598edba0a817
MD5 dde84302510473180053d38781738a65
BLAKE2b-256 b242dae9f10f7d4bf9df805577d20e242e4bfb44f68f801d68ec16781a6b71fc

See more details on using hashes here.

File details

Details for the file flow_compute-3.21.0-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for flow_compute-3.21.0-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 aac9af662121b0fd7d531c4ecc9242519df1656460e0dfd352d4c6a983c995ab
MD5 4bbf82376948bf3ec72458871cd6faa0
BLAKE2b-256 7759eb917175f9f8813f604ce2291a605d29e2700fcaa9fcaf94d32e6834b84b

See more details on using hashes here.

File details

Details for the file flow_compute-3.21.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for flow_compute-3.21.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 83a2f6781399dbb69a92c363716354428be2d3c694a086c1206262ad1cd47ed1
MD5 fea5b3e6a55fe5c89670cebe7895448c
BLAKE2b-256 90cc091436b34796b5ccb9eb2d1150392348820d339270cfaed8cf5fe8e894a3

See more details on using hashes here.

File details

Details for the file flow_compute-3.21.0-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for flow_compute-3.21.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 111227b79a2cca98e68cc25f6cfb9de1f9c7dd3f479be8c487078a89265ab49a
MD5 0082f441eac3a5b628ee4bf4521ad9ea
BLAKE2b-256 55ac0b771a61c8ae61099c054e4160d4e4731fbd0e242dae94b7a3fe5d2bbe1d

See more details on using hashes here.

File details

Details for the file flow_compute-3.21.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for flow_compute-3.21.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1b8614401cfac85cbcfd9211ad1e220a1003beb2a08bf67bb38135dd93587a8f
MD5 4ff14bea3779ff9720d969823ebe925b
BLAKE2b-256 2075a2ce96e2f83ae03ec8cb5b82f8c123f67114b97f451136b5bc1b7c6885b2

See more details on using hashes here.

File details

Details for the file flow_compute-3.21.0-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for flow_compute-3.21.0-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 8a88dbfe4debf962fe6388c5bd00872dc361816a006c9edf3087aeffd071121f
MD5 18985976a80f70180d1f90928121adcd
BLAKE2b-256 6443987a9276ae03e18acbd464af571033606e567a36e8c5b9df92c30f45d665

See more details on using hashes here.

File details

Details for the file flow_compute-3.21.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for flow_compute-3.21.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ac1fc52e410969d375987efc9692cc59ff1c76065d37ba84df3969b2355897c3
MD5 958405454db0d0b40fb25fd42c1d485d
BLAKE2b-256 ba336d3432832e9c3544d4650afc8d1b0092ba86ce820520132f6be40ae93dc9

See more details on using hashes here.

File details

Details for the file flow_compute-3.21.0-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for flow_compute-3.21.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 fde3f9cfefb9672999452a5209e224b1221074e8e80e5480be11672b761bfade
MD5 d97ca662d3727f9a33e9b74bad64494f
BLAKE2b-256 a5e116ca7c1b42720a94b4f7431210014651a9f3d607b564853dc392b163d5dd

See more details on using hashes here.

File details

Details for the file flow_compute-3.21.0-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for flow_compute-3.21.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5f7ae366e0ee15a36e8df8f42b65d7aa2a9f5fd393f86c5bf8d22edf8aa863f8
MD5 94fa40d1a12391efacf5d841f577c988
BLAKE2b-256 9059c4b0eeb3866f5260bbfd56740f6e7a9ade4d3e06f8231f179e0496439206

See more details on using hashes here.

File details

Details for the file flow_compute-3.21.0-cp310-cp310-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for flow_compute-3.21.0-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 67e68962602c717e50f8baeb5f8a5565fa9df9cf2789b1403c2bd6bc2c66771f
MD5 247cf2b7b41699ab6c1615694673bea9
BLAKE2b-256 682e41910bd53f6b3a407c50a5f08d746961582f88bb027b1718660d04c393bc

See more details on using hashes here.

File details

Details for the file flow_compute-3.21.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for flow_compute-3.21.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a3a0bf4a627af65eddfef5c375f0ba0f65c9ce11db10b77db316fb7468376219
MD5 6041678bf4e27bbcf399b824a4b6410e
BLAKE2b-256 cdfb134421436c9cf62da4fb780e14bb9a973e5180d2f7816690d6cb260b7a7e

See more details on using hashes here.

File details

Details for the file flow_compute-3.21.0-cp310-cp310-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for flow_compute-3.21.0-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 16c4f7d5ec0ace7f1487107b133892a42e4e67624f00086c3285f57bfbbced80
MD5 15dc72d9f5e60a1e9be29de8e652e72f
BLAKE2b-256 3089d966f147c96817c8795d0ce0e5387507a430c166aea02aabca7aaa95d7d2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page