Tinker Training Inference logo

Tinker Training Inference

OrganizationPopular
Leanmcp
tinker-training-inference

Train and run models on Tinker (Thinking Machines) — LoRA and full fine-tuning, SFT with correct loss masking, RL/RFT with group-relative advantages and importance sampling, agentic RL over multi-turn tool-using agents, inference via the SamplingClient or the OpenAI-compatible endpoint, checkpoint management and export, every hyperparameter, and cost estimation from the live price table. Use this skill whenever the user mentions Tinker, tinker://, TINKER_API_KEY, console.tinker.ai, or the tinker CLI; wants to fine-tune, SFT, RFT, or RL a model on Tinker; asks about Tinker models, context windows, LoRA rank, sampling params, loss functions (cross_entropy, importance_sampling, ppo, cispo, dro), Datum construction, forward_backward or optim_step; wants to sample from, download, resume, merge, or export a Tinker checkpoint; or asks what a Tinker run will cost. Whenever Tinker work is initialized in a project, this skill also creates a TINKER_PRICING.md there so prices sit next to the training code. Reach for it even on vague asks like "train a model on this data" or "get inference working" when Tinker is the platform in play.

Overview

PublisherLeanmcp
Repositorygateway-skills
Skill nametinker-training-inference
Stars
2.1K
Forks
2.1K
Bundled files
16
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 16 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by Leanmcp on GitHub. Read the source before you install it.

Installation

Install the Tinker Training Inference AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/Leanmcp/gateway-skills/tree/main/skills/tinker-training-inference
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Leanmcp/gateway-skills.git /tmp/gateway-skills
mkdir -p .claude/skills
cp -r /tmp/gateway-skills/skills/tinker-training-inference .claude/skills/tinker-training-inference
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Tinker Training Inference in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Tinker Training Inference on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Tinker Training Inference is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Tinker: training and inference

Tinker gives you token-level control of hosted fine-tuning: you build the Datums, you own the chat template, you hold the exact prompt and completion token ids on both sides. That is the reason to use it — a training run stays auditable, because the tokens the policy was updated on are tokens you can point at — and it is also why there is more to get right than with a hosted fine-tuning button. This skill is the map.

Do this first, in any new Tinker project

Create the pricing file. Prices next to the training script get read before a 550B RL run is launched; prices in a browser tab do not.

bash
python <skill>/scripts/tinker_pricing.py init --out <project dir>

That writes TINKER_PRICING.md — the full catalogue, what each operation meters, and the pre-launch checklist. It is a snapshot: verify against the live catalogue at https://tinker-docs.thinkingmachines.ai/tinker/models/, and regenerate with --force when it moves. Then:

bash
export TINKER_API_KEY="..."          # console.tinker.ai
uv pip install tinker

Where to go

you want toread
get set up, pick a model, avoid the context-window trapreferences/setup.md
supervised fine-tuningreferences/training-sft.md
RL / RFT on single-turn tasksreferences/training-rl.md
RL over a multi-turn tool-using agentreferences/agentic-rl.md
sample from a checkpoint (SDK or OpenAI-compatible HTTP)references/inference.md
save, resume, download, merge, export checkpointsreferences/checkpoints.md
every knob and what it costs to get wrongreferences/hyperparameters.md
render prompts, tool schemas, parse completionsreferences/chat-templates.md
the price table and run-cost estimationreferences/pricing.md
an error, or a run that is silently wrongreferences/troubleshooting.md
working code at full scalereferences/reference-implementation.md

Runnable templates

Copy into the project and replace the marked function:

scriptreplace
scripts/tinker_sft.pyload_dataset() — everything else (Datum construction, loss masking, before/after eval, checkpointing) is the part that is easy to get subtly wrong
scripts/tinker_rl.pyTASKS, render_prompt(), reward()
scripts/tinker_infer.pynothing — CLI, both the SDK and HTTP routes
scripts/tinker_pricing.pynothing — catalogue, init, and the cost estimator

The API in one screen

python
import tinker
from tinker import types

service_client  = tinker.ServiceClient()                      # reads TINKER_API_KEY
training_client = service_client.create_lora_training_client(
    base_model="Qwen/Qwen3-8B", rank=32)
tokenizer = training_client.get_tokenizer()

# SFT ---------------------------------------------------------------------
result = training_client.forward_backward(batch, loss_fn="cross_entropy").result()
training_client.optim_step(types.AdamParams(learning_rate=1e-4)).result()

