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.20.8.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.20.8-py3-none-any.whl (1.9 MB view details)

Uploaded Python 3

flow_compute-3.20.8-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.20.8-cp313-cp313-manylinux_2_28_aarch64.whl (4.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.13macOS 10.12+ x86-64

flow_compute-3.20.8-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.20.8-cp312-cp312-manylinux_2_28_aarch64.whl (4.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.12macOS 10.12+ x86-64

flow_compute-3.20.8-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.20.8-cp311-cp311-manylinux_2_28_aarch64.whl (4.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.11macOS 10.12+ x86-64

flow_compute-3.20.8-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.20.8-cp310-cp310-manylinux_2_28_aarch64.whl (4.9 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.10macOS 11.0+ ARM64

flow_compute-3.20.8-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.20.8.tar.gz.

File metadata

  • Download URL: flow_compute-3.20.8.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.20.8.tar.gz
Algorithm Hash digest
SHA256 8bfebb536383b0aff2f9ab199fa9ca092fbfb4eb67f1d4943c67186611a26cd2
MD5 daf2809d57a8ab7fcbc509e70b4a5161
BLAKE2b-256 fc182224116490d171867919132cc733a63f08232bbeb324c0c2ae39933bc432

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.8-py3-none-any.whl
Algorithm Hash digest
SHA256 6af0d8f0264e4ca0fa723958fdc232c7df44ce54c4f968358de88198de13df9c
MD5 bb95971aa9022e8bf35643a7b03541c1
BLAKE2b-256 b894c0db96b6908de6a157a7f1ed2f12110081d84d40f5d584c6670be7d3b75d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.8-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8b35e8dec188b4c925a02d6be95cc4906a6d366476ffca9247a4b5e174607a74
MD5 1baedde9df52c2ca5605b94aafe3f73f
BLAKE2b-256 ef680a60c5a5aa89d5b296b07aa5b1eae498b4dc6051ded643b59db774a7acec

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.8-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 ed329efbbca5cb03ec9ea763fcf2606df12d12a481de99493b5069e5d2b32e11
MD5 68354f6df8bb7de37ac56c11b97b78c2
BLAKE2b-256 abff7de75fc2a1dd1e2854dfae09a31bf8be6b198ee9c4fc63f04e1c2751aa13

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.8-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b6c57bde9c0c02bb855766354cd08d28e82e092727845ce1bd9dd3b7410cb42e
MD5 cac4d6cb5fba40c6bba20677a0e7d315
BLAKE2b-256 5dfee31f15e6d5164c2ce83f27934462d4051427118c336af1ae9d5f9a5189e0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.8-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 202808d5f3ce3c29d48158fb483139548b701d25669d4969209cac80ccd69d3b
MD5 8d013752b4aec5674160a85338a44d0d
BLAKE2b-256 3b67aca70eeecaaa3b4753d4f51770cb53a0d8453516b670394f815a7bf55041

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.8-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 43007684ee1329f4ccacd5ff5883f59c2565b68d86ec214941ecc233b36e0fcd
MD5 354f22f62fa121a4de4a1606f51dfe0b
BLAKE2b-256 9e510893366f791bacb2773739516ace53c57f26642cfca095a7aaa76fd063ef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.8-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 0b4c5fca93ba14ea6a03d6ab70431e657f0230a6fa7d16f92bf377106044698e
MD5 44c44af2c74691c53c6c9de0e702b844
BLAKE2b-256 361172161586e7c6c404100851449fdb4fcd3eaca0294a6c15d0b165ef0307c8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.8-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0a498cb4b6bda7c106703b10412a5a023f04bad6698b35eff9c98163a6eb13f4
MD5 e2e3f08e7eb8ca94b9aabbb2b059829d
BLAKE2b-256 e572aca72637a6d6a4f0a7e0aa0e07a4a3b0312bd582370f1e517a9abfa59339

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.8-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ec87a1bbc6c4a574c33a74220e740083acd5dd6d6dde64aefaf08a4051039ebc
MD5 47f70fde6f1e55f0fb12cf18e1f46390
BLAKE2b-256 84b9098230578077373dbc6910b57209858a816ac1395f21768d31c8cc16d3db

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.8-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 76853414d6c1348fe0d5ea9b035fd3d988664b9dc564c501ac851948a4703c9a
MD5 ae1456cf304f6b62763725ad3048828e
BLAKE2b-256 b25739078780bcd7af9c85ec3f551906633e8fbc6e32721dbb79eb6769ea5550

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.8-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 df3282c3e91f75bd1c4845b4671e832c8dd8d4fae292ce6c7e13a64874b38566
MD5 421007a1c58453fe85573409f7a2f5b0
BLAKE2b-256 54fb9861af327e4da29359e9955b4b204c62e9749f804b35366e2992a9cdc034

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.8-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c87d251049dd9c2240ff623491566e92fc9077fa9c54461dc53e304d3a7c24f3
MD5 ae0b298c5dd44181fb770f65989f0a54
BLAKE2b-256 49714a878b246512a4566269bdb2564faeb8a378841d859f40def9ea9783fc39

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.8-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 c6ebd5afbc8b91dcfd0010390f34b5e501dcaaab8df96206e94ee22d03483383
MD5 7db7e8e724f38ce9371c1ec0fa2b6762
BLAKE2b-256 e52508ebb65c2e4914dd548c4f2444b3c476fe63336678b032baae78942557c5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.8-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b762bd6960999088a9d68d676e95e95e2d97a474887a1489d3f1d849ea490242
MD5 537aded8b3cda14b5e7afe340f2dd609
BLAKE2b-256 4d75378471738db54dae468faa29835cac10eb1941165a0be8ce7004f22fe41c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.8-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 bba40925e78593d98c57d5c8baba609524cce1f2159959281f34245e89d223e4
MD5 5dea1ffd1ebf1f7859c3b4030f457e0f
BLAKE2b-256 b0abe4a90ca455af3143ec72b17981f0e174cc46d40371f5c368a3123dd1b8d6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.8-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 93ce3d1bd37fa1791af4cf8dbdcf24316d2139f3319fbe1d2203f5711740ed39
MD5 2d4aa48a98b06db7f0bd37fb8e91b58f
BLAKE2b-256 2c72c5aea4f2711e9c00882a86537abcf60588a1151652db298f32e87a94b205

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.8-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ac7e84e3eec18ed18a6dd80982d38fae32d75aff477861648c86e9747bf919bc
MD5 42d53085c01f56c544c2458edb1f29d7
BLAKE2b-256 7e0e1107857ece7e477cfc1880f3cacee7479247f275ebe7675ef4ab9c0722d4

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