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

Uploaded Python 3

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

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

flow_compute-3.20.7-cp313-cp313-macosx_11_0_arm64.whl (4.7 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

flow_compute-3.20.7-cp312-cp312-macosx_11_0_arm64.whl (4.7 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

flow_compute-3.20.7-cp311-cp311-macosx_11_0_arm64.whl (4.7 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

flow_compute-3.20.7-cp310-cp310-macosx_11_0_arm64.whl (4.7 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

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

File metadata

  • Download URL: flow_compute-3.20.7.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.7.tar.gz
Algorithm Hash digest
SHA256 d2ad3743239a691c8cd211f07ce4cc8132eeca19a8ea3bd28d338fe1b6081cc2
MD5 a6ebc91d438a49fc6f33abd713a47e8a
BLAKE2b-256 e09d67633a6cb687e4ba74326370bcaadc4643c220b898f78e5ae3c8f6c88880

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.7-py3-none-any.whl
Algorithm Hash digest
SHA256 d761b736e7d55349daadccaf711c6b6744e0125bc2263eef3927afae65ad7475
MD5 ae29bbed2f68b45c5c3f2c90b13636ef
BLAKE2b-256 88488f4e5088ccc97aafba40bcc928295ad1adf4f3002831ce4a58708f03954f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.7-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1579c7cc4ebbfd92d55aff734185bf81e8182bad77074587e98d77cbfb32bc34
MD5 89e660e1814f68d0241b44a2431c62da
BLAKE2b-256 4f67fb7b9549fb6863bd2335d0ee9855dc2daee2bf283badecf923f5c7ffdf3b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.7-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 a75e95606e97083dbdf62ece04dce6690edfdedd9bea1a4d84e0d2ea55ca8ab6
MD5 243175ccc1e460d964fe101e9e904b9b
BLAKE2b-256 a37016bc28b554babee149f36998c751a3355977b9152169e845d003ebe45398

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.7-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f42beb33303b40fa18bb98f1151685b8036216ab861ecb4e6b9974c302ec1dfb
MD5 5540b80dcf194969b31cc50fe7b363c1
BLAKE2b-256 e49325e5c22f81a3715a86646864472531966973f006998818b1e47c325f1573

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.7-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 e3451b68bff6767ed03a21d2e93afdbb774a562aeb4ebc6130f8c8193a4723c7
MD5 d9b6fbcfe394e46e5a1eeadaf37ca3f5
BLAKE2b-256 9b1e603120dd414defec453bfb88ddfc6ba955bca6c0dc8da326357ef908a663

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.7-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a765820b3b93c3ab16ada93f43984453f940caf31ec709e9d898e84afe9e40a9
MD5 476df351123a8da649b3cb255799f825
BLAKE2b-256 74025d2cd47e45e07c074118143507e8de9bb94e0f1b7b78603bb8196b50e9e7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.7-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 c25e475404277d1e08db59b36f2e3fcc88165d71f7ec7eac5bcaa1db6b4afbfc
MD5 c70f25c746346c98952f88fb2b398f42
BLAKE2b-256 139e1b1b4a21a09430bd215692acf4b66e0e61e34879117902b1b87bd5ec79b9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.7-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 09a87f515f875f3605a8191e234223fff696636e4d68232a646d43e652f63793
MD5 a17d3aa33747510b18d1573c91b3ebad
BLAKE2b-256 996f39649ebd9d5744f80ab6fdffcbae8b47863d851fb9542dcf7fb45766fa2e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.7-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d278136af956e3dd04dc43b0d9e4c8290df9d125097d9a63a7f68944bdcbfaa8
MD5 2803e193c72a560a4c37b7a2c1d3c59a
BLAKE2b-256 58ef13ba57fe0d76ba852d2e7403c3e75dfed510ae87e38644ac16b2747ed043

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.7-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6334f199d56fce735b733c6b2a76e4526dbc4a7c429804ea2cf0b75a44f9a3d6
MD5 26a4f2769e03d3fed3057ee1ea2d9e46
BLAKE2b-256 98a36bf20ac691cc7801193310ed00b3f2ab64102fd31ffde3e26ee3bd041c16

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.7-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 dade504aa0d19544adf0eefc47ecb23dd7f5365dc3ff2b2ca279a246c21b7345
MD5 3d988c3d9e296dc98879b2764151f2a6
BLAKE2b-256 16bc9e2cc0c3abbb5862f3738e8c5c1570cbd4954ac63c702300c4f63dd03d7a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.7-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 053da31da186508d63112d8527db81310d168732a900082b80e26d2c04818693
MD5 ecc610339512bee24d3e96630e353c42
BLAKE2b-256 8e7daf36dd3677bcfb99bf9f6a1153e973b97507bbc3b53ce5540dcd3c192273

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.7-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d629792bd67dabb1f5682c0259a498897094b8fc17f8e539f69c14913f24964b
MD5 38ff53270ebbeb61a02df67de30211d9
BLAKE2b-256 64bbbc3a3c171ce45d91859d290e36d70c001dd063dd10fd71d327f9dd70eaa0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.7-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a55a7bc78e3a43230c8d0595a3f2527d9757261d9fcbfa5057350e8331aacdad
MD5 625ea63981acbbf21cb2398e80d2a212
BLAKE2b-256 ffbb0e0796c94e220ce3f6c1e3958ef2d4835bba71c2c4b22b4a3ea5da7b18c8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.7-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 ef092965fba7019f71f969f14d6a2310f389163734caa8d0ac2ec5c2f6e631fb
MD5 6d78e5aecaa924ec15d4b3e507fdc2ec
BLAKE2b-256 607d2bd485d8ac8ea469c735a56a21f4d9b47df66976fe4305b1382fa85156f8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.7-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c498828e7fcc304faa6856f25a3789fd88f4fc6e83fd8907bcbe4168ed5d648c
MD5 192565da34019ae2cdd7af8f4548aa66
BLAKE2b-256 504c40f2c5a7c71701e4825003c2c6d216e5301e1a5e65c71707a31aee242b77

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.7-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 408bd0415166b76f5d218776e5f5b37851dc8bf41f0e95a52b8c6199740903b6
MD5 9be9e67c6e65c30712f4399c1663c004
BLAKE2b-256 2324d5130be657bbec6c0379dc8e11b496ced45262919d191729a63146647c87

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