Skip to main content

Getting started

Flyte is a type-safe, distributed orchestrator for AI, ML, and data workloads. It allows you to author tasks in Python and execute them across various environments with built-in caching and resource management.

Prerequisites​

Before installing Flyte, ensure your system meets the following requirements:

  • Python: Version 3.10 or higher.
  • uv: The uv package manager is required for installation.
  • Docker: A running Docker daemon is required to build images and wheels for local changes.

Install​

The primary way to set up Flyte for development is using uv. This will install the package in editable mode and build the necessary distribution files.

# Sync dependencies and install the package
uv sync

# Build the distribution wheel
make dist

Hello world​

Create a new file named hello_flyte.py to define and run your first Flyte task.

import flyte

# Define an execution environment
env = flyte.TaskEnvironment(name="local-env")

# Define a simple task
@env.task
def greet(name: str) -> str:
greeting = f"Hello, {name}! Welcome to Flyte."
return greeting

if __name__ == "__main__":
# Execute the task locally
result = greet(name="Developer")
print(result)

Run the script directly:

python hello_flyte.py

Verify​

To ensure your installation is working correctly and adheres to the project's quality standards, run the following verification commands:

# Run unit tests
make unit_test

# Check types with mypy
make mypy

# Format the code
make fmt

Other install options​

If you prefer not to use uv, you can install Flyte using standard Python tools:

  • pip: pip install . from the root directory.
  • Source: You can include the src directory in your PYTHONPATH.

Next steps​

Now that you have Flyte running, explore more advanced features:

  • Task Authoring: Learn how to structure your modules in the Tasks and Templates.
  • CLI Usage: Explore the built-in CLI tools (flyte, fserve, c0) by running flyte --help.
  • Plugins: Extend functionality by exploring the Extensibility & Sandbox.
  • API Reference: See the full API Reference for detailed class and function signatures.

Troubleshooting​

Docker Daemon​

If you encounter errors related to Image() or building wheels, ensure your Docker daemon is running. Flyte requires Docker to package local changes into a usable container image.

Module Imports​

If you receive ImportError, ensure you are running your scripts from the root of your project or that your root_dir is correctly initialized via flyte.init(). For more details, see the Configuration.