tinker_cookbook
Implementations of post-training algorithms using the Tinker API
What it is and what it does
Tinker Cookbook is a library of recipes and utilities built on top of the Tinker API—a managed fine-tuning service for language models. It abstracts away distributed training complexity by letting you send API requests to Thinking Machines Lab's infrastructure rather than managing training yourself. The package includes realistic, runnable examples for common post-training workflows: supervised fine-tuning on conversational data, reinforcement learning for math and code, preference learning (DPO and RLHF), knowledge distillation, tool-use training, multi-agent RL, audio and vision-language model training, and more.
You install it alongside its 19 runtime dependencies (torch, transformers, datasets, huggingface-hub, and others) and then import recipes or utilities to configure and launch training jobs. The package also ships an experimental benchmark framework to evaluate trained models against 12 standard benchmarks, plus utilities for hyperparameter scaling, token-to-chat-message rendering, and weight management. All of this assumes you have a Tinker API account and an API key.
Use it for:
- Fine-tune an open-source LLM like Llama on your own conversational dataset using supervised learning without managing distributed training infrastructure.
- Train a model to solve math problems with verifiable rewards using the math RL recipe with automated grading.
- Build a code-generation model using competitive programming examples and sandboxed execution (DeepCoder-style) via the code RL recipe.
- Implement a three-stage RLHF pipeline (SFT, reward model, RL) for preference-aligned models using the preference learning recipe.
- Evaluate a fine-tuned model against standardized benchmarks (GSM8K, MMLU-Pro, IFEval, etc.) using the built-in evaluation framework.
- Train a vision-language model for image classification or an audio model for speech recognition using the multimodal recipes.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Tinker Cookbook provides recipes and abstractions for fine-tuning language models via the Tinker API, supporting supervised learning, reinforcement learning, and specialized tasks like math reasoning, code generation, and multimodal training.
Yes, if you have a Tinker API account and want to fine-tune LLMs without managing distributed training infrastructure. The package is actively maintained, well-documented, and provides production-ready recipes for common post-training tasks. Install friction is low and the Apache-2.0 license is permissive. No security vulnerabilities are known. The main blocker is the hard dependency on a Tinker API account and the substantial runtime footprint (torch, transformers, datasets, etc.)—not a concern if you're already working in the LLM space.
Install
tinker-cookbook on PyPI
pip
pip install tinker-cookbookuv
uv add tinker-cookbookpoetry
poetry add tinker-cookbookInstalling tinker_cookbook
Before you install
Low friction installation as a pure-Python wheel. Active maintenance with a recent release (3 days old) and strong repository signals (4019 stars, last commit 2026-08-14). Requires Python >=3.11 and pulls in 19 runtime dependencies including torch, transformers, and datasets—a substantial but expected footprint for LLM tooling.
License in practice
Licensed under Apache-2.0 (permissive), allowing commercial use, modification, and distribution with minimal restrictions. No notable licensing friction for most use cases.
Quickstart
# Install
pip install tinker-cookbook
# Set up API key
export TINKER_API_KEY="your_key_here"
# Basic supervised learning example
import tinker
from tinker_cookbook.recipes.sl_basic import create_sl_trainer
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(...)
Requires a Tinker API account and TINKER_API_KEY environment variable; torch>=2.10 is required for Inkling model support.
Verify before relying
- Whether the 12 benchmarks (GSM8K, MATH-500, MMLU-Pro, etc.) are production-ready or experimental beyond the noted 'experimental' label on the eval framework.
- Specific performance or cost implications of using Inkling vs. Inkling-Small models through the Tinker API.
- Whether all 20+ marimo tutorials are currently functional and up-to-date with the latest API.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 19 — aiohttp, anyio, blobfile, chz, cloudpickle, datasets, huggingface-hub, numpy, pillow, pydantic, rich, safetensors, termcolor, tiktoken, tinker, tml-renderers, torch, tqdm, transformers |
| Maintenance | actively maintained — 3 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 599,605/month — #5,827 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: tinker_cookbook-0.5.4-py3-none-any.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
tinkerTinker is the official Python SDK for the…
permissive · top 5,000 on PyPI
trlTRL provides trainer classes for post-training…
permissive · top 5,000 on PyPI
torchtunetorchtune is a PyTorch library for fine-tuning,…
permissive · top 15,000 on PyPI
gem-llmGEM is a reinforcement learning environment…
permissive · top 15,000 on PyPI
google-tunixTunix is a JAX-based library for post-training…
permissive · top 15,000 on PyPI
verlverl is a reinforcement learning training…
permissive · top 15,000 on PyPI
ms-swiftms-swift is a framework for training,…
permissive · top 15,000 on PyPI
skrlskrl is a modular reinforcement learning…
permissive · top 15,000 on PyPI
torchrlTorchRL is a PyTorch-native toolkit for…
unclear · top 5,000 on PyPI
reasoning-gymReasoning Gym generates procedurally verifiable…
permissive · top 15,000 on PyPI