How thinking-machines-lab/tinker-cookbook works
Tinker Cookbook is a Python library of reusable post-training algorithms and runnable language-model training recipes built on the Tinker API. The typical workflow configures a recipe and dataset or environment, renders model inputs, generates supervised examples or RL rollouts, trains a policy, then evaluates or checkpoints the result. The repository also documents distinct preference-learning, distillation, multimodal, tool-use and multi-agent recipes, plus weight export and capture capabilities. The graph reflects README-described subsystems; sampled source is limited, so uncertain internal wiring is omitted.
Main entry points: rl/train.py RL training · supervised/train.py Supervised training · capture Sampling capture · data.py Dataset builders
Components 22
Training recipes
- Task recipes
tinker_cookbook/recipes - Chat SFT
tinker_cookbook/recipes/chat_sl - RL recipes
tinker_cookbook/recipes/math_rl - Code RL
tinker_cookbook/recipes/code_rl - Preference learning
tinker_cookbook/recipes/preference - RLHF pipeline
tinker_cookbook/recipes/preference/rlhf/rlhf_pipeline.py - Distillation recipes
tinker_cookbook/recipes/distillation - Audio and vision
tinker_cookbook/recipes/audio - Tool and multi-agent
tinker_cookbook/recipes/search_tool
Training abstractions
- Dataset builders
tinker_cookbook/supervised/data.py - Supervised training
tinker_cookbook/supervised/train.py - RL training
tinker_cookbook/rl/train.py - RL environments
tinker_cookbook/rl/problem_env.py
Model interfaces
- Message renderers
tinker_cookbook/renderers/base.py - Tinker API
Evaluation and artifacts
- Benchmark evaluation
tinker_cookbook/eval - Training and eval stores
tinker_cookbook/stores - Weight export
tinker_cookbook/weights
Capture and observability
- Sampling capture
tinker_cookbook/capture - Capture store
tinker_cookbook/capture/store
Other components
- Cookbook user
- External agent clients
Connections 28
- Cookbook user → Task recipes: configures
- Task recipes → Dataset builders: builds data
- Chat SFT → Dataset builders: builds data
- Chat SFT → Supervised training: starts training
- RL recipes → RL training: starts training
- Code RL → RL training: starts training
- Preference learning → Supervised training: uses SFT
- Preference learning → RL training: uses RL
- RLHF pipeline → Supervised training: runs stages
- RLHF pipeline → RL training: runs RL stage
- Distillation recipes → Supervised training: trains student
- Distillation recipes → Tinker API: scores teacher
- Audio and vision → Supervised training: trains models
- Audio and vision → RL training: trains policies
- Tool and multi-agent → RL training: trains policies
- Tool and multi-agent → RL environments: defines environments
- Dataset builders → Message renderers: formats messages
- Supervised training → Tinker API: trains through
- RL training → RL environments: runs rollouts
- RL training → Tinker API: samples and trains
- RL training → Training and eval stores: logs results
- Supervised training → Training and eval stores: logs results
- Benchmark evaluation → Tinker API: evaluates samples
- Benchmark evaluation → Training and eval stores: persists results
- Tinker API → Weight export: exports weights
- External agent clients → Sampling capture: sends requests
- Sampling capture → Tinker API: samples through
- Sampling capture → Capture store: exports records