thinking-machines-lab/tinker-cookbook

Post-training with Tinker

What it solves

Fine-tuning large language models is technically demanding — it involves distributed training, token rendering, loss functions, and weight management. Tinker Cookbook gives researchers and developers realistic, ready-to-run examples and reusable abstractions for customizing language models, while offloading the hard infrastructure work to the Tinker API (you send API requests; Tinker handles the complexities of distributed training).

How it works

Tinker Cookbook is built on two libraries: tinker, the training SDK that manages distributed training for you, and tinker-cookbook (this repo), which provides realistic fine-tuning examples and common abstractions on top of that SDK. Core primitives include a ServiceClient that creates LoRA training clients, which you drive with forward_backward, optim_step, and save_state calls, and sampling clients for generating outputs from trained weights.

The repo is organized around concrete, complete recipes in the recipes/ folder — supervised fine-tuning on chat data, reinforcement learning for math and code, DPO and a three-stage RLHF pipeline, knowledge distillation, tool-use RL (a Search-R1 replication), multi-agent RL with self-play, audio SFT/RL, and VLM image classification. Each recipe has its own README with implementation details, launch commands, and expected results. A tutorials/ directory adds 20+ progressive marimo notebooks covering core concepts (rendering, loss functions, completers, weight management) and advanced topics (custom RL environments, DPO, RLHF, weight export).

It also ships an experimental evaluation framework supporting 12 benchmarks (GSM8K, MATH-500, MMLU-Pro, GPQA, IFEval, MBPP, and more) with scores verified against published results, plus experimental benchmarks like LiveCodeBench and SWE-bench. Utilities include renderers (bidirectional conversion between token sequences and structured chat messages) and hyperparameter helpers with calibrated per-model LoRA learning rates. Finally, the repo includes Claude Code skills that teach Claude how to use the Tinker API, with commands for planning experiments, debugging, building rollout viewers, and working with Inkling models.

The cookbook supports Thinking Machines Lab's Inkling model family — general-purpose, natively multimodal models that can code, reason, and call tools, with controllable reasoning effort and image/audio inputs.

Who it's for

Researchers and developers who want to fine-tune language models without building training infrastructure themselves — from newcomers following the progressive tutorials to advanced users running RL, DPO, distillation, multi-agent, or multimodal experiments. It's also for people using Claude Code who want AI assistance writing training code in any project.

Highlights

  • Realistic, complete fine-tuning recipes: chat SFT, math RL, code RL, DPO/RLHF, distillation, tool use, multi-agent, audio, and VLM classification
  • Built on the Tinker API, so distributed training complexity is handled for you
  • 20+ progressive marimo notebooks covering core and advanced concepts
  • Benchmark evaluation framework with 12 verified benchmarks plus experimental ones
  • Claude Code skills that auto-trigger from context (e.g., "set up SFT training")
  • Support for Inkling models with controllable reasoning effort and multimodal image/audio inputs
  • Reusable utilities: renderers and calibrated per-model LoRA hyperparameters

Related

  • Dispatch
  • Project
  • Dispatch
  • Project
  • Dispatch