tinker-cookbook banner
thinking-machines-lab thinking-machines-lab

tinker-cookbook

Development community intermediate

Description

1. Sign up for Tinker [here](https://auth.thinkingmachines.ai/sign-up). 2. Once you have access, create an API key from the [console](https://tinker-console.thinkingmachines.ai) and export it as environment variable `TINKER_API_KEY`.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Tinker Cookbook

[](https://github.com/thinking-machines-lab/tinker-cookbook/actions/workflows/pytest.yaml) [](https://github.com/thinking-machines-lab/tinker-cookbook/actions/workflows/pyright.yaml) [](https://github.com/thinking-machines-lab/tinker-cookbook/actions/workflows/smoke-test-recipes.yaml) [](https://pypi.org/project/tinker-cookbook/)

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.

Installation

  1. Sign up for Tinker here.
  2. Once you have access, create an API key from the console and export it as environment variable TINKER_API_KEY.
  3. Install tinker-cookbook (includes the tinker SDK as a dependency):
    # Latest stable release from PyPI
    uv pip install tinker-cookbook
    
    # Or install the nightly build
    uv pip install 'tinker-cookbook @ git+https://github.com/thinking-machines-lab/tinker-cookbook.git@nightly'

Tinker

Here we introduce a few Tinker primitives — the basic components to fine-tune LLMs (see the [quickstart guide](https://tinker-docs.thinkingmachines.ai/tinker/quickstart/) 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()

...