AI/TLDR

Flyte

Orchestrate ML pipelines, models, and agents at scale in pure Python

GPU & Compute CloudsOpen source
Language
Python
License
Apache-2.0
$uv pip install flyte

Overview

Flyte is a workflow engine for orchestrating machine learning pipelines, models, and agents in pure Python. You define tasks as plain Python functions, and Flyte runs them as a versioned, reproducible workflow that can scale from your laptop to a distributed cluster.

It is built for ML and data engineers who want to move from local scripts to production without rewriting their code. Flyte 2 lets you write ordinary async Python, run it locally with a single command, and execute the same code on a Kubernetes-native backend.

Within the compute orchestration space, Flyte focuses on reproducibility and versioning. Each task runs in a defined container image, and the same workflow can be invoked from Python or the Flyte CLI.

What it does

  • Define workflow tasks as plain Python functions using the @env.task decorator
  • Write async pipelines and fan out work with calls like calculate.aio(num) plus asyncio.gather
  • Pin each task to a container image with flyte.Image.from_debian_base and with_pip_packages
  • Run the same code locally with python or remotely with the flyte run CLI
  • Serve models as endpoints, including FastAPI apps via FastAPIAppEnvironment
  • Local TUI for a richer development experience via the flyte[tui] extra

Getting started

Install Flyte, write a task in Python, and run it locally or through the CLI.

Install Flyte

Install the core package with uv. For the TUI local development experience, install the tui extra instead.

bashbash
uv pip install flyte

Write a workflow

Define a task environment and decorate Python functions as tasks. The async main task fans out work across the calculate task.

pythonpython
import asyncio
import flyte

env = flyte.TaskEnvironment(
    name="hello_world",
    image=flyte.Image.from_debian_base(python_version=(3, 12)),
)

@env.task
def calculate(x: int) -> int:
    return x * 2 + 5

@env.task
async def main(numbers: list[int]) -> float:
    results = await asyncio.gather(*[
        calculate.aio(num) for num in numbers
    ])
    return sum(results) / len(results)

if __name__ == "__main__":
    flyte.init()
    run = flyte.run(main, numbers=list(range(10)))
    print(f"Result: {run.result}")

Run it

Run the script directly with Python, or invoke the workflow through the Flyte CLI with inline arguments.

bashbash
flyte run hello.py main --numbers '[1,2,3]'

Commands and code are distilled from the project's own documentation — always check the official repo for the latest.

When to use it

  • Turn local ML training scripts into versioned, reproducible pipelines that run on a cluster
  • Fan out parallel data or model tasks using async Python and asyncio.gather
  • Serve a trained model as an HTTP endpoint with a FastAPI app
  • Run the same workflow locally during development and remotely in production without code changes

How Flyte compares

Flyte alongside other open-source gpu & compute clouds tools AI/TLDR tracks, ranked by GitHub stars.

ToolStarsWhat it does
Ray★ 43.8kA distributed computing framework that scales Python and ML workloads for training, tuning, data processing, and serving.
Prefect★ 23.8kA Python-native workflow orchestration tool for scheduling, running, and monitoring data and ML pipelines.
Dagster★ 16.1kA data and ML pipeline orchestrator with a declarative asset model, built-in lineage, and observability.
Kubeflow★ 15.9kA Kubernetes toolkit that brings together pipelines, notebooks, and training operators for running ML workflows at scale.
Kedro★ 11kPython framework for production-ready data engineering and data science pipelines, hosted by the LF AI & Data Foundation: a project template, a Data Catalog of connectors, and a dependency-resolving pipeline abstraction.
SkyPilot★ 10.6kA framework that runs AI jobs across clouds and Kubernetes, automatically finding and provisioning the cheapest available GPUs.
Metaflow★ 10.3kA Python framework from Netflix for building and running data science and ML workflows that scale from laptop to cloud.
Flyte★ 7.5kOrchestrate ML pipelines, models, and agents at scale in pure Python