Tutorials & Cookbooks
This section collects walkthroughs and recipes. It will expand as new examples and cookbooks are added.
Examples
These examples provide hands-on introductions to core plait concepts:
| Example | Description |
|---|---|
| 01_module.py | Module basics: creating custom modules, composing hierarchies, using Parameters |
| 02_llm_pipeline.py | LLM pipelines: sequential, parallel fan-out, fan-in synthesis patterns |
| 03_tracing.py | Tracing: capturing execution DAGs, inspecting nodes and dependencies |
| 04_execution.py | Execution: run(), bind(), ExecutionSettings, batch processing |
| 05_optimization.py | Optimization: train/eval modes, loss functions, backward passes |
Cookbooks
Cookbooks demonstrate complete end-to-end workflows:
| Cookbook | Description |
|---|---|
| hallucination_detection.py | Training a hallucination detector with HaluBench dataset |
Suggested Learning Path
- Start with 01_module.py to understand the basic building blocks
- Learn LLM pipeline patterns in 02_llm_pipeline.py
- Understand how plait captures computation graphs with 03_tracing.py
- See how to execute pipelines in 04_execution.py
- Learn optimization techniques in 05_optimization.py
- Apply your knowledge with the hallucination detection cookbook