flyte-sdk: The Python-Native Orchestration Platform
Build, deploy, and scale reliable AI agents, data pipelines, and ML models with simple, async-native Python.
Overview
Welcome to flyte-sdk, a modern, async-first Python framework for building and orchestrating complex, distributed applications. Whether you're developing sophisticated AI agents, running large-scale data transformations, or deploying high-performance machine learning models, flyte-sdk provides the tools to write clean, scalable, and production-ready code.
At its core, flyte-sdk leverages Python's native async/await syntax to make concurrent and parallel programming intuitive. It automatically containerizes your code, manages dependencies, and handles data flow, letting you focus on your application's logic. From simple scripts to complex graphs of interdependent tasks running across a distributed cluster, flyte-sdk simplifies the entire development and deployment lifecycle.
This platform is designed for versatility. Use it to build multi-tool AI agents that can reason and execute code, orchestrate distributed training jobs with PyTorch or Spark, serve interactive web applications with FastAPI and Streamlit, or automate critical data pipelines with scheduled triggers. With features like data-aware caching, durable checkpoints, and a powerful sandboxing environment, flyte-sdk is built for reliability and speed.
Key Concepts
-
Tasks & Traces Core Concepts: The fundamental units of work. A
@taskis a containerized, distributed function, while a@traceis a lightweight, observable Python function perfect for instrumenting operations like LLM calls. -
Execution Environments Execution Environments: Define how and where your code runs. A
TaskEnvironmentspecifies the container image, dependencies, and resources for batch jobs, while anAppEnvironmentis used to deploy and manage long-running services and web applications. -
Async-Native Orchestration Sandbox Orchestration: Compose tasks into powerful, parallel workflows using familiar Python constructs like
async/await,asyncio.gather, andflyte.map.flyte-sdkhandles the complexity of distributed execution behind the scenes. -
Data & IO Types Data Types and IO: A rich, type-safe system for handling data. Built-in types like
File,Dir, andDataFramemanage data serialization, storage, and movement between tasks automatically, enabling efficient, zero-copy data passing. -
Sandboxed Execution Dynamic Code Sandboxes: Securely run arbitrary or AI-generated code in isolated environments. The
flyte.sandboxprovides a powerful mechanism for creating dynamic, on-the-fly tasks, essential for building autonomous agents and extensible systems. -
Apps & Serving Remote App Serving: Go beyond batch jobs by deploying persistent, long-running applications. Serve FastAPI APIs, Streamlit dashboards, Gradio demos, or custom model inference endpoints directly from your Python code.
Common Use Cases
- Building and orchestrating multi-tool AI agents that can reason, search the web, and execute code.
- Large-scale, parallel data processing and ETL pipelines using Spark, Dask, or Ray.
- Training and evaluating machine learning models, including distributed training and hyperparameter optimization with Weights & Biases.
- Deploying high-performance model inference APIs and interactive web applications.
- Automating recurring data workflows and business processes with scheduled triggers.
Getting Started
New to flyte-sdk? We recommend starting with the Getting Started guide to set up your environment. Then, dive into our Tutorial: Your First Anthropic Agent to see the power of flyte-sdk in action. For practical examples, browse the use case examples to find a workflow that matches your needs.