Reliably orchestrate ML pipelines, models, and agents at scale — in pure Python.
uv pip install flyteFor the full SDK and development tools, see the flyte-sdk repository.
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}")| Python | Flyte CLI |
python hello.py |
flyte run hello.py main --numbers '[1,2,3]' |
# serving.py
from fastapi import FastAPI
import flyte
from flyte.app.extras import FastAPIAppEnvironment
app = FastAPI()
env = FastAPIAppEnvironment(
name="my-model",
app=app,
image=flyte.Image.from_debian_base(python_version=(3, 12)).with_pip_packages(
"fastapi", "uvicorn"
),
)
@app.get("/predict")
async def predict(x: float) -> dict:
return {"result": x * 2 + 5}
if __name__ == "__main__":
flyte.init_from_config()
flyte.serve(env)| Python | Flyte CLI |
python serving.py |
flyte serve serving.py env |
Install the TUI for a rich local development experience:
uv pip install flyte[tui]Try the hosted demo in your browser — no installation required.
The open source backend for Flyte 2 is coming soon. This repository will contain the Kubernetes-native backend infrastructure for deploying Flyte 2 as a distributed, multi-node service. See the Backend README for the current state of the backend, protocol buffer definitions, and contribution guide.
If you need an enterprise-ready, production-grade backend for Flyte 2 today, it is available on Union.ai.
- Live Demo — Try Flyte 2 in your browser
- Documentation — Get started running locally
- SDK Reference — API reference docs
- CLI Reference — CLI docs
- flyte-sdk — The Flyte 2 Python SDK repository
- Join the Flyte 2 Production Preview — Get early access
- Slack | GitHub Discussions | Issues
We welcome contributions! See the Backend README for backend development, or join us on slack.flyte.org.
Apache 2.0 — see LICENSE.
