cd /news/large-language-models/tinker-cookbook Β· home β€Ί topics β€Ί large-language-models β€Ί article
[ARTICLE Β· art-23075] src=github.com pub= topic=large-language-models verified=true sentiment=↑ positive

Tinker Cookbook

Thinking Machines Lab released two open-source libraries, `tinker` and `tinker-cookbook`, to help developers and researchers fine-tune large language models. The `tinker` SDK handles distributed training complexities via API requests, while `tinker-cookbook` provides realistic fine-tuning examples, tutorials, and abstractions for supervised learning, reinforcement learning, and advanced techniques like DPO and RLHF.

read4 min publishedJun 6, 2026

We provide two libraries for the broader community to customize their language models: tinker

and tinker-cookbook

.

tinker

is a training SDK for researchers and developers to fine-tune language models. You send API requests to us and we handle the complexities of distributed training.tinker-cookbook

includes realistic examples of fine-tuning language models. It builds on the Tinker API and provides common abstractions to fine-tune language models.

  • Sign up for Tinker here. - Once you have access, create an API key from the consoleand export it as environment variableTINKER_API_KEY

. - Install tinker-cookbook

(includes thetinker

SDK as a dependency):

uv pip install tinker-cookbook

uv pip install 'tinker-cookbook @ git+https://github.com/thinking-machines-lab/tinker-cookbook.git@nightly'

Here we introduce a few Tinker primitives β€” the basic components to fine-tune LLMs (see the quickstart guide for more details):

import tinker
service_client = tinker.ServiceClient()
training_client = service_client.create_lora_training_client(
  base_model="meta-llama/Llama-3.2-1B", rank=32,
)
training_client.forward_backward(...)
training_client.optim_step(...)
training_client.save_state(...)
training_client.load_state(...)

sampling_client = training_client.save_weights_and_get_sampling_client()
sampling_client.sample(...)

See tinker_cookbook/recipes/sl_loop.py and tinker_cookbook/recipes/rl_loop.py for minimal examples of using these primitives to fine-tune LLMs.

New to Tinker? The tutorials/ directory contains 20+ progressive

marimonotebooks that walk through core concepts β€” rendering, loss functions, completers, weight management β€” and advanced topics such as custom RL environments, DPO, RLHF, and weight export. Run any tutorial with

marimo edit tutorials/101_hello_tinker.py

. See the tutorials READMEfor the full list, or browse rendered versions on the

Tinker docs site.

To download the weights of any model:

rest_client = service_client.create_rest_client()
future = rest_client.get_checkpoint_archive_url_from_tinker_path(sampling_client.model_path)
with open(f"model-checkpoint.tar.gz", "wb") as f:
    f.write(future.result())

Besides these primitives, we also offer Tinker Cookbook (a.k.a. this repo), a library of a wide range of abstractions to help you customize training environments. tinker_cookbook/recipes/sl_basic.py and

contain minimal examples to configure supervised learning and reinforcement learning.

tinker_cookbook/recipes/rl_basic.py

We also include more complete examples in the tinker_cookbook/recipes/ folder:

: supervised fine-tuning on conversational datasets (e.g., Tulu3).Chat SFT: reinforcement learning for mathematical reasoning with verifiable rewards.Math RL: RL on competitive programming with sandboxed code execution (DeepCoder replication).Code RL: DPO and a three-stage RLHF pipeline (SFT, reward model, RL).Preference learning: on-policy and off-policy knowledge distillation with single- and multi-teacher configurations.Distillation: RL for retrieval-augmented generation (Search-R1 replication).Tool use: multi-agent RL with self-play and cross-play.Multi-agent

The recipes README covers all available recipes, including Harbor RL, rubric-based grading, VLM classification, and SDFT. Each recipe includes a README.md

with implementation details, launch commands, and expected results.

Tinker Cookbook includes a benchmark framework for evaluating trained models:

from tinker_cookbook.eval.benchmarks import run_benchmarks, BenchmarkConfig

results = await run_benchmarks(
    ["gsm8k", "mmlu_pro", "ifeval"],
    sampling_client, renderer,
    BenchmarkConfig(save_dir="evals/step500"),
)

The framework currently supports 12 benchmarks (GSM8K, MATH-500, MMLU-Pro, MMLU-Redux, GPQA, IFEval, MBPP, C-Eval, SuperGPQA, IFBench, AIME 2025, AIME 2026) with verified scores against published results, plus experimental benchmarks such as LiveCodeBench, Terminal Bench, and SWE-bench. Benchmarks can also serve as inline training evaluators via BenchmarkEvaluator

.

Note: Benchmark scores are sensitive to evaluation configuration β€” system prompts, max_tokens

, temperature, and timeout settings can shift results significantly. We document our exact settings alongside all reported scores. This framework is under active development; feedback and contributions are welcome. See the eval README for verified scores, configuration details, and instructions for adding new benchmarks.

For the full Tinker documentation, visit tinker-docs.thinkingmachines.ai.

Tinker Cookbook also provides reusable building blocks:

β€” bidirectional conversion between token sequences and structured chat messagesrenderers

β€” learning rate and hyperparameter scaling for LoRA traininghyperparam_utils

β€” benchmark framework and inline training evaluators (seeeval

Evaluationabove)

Tinker Cookbook ships with Claude Code skills that teach Claude how to use the Tinker API. Install them so Claude can help you write training code in any project:

/plugin marketplace add thinking-machines-lab/tinker-cookbook

Then install the tinker plugin from the Discover tab (/plugin

β†’ Discover). Once installed, two skills are available:

Command What it does
/tinker:research
Plan and run post-training experiments β€” SFT, RL, DPO, distillation, evaluation, hyperparameters, model selection, and more
/tinker:debug
Diagnose slow training, hangs, output mismatches, renderer issues, and errors

Skills also trigger automatically based on context β€” ask Claude to "set up SFT training" and it will load the right skill without a slash command. Skills update automatically when the repo is updated.

uv sync --extra dev
pre-commit install

This installs dev dependencies and registers pre-commit hooks that run ruff

formatting and linting on every commit. CI enforces these checks on all pull requests.

This project is built in the spirit of open science and collaborative development. We believe that the best tools emerge through community involvement and shared learning.

We welcome PR contributions after our private beta is over. If you have any feedback, please email us at tinker@thinkingmachines.ai.

If you use Tinker for your research, please cite it as:

Thinking Machines Lab, 2026. Tinker. https://thinkingmachines.ai/tinker/.

Or use this BibTeX citation:

@misc{tml2026tinker,
  author = {Thinking Machines Lab},
  title = {Tinker},
  year = {2026},
  url = {https://thinkingmachines.ai/tinker/},
}
── more in #large-language-models 4 stories Β· sorted by recency
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/tinker-cookbook] indexed:0 read:4min 2026-06-06 Β· β€”