ai-co-scientist
Transform Claude Code into an AI Scientist that orchestrates research workflows using tree-based hypothesis exploration. Triggers…
Fine-tune LLMs using the Tinker API. Covers supervised fine-tuning, reinforcement learning, LoRA training, multimodal models including Thinking Machines' Inkling (vision, audio, thinking effort), and both high-level Cookbook patterns and low-level API usage.
$ npx -y skills add sundial-org/skills --skill tinker --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/tinkerContext preview
The summary Claude sees to decide when to auto-load this skill.
Fine-tune LLMs using the Tinker API. Covers supervised fine-tuning, reinforcement learning, LoRA training, multimodal models including Thinking Machines' Inkling (vision, audio, thinking effort), and both high-level Cookbook patterns and low-level API usage.
name: tinker description: Fine-tune LLMs using the Tinker API. Covers supervised fine-tuning, reinforcement learning, LoRA training, multimodal models including Thinking Machines' Inkling (vision, audio, thinking effort), and both high-level Cookbook patterns and low-level API usage.
Tinker is a training API for large language models from Thinking Machines Lab. It provides:
Two abstraction levels:
| Topic | Reference | |-------|-----------| | Setup & Core Concepts | [Getting Started](references/getting-started.md) | | API Classes & Types | [API Reference](references/api-reference.md) | | Supervised Learning | [Supervised Learning](references/supervised-learning.md) | | RL Training | [Reinforcement Learning](references/reinforcement-learning.md) | | Loss Functions | [Loss Functions](references/loss-functions.md) | | Chat Templates | [Rendering](references/rendering.md) | | Models & LoRA | [Models & LoRA](references/models-and-lora.md) | | Inkling (multimodal, thinking effort) | [Inkling](references/inkling.md) | | Example Scripts | [Recipes](references/recipes.md) |
pip install tinker tinker-cookbook export TINKER_API_KEY=your_api_key_here
import numpy as np
import tinker
from tinker import types
# Create clients
service_client = tinker.ServiceClient()
training_client = service_client.create_lora_training_client(
base_model="Qwen/Qwen3.6-35B-A3B", rank=32
)
tokenizer = training_client.get_tokenizer()
# Prepare data
prompt = "English: hello\nPig Latin:"
completion = " ello-hay\n"
prompt_tokens = tokenizer.encode(prompt, add_special_tokens=True)
completion_tokens = tokenizer.encode(completion, add_special_tokens=False)
tokens = prompt_tokens + completion_tokens
weights = np.array(([0] * len(prompt_tokens)) + ([1] * len(completion_tokens)), dtype=np.float32)
target_tokens = np.array(tokens[1:], dtype=np.int64)
datum = types.Datum(
model_input=types.ModelInput.from_ints(tokens=tokens[:-1]),
loss_fn_inputs={
"target_tokens": target_tokens,
"weights": weights[1:]
}
)
# Train
fwdbwd = training_client.forward_backward([datum], "cross_entropy")
optim = training_client.optim_step(types.AdamParams(learning_rate=1e-4))
fwdbwd.result(); optim.result()
# Sample
sampling_client = training_client.save_weights_and_get_sampling_client(name="v1")
result = sampling_client.sample(
prompt=types.ModelInput.from_ints(tokens=tokenizer.encode("English: world\nPig Latin:", add_special_tokens=True)),
sampling_params=types.SamplingParams(max_tokens=20),
num_samples=1
).result()
print(tokenizer.decode(result.sequences[0].tokens))# Low-level API
import tinker
from tinker import types
from tinker.types import Datum, ModelInput, TensorData, AdamParams, SamplingParams
# Cookbook (high-level)
import chz
import asyncio
from tinker_cookbook.supervised import train
from tinker_cookbook.supervised.types import ChatDatasetBuilder, ChatDatasetBuilderCommonConfig
from tinker_cookbook.supervised.data import (
SupervisedDatasetFromHFDataset,
StreamingSupervisedDatasetFromHFDataset,
FromConversationFileBuilder,
conversation_to_datum,
)
from tinker_cookbook.renderers import get_renderer, TrainOnWhat
from tinker_cookbook.model_info import get_recommended_renderer_name
from tinker_cookbook.tokenizer_utils import get_tokenizer| Scenario | Approach | |----------|----------| | Standard SFT with HF/JSONL data | Cookbook `ChatDatasetBuilder` + `tinker_cookbook.supervised.train.main()` | | Custom preprocessing | Custom `SupervisedDataset` class | | Large datasets (>1M) | `StreamingSupervisedDatasetFromHFDataset` | | RL / GRPO | Cookbook RL patterns | | Research / custom loops | Low-level `forward_backward()` + `optim_step()` | | Vision-language | Inkling or Qwen3.5/3.6 vision models | | Audio / thinking-effort control | Inkling + `tml-renderers` ([Inkling](references/inkling.md)) |
The skill skill can help you find, improve, and publish skills — install it with npx sundial-hub add skill. You'll be able to peruse this library of curated skills, plus 50,000+ more aggregated from the web.
Transform Claude Code into an AI Scientist that orchestrates research workflows using tree-based hypothesis exploration. Triggers…
Run OpenAI's Codex CLI agent in non-interactive mode using `codex exec`. Use when delegating coding tasks to Codex, running Codex…
Split large sets of uncommitted changes into logical, well-organized commits. Use when the user has many uncommitted changes and…
Conduct a literature review and develop a CS research proposal. Use when asked to review a research area, find gaps in existing…
Paper reviewer that evaluates machine learning research projects following official ICML reviewer guidelines. Provides…
Neuro-symbolic AI combining LLMs with symbolic solvers. Use when exploring neuro-symbolic approaches (ideation, no code) or…