Flyte & Union.ai Tutorials
Tutorials and examples for building AI agents, ML pipelines, and data workflows with Flyte 2 .
Tutorial
What you'll learn
Flyte Basics
Flyte 2 fundamentals — tasks, pipelines, error handling, TaskEnvironment, ReusePolicy, map()
LangGraph ReAct Agent
Build a ReAct agent with tools in a single file
Stable Diffusion
GPU inference with Flyte reports
Image Classifier
Fine-tune ResNet18 on HuggingFace dataset with PyTorch
DuckDB ETL
Data pipeline with DuckDB SQL and Flyte reports
Snowflake ETL
ETL pipeline with the Snowflake connector
Flyte Local Dev
Local dev features — TUI, caching, reports, tracing, serving (no cluster needed)
Fraud Detection with Feast
Fraud scoring pipeline with Feast feature store, XGBoost, and real-time serving
Tutorial
Description
LoRA / QLoRA / Full
Fine-tune an LLM on text-to-SQL with LoRA, QLoRA, or full fine-tuning — live training reports, FastAPI serving, Gradio UI
GRPO — Code Generation
Teach a model to write Python with GRPO — reward = sandboxed test execution, MBPP dataset, live reward/pass-rate charts
GRPO
GRPO fine-tuning on math/reasoning tasks
DPO
Direct Preference Optimization for alignment
PPO
Proximal Policy Optimization for RLHF
Tutorial
Description
Genomic Variant Effect Prediction
Score DNA mutations with HuggingFace Carbon genomic foundation model — zero-shot pathogenicity prediction on BRCA2, TP53, KRAS, and more
DNA Sequence Generation & Analysis
Generate DNA with Carbon and compare to real genes — GC content, codon usage, ORFs, dinucleotide frequencies
Gene Comparison Across Species
Compare homologous genes across 6 species with Carbon scoring, phylogenetic trees, and ESMFold 3D structure comparison
Protein Sequence Analysis
Analyze protein properties, compute sequence similarity, run ESM-2 embeddings, and predict 3D structures with ESMFold
Drug Molecule Screening
Virtual drug screening — compute physicochemical properties, apply Lipinski's Rule of Five, rank candidates by drug-likeness
Cell Microscopy Classification
Fine-tune a Vision Transformer (ViT) to classify blood cell types from microscopy images
# Clone the repository
git clone https://github.com/unionai/workshops
cd workshops
# Navigate to any tutorial
cd tutorials/langgraph_agent_research
# Create virtual environment and install dependencies
uv venv .venv --python 3.11
source .venv/bin/activate
uv pip install -r requirements.txt
Flyte Cluster (for remote runs)
flyte create config \
--endpoint < your-endpoint> \
--auth-type headless \
--builder remote \
--domain development \
--project flytesnacks
Don't have a cluster? Request access at flyte.org .
Remote:
uv run flyte run workflow.py research_pipeline --query " Compare quantum computing approaches"
Local:
uv run flyte run --local workflow.py research_pipeline --query " Compare quantum computing approaches"
Local with TUI:
uv run flyte run --local --tui workflow.py research_pipeline --query " Compare quantum computing approaches"
Start TUI dashboard: