Skip to main content

CLI and SDK for submitting and managing GPU workloads

Project description

Flow CLI & SDK

Python → Petaflops in 15 seconds. Flow procures GPUs through Mithril, spins InfiniBand-connected instances, and runs your workloads—zero friction, no hassle.

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  # Sets up your authentication and configuration
flow dev   # Interactive box. sub-5-second dev loop after initial VM config

Optional assistant integrations:

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

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 in seconds; from idea to training or serving instantly. 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 GPUs always available, self-serve; no haggling, no calls. Uncapped spot + 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 → spin up a 20-node GPU cluster in seconds
  • 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 loops in seconds.
  • 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

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 (PowerShell):
    powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
    

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(
    command="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.3.tar.gz (1.4 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.3-py3-none-any.whl (1.6 MB view details)

Uploaded Python 3

flow_compute-3.20.3-cp314-cp314-macosx_11_0_arm64.whl (4.5 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

flow_compute-3.20.3-cp311-cp311-manylinux_2_28_x86_64.whl (4.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

flow_compute-3.20.3-cp311-cp311-manylinux_2_28_aarch64.whl (4.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

File details

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

File metadata

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

File hashes

Hashes for flow_compute-3.20.3.tar.gz
Algorithm Hash digest
SHA256 093952de944b145214358a17582d0182818d40f31b045801683108e6498ff33c
MD5 da4f4be8f8fc7909181ef3a83bbb6a0d
BLAKE2b-256 e93d15c587ecc199edb31b8f40e594e052578bef522820d3e901ea2bbfcb8afb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.3-py3-none-any.whl
Algorithm Hash digest
SHA256 88651489d9064046daed6a7eb5672b605f2ca66857ef00bdde9cb63a877f3eaa
MD5 9af037a62967f2b3ecc0c689655bab16
BLAKE2b-256 edb3d7d5d15b0fe550daa592270332c4737a6a65cde800a0baecf1f7809153a1

See more details on using hashes here.

File details

Details for the file flow_compute-3.20.3-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for flow_compute-3.20.3-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fb044932474e13a71b82be7be6261fd97f0750ee8d91d20ff4f5f6331482a673
MD5 5e871da7f4f319bca68e87a8ff52b2b8
BLAKE2b-256 ec62668891e94afce4d1d5bfc4d8a1fa0feba6353ac8a0dc4cd01d10f3030579

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.3-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1e24b0937ba65813c36da267cdf3e5818951eccd2131f19f2a08b679fa611aba
MD5 a66b3ddd750a403af8a560799abdc180
BLAKE2b-256 ad1a01947722a88cb17c9984337f67e4a49072d3db988eb436d4a4a81dda6188

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for flow_compute-3.20.3-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 b80d6175454c843a7638eddca9be12c662edbeb4c4fbf6c1994fa3b61648e243
MD5 ace7710df1e5d300dba6565d636ffef5
BLAKE2b-256 d1b1b2e3c1e7b92211edfb0db281504beb74789449a2f13fdb6ef2e78d06148c

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