# RL ----------------------------------------------------------------------
sampler = training_client.save_weights_and_get_sampling_client(name=f"iter-{it}")
resp = sampler.sample(prompt=types.ModelInput.from_ints(prompt_tokens),
                      num_samples=8,
                      sampling_params=types.SamplingParams(
                          max_tokens=4096, temperature=1.0,
                          stop=STOP_STRINGS, seed=seed)).result()
training_client.forward_backward(rl_data, loss_fn="importance_sampling").result()
training_client.optim_step(types.AdamParams(learning_rate=1e-4)).result()

# checkpoints -------------------------------------------------------------
training_client.save_state(name="iter-40")               # -> weights/…  resumable
training_client.save_weights_for_sampler(name="final")   # -> sampler_weights/…  servable

Every call returns a future; .result() blocks, and an _async variant exists for each. Loss functions: cross_entropy (SFT), importance_sampling (RL default), ppo, cispo, dro, or your own via forward_backward_custom_async.

Things that are true and easy to miss

Two checkpoint types, not interchangeable. save_weights_for_sampler → sampler_weights/… is servable and downloadable. save_state → weights/… carries optimizer state and is for resuming. The download endpoint rejects the latter with a 400. Save both.

The context window is part of the model id. openai/gpt-oss-120b is 32K; openai/gpt-oss-120b:peft:131072 is a different model at 128K and ~2.4× the prefill price. Assert your configured window against get_server_capabilities() at startup — configured above the served limit means episodes die on BadRequestError mid-run, and they die in whichever arm has longer conversations, which silently unbalances an A/B.

Prompt format is a contract that outlives the run. A checkpoint SFT'd on raw text must be prompted as raw text forever after; wrapping it in a chat template it never saw looks exactly like a fine-tune that did nothing. Record the format next to the checkpoint path.

In RL, everything except the policy must be constant inside a group. The advantage is a within-group difference, so a simulated user sampling at temperature injects noise straight into the gradient and attributes it to the policy. Measured in the reference project: at user temperature 0.5, two runs of the same configuration differed by as much as the effect under study.

Evaluate the base model before training it. If it sits at a floor on your task, every rollout in every group ties, every advantage is zero, and no gradient ever flows — and no ablation you run against it can resolve anything.

Reasoning tokens count against max_tokens. A model that spends its budget inside <think> emits neither a reply nor a tool call, which is not a valid message. Budget 4096, not 1024, and add a truncation retry.

Do the multiplication before launching. RL cost is iterations × tasks_per_iter × group_size × turns. Every one of those is a flag someone bumps on its own:

bash
python scripts/tinker_pricing.py estimate-rl --model openai/gpt-oss-120b \
    --iterations 10 --tasks-per-iter 8 --group-size 8 \
    --turns 20 --avg-prompt 8000 --avg-completion 400

Recording the run

Tinker keeps almost nothing locally — a hosted run UUID and that is it. Anything you want to inspect later has to be written by you.

Use the companion research-observability skill. It was built against this stack: run.sample() takes Tinker's prompt and completion token ids directly, so the trace records exactly the tokens the policy was updated on, and its viewers and cost report work on the result unchanged. That skill records the loop; this one runs it.

Links

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Tinker Training Inference AI skill do?

Train and run models on Tinker (Thinking Machines) — LoRA and full fine-tuning, SFT with correct loss masking, RL/RFT with group-relative advantages and importance sampling, agentic RL over multi-turn tool-using agents, inference via the SamplingClient or the OpenAI-compatible endpoint, checkpoint management and export, every hyperparameter, and cost estimation from the live price table. Use this skill whenever the user mentions Tinker, tinker://, TINKER_API_KEY, console.tinker.ai, or the tinker CLI; wants to fine-tune, SFT, RFT, or RL a model on Tinker; asks about Tinker models, context wi...

Why use Tinker Training Inference on TypingMind?

Because you install it once and use it with any model. Tinker Training Inference is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Tinker Training Inference in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Leanmcp/gateway-skills/tree/main/skills/tinker-training-inference. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Tinker Training Inference?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Tinker Training Inference?

As many as you like. As long as a model supports skills, you can use Tinker Training Inference with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Tinker Training Inference AI skill free?

Yes. It is published on GitHub by Leanmcp under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