█

AI/TLDR

Me pague um café
Me pague um café

Flyte

Orquestre pipelines de ML, modelos e agentes em escala usando Python puro

GPU & Compute CloudsCódigo aberto
Idioma
Python
Licença
Apache-2.0
$uv pip install flyte
EM RESUMO

What is Flyte?

Flyte é um motor de workflows para orquestrar pipelines de machine learning, modelos e agentes em Python puro. Você define tasks como funções Python comuns, e o Flyte as executa como um workflow versionado e reproduzível, que pode escalar do seu laptop até um cluster distribuído. It sits in the GPU & Compute Clouds category of the Models & Inference tools and is open-source, written in Python and licensed Apache-2.0.

Visão geral

Flyte é um motor de workflows para orquestrar pipelines de machine learning, modelos e agentes em Python puro. Você define tasks como funções Python comuns, e o Flyte as executa como um workflow versionado e reproduzível, que pode escalar do seu laptop até um cluster distribuído.

Ele foi feito para engenheiros de ML e de dados que querem sair de scripts locais e chegar à produção sem reescrever o código. O Flyte 2 permite escrever Python assíncrono comum, rodá-lo localmente com um único comando e executar o mesmo código em um backend nativo do Kubernetes.

No espaço de orquestração de computação, o Flyte foca em reprodutibilidade e versionamento. Cada task roda em uma imagem de contêiner definida, e o mesmo workflow pode ser invocado a partir do Python ou da CLI do Flyte.

O que faz

  • Defina tasks de workflow como funções Python comuns usando o decorador @env.task
  • Escreva pipelines assíncronos e paralelize o trabalho com chamadas como calculate.aio(num) e asyncio.gather
  • Fixe cada task a uma imagem de contêiner com flyte.Image.from_debian_base e with_pip_packages
  • Rode o mesmo código localmente com python ou remotamente com o comando flyte run da CLI
  • Sirva modelos como endpoints, incluindo apps FastAPI via FastAPIAppEnvironment
  • TUI local para uma experiência de desenvolvimento mais rica por meio do extra flyte[tui]

Primeiros passos

Instale o Flyte, escreva uma task em Python e rode-a localmente ou pela CLI.

Instale o Flyte

Instale o pacote principal com o uv. Para a experiência de desenvolvimento local com TUI, instale o extra tui.

bashbash
uv pip install flyte

Escreva um workflow

Defina um ambiente de tasks e decore funções Python como tasks. A task principal assíncrona distribui o trabalho pela task calculate.

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}")

Execute o workflow

Rode o script diretamente com Python ou invoque o workflow pela CLI do Flyte com argumentos inline.

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

Commands and code are distilled from the project's own documentation — always check the repositório oficial para as novidades.

Quando usar

  • Transforme scripts locais de treinamento de ML em pipelines versionados e reproduzíveis que rodam em um cluster
  • Distribua tarefas paralelas de dados ou modelos usando Python assíncrono e asyncio.gather
  • Sirva um modelo treinado como endpoint HTTP com um app FastAPI
  • Rode o mesmo workflow localmente durante o desenvolvimento e remotamente em produção, sem mudanças no código

How Flyte compares

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

FerramentaEstrelasO que faz
Ray★ 44.4kA distributed computing framework that scales Python and ML workloads for training, tuning, data processing, and serving.
Prefect★ 24.3kA Python-native workflow orchestration tool for scheduling, running, and monitoring data and ML pipelines.
Dagster★ 16.5kA data and ML pipeline orchestrator with a declarative asset model, built-in lineage, and observability.
Kubeflow★ 16kA Kubernetes toolkit that brings together pipelines, notebooks, and training operators for running ML workflows at scale.
Kedro★ 11.1kPython 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.9kA framework that runs AI jobs across clouds and Kubernetes, automatically finding and provisioning the cheapest available GPUs.
Metaflow★ 10.4kA Python framework from Netflix for building and running data science and ML workflows that scale from laptop to cloud.
Flyte★ 7.8kOrquestre pipelines de ML, modelos e agentes em escala usando Python puro