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.22.0.tar.gz (1.7 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.22.0-py3-none-any.whl (2.0 MB view details)

Uploaded Python 3

flow_compute-3.22.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.22.0-cp313-cp313-manylinux_2_28_aarch64.whl (5.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

flow_compute-3.22.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.22.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.22.0-cp312-cp312-manylinux_2_28_aarch64.whl (5.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

flow_compute-3.22.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.22.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.22.0-cp311-cp311-manylinux_2_28_aarch64.whl (5.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

flow_compute-3.22.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.22.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.22.0-cp310-cp310-manylinux_2_28_aarch64.whl (5.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.10macOS 11.0+ ARM64

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

File metadata

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

File hashes

Hashes for flow_compute-3.22.0.tar.gz
Algorithm Hash digest
SHA256 a1e2b2e2b38c14a047a69488bbeb183ff3865658b7c3944ea7ad90cfc69113fa
MD5 f1608c6535c6e7f998db0ff4d9dd4920
BLAKE2b-256 8f106d1ecf3437ced20b2b81e756502a131b53c90637f72519f07c82b8462261

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.22.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8c72eca7c57849a2bf09717c790b0ed48fee06df5b3178a43853aaa072836e35
MD5 ac4c4ad73d5fc901007dccb5f0bcf9d5
BLAKE2b-256 ff1b21e39a38150bb54cc6bbd70f281ff4a27ad5b233dcea0e0450a7652f8f6d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.22.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c8a5a65892fa42514647f64389d7b40b1a0c6ee06bd1762ddbc91481fe32d848
MD5 abeff5ae9bf4dbcf32f65e8ececd8e30
BLAKE2b-256 33a528735201874f727d8eb530fd56776f2dfdb938ff7b441106d4651a6d4bb1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.22.0-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 e17aa8a49cf97ad2b46bdd0c6b59f5ddd98ed230a3e8db0ff399ea2c1d112598
MD5 bd4a58ff372eefd2e86dee25cf76ff64
BLAKE2b-256 9b07406128eb7712ecd39621e44476dd4811ad645ec70529463c4f19d5c9affb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.22.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3fe838e832dde7626a291d306bd100f87750c2c246ef242bee0532fd1c231539
MD5 c1fd71350f97a429c6b49c95b751cb93
BLAKE2b-256 53e4a10bbb0d0cb96bbd4a4359c6ff2e1616267267b522cc758f6491c1d70a7b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.22.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d6a09031cbe4a3f0c25fb9df644588c5b9a71114a392181983aec84312ae4c87
MD5 9b31181dbd1a791cde00c6ac9ec4b396
BLAKE2b-256 92858199dae65d525237e8cf5a1d8f87cfdc21b2df7d68ac211c789018982a57

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.22.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6707616eda4a896b40df9c70233f240fb87beb89aa89e2f3c888c4c977abc017
MD5 bf21b4842e50bd55f3c7e322296172d1
BLAKE2b-256 d23ea3f0d65a2e5c6d123b7ddae7a3ae28447b45251b277b1b6f51c1c457af23

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.22.0-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 509af9309d615e7fee84afb2d220cd42cd47a82feaf0f2ff35368314966fb1b1
MD5 bcba98131bf273768f89909211858703
BLAKE2b-256 5ab5d46345a0b3e860eecd0ccb395cf6a9fda0ffb150f2f2b1c509528cf93c06

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.22.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fe4bbfdb85dc538b98ebb1fe8329712038b1a82be32434c3b57f731f279275a5
MD5 3f22ee9b60fdbe1008824971161d2d63
BLAKE2b-256 f0ca7766a1169325d155980d8e4b6aa5f4df3aeb4c9f2bd990fdf7023fd61886

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.22.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8fb69b5c8498ee594dc656fc4e5504d23fe8721d967014b268e445c0efb7cc8d
MD5 4af205483447e1a12ae31b2c73d2e88a
BLAKE2b-256 f7917e1bc3c794fa9707bc6fde90d23b0226833693d3250d42e8e19349b0e266

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.22.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 6a9e7ea3c8ee69fda88d2bf5b4c921f22b0854adf1734e455b748bd0b70e2679
MD5 608db447d3336265ad19e366130fcea2
BLAKE2b-256 0eb6d4b66ae925620cd14e6f607572bce380ab9da40af7e762dad229699704a6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.22.0-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 bc263da5457f7ec784ef834d02c601c5b3a721a0246aba7c4079d5fff84f0127
MD5 7b8a95a31c53d9aa182e8b523ae6277a
BLAKE2b-256 aad64d76b66d959fd1f522730a015549b24b8e9396ed410f67f88c48e94a0009

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.22.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c21413e6be5c0b8ebdf3bc469661a72e6e18c171a015031f8f8254024af4d4e6
MD5 c136b17ebcf32594db739f6cecbbfac7
BLAKE2b-256 222fee116ba7a0d4f3b26b693c0bf6adae975540cd5d98514ba3f8c5c51e62ac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.22.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 bb38092afb66fd92bd6cd072851e8ceeff36c32cdbaf7507c1be4b55f19d201b
MD5 d6a4059940565fc877faf5aab44794e7
BLAKE2b-256 b311b946b90f33c0a3133addb962d5d96dd7f8578b79cc81778c5ac784456c11

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.22.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3c10337c884b6b89c45a8b1ce4d2e0d7f57fd24ec9083a605c6b30c76b968287
MD5 b15929599d5d68c778cbef481ce5286d
BLAKE2b-256 db0d75a099b88a6014ee89cd8f85e0c6edfb236e1cb3f25c9c699904b80a8f34

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.22.0-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 9a222bff877d34a37ee6507e8d19ae2bcd562b8ac1e944176a9119df382ad199
MD5 48f100304834ebb7add62597af3ef830
BLAKE2b-256 733074bcc26429505186ef3f8d851964f7ebb204c6e60082133d463a36be2f4c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.22.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d6b57da96909df6868831d06d984f7037b0ee040f5e8e220fe5467a6688bbf64
MD5 dbf1c5e7bcc740903fb5747fa094b9e1
BLAKE2b-256 0ab21837e3cc6cddf3c5b2d5974372a6d702a7f284a0ac0257bce596654138af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.22.0-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7703446dc7ad1d6d6718e23b8d001662343a8600b7d9a628e1ceacfec50d2757
MD5 b3915f208d8aaeda74c985a48bca8353
BLAKE2b-256 d879af08c46afab66d4f9aabc797deb45cb72ddf63614f543da08ba8701cbe8c

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