tinker-training-cost

Calculate training costs for Tinker fine-tuning jobs. Use when estimating costs for Tinker LLM training, counting tokens in datasets, or comparing Tinker model training prices. Tokenizes datasets using the correct model tokenizer and provides accurate cost estimates.

148 stars

Best use case

tinker-training-cost is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Calculate training costs for Tinker fine-tuning jobs. Use when estimating costs for Tinker LLM training, counting tokens in datasets, or comparing Tinker model training prices. Tokenizes datasets using the correct model tokenizer and provides accurate cost estimates.

Teams using tinker-training-cost should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/tinker-training-cost/SKILL.md --create-dirs "https://raw.githubusercontent.com/sundial-org/skills/main/skills/tinker-training-cost/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/tinker-training-cost/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How tinker-training-cost Compares

Feature / Agenttinker-training-costStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Calculate training costs for Tinker fine-tuning jobs. Use when estimating costs for Tinker LLM training, counting tokens in datasets, or comparing Tinker model training prices. Tokenizes datasets using the correct model tokenizer and provides accurate cost estimates.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Tinker Training Cost Calculator

Calculate training costs for Tinker fine-tuning jobs by tokenizing your dataset with the correct model tokenizer and applying current pricing.

## Quick Start

Use the bundled script to calculate training costs:

```bash
# List available models and pricing
python scripts/calculate_cost.py --list-models

# Calculate cost for a JSONL dataset
python scripts/calculate_cost.py training_data.jsonl --model Qwen3-8B --epochs 3

# Output as JSON
python scripts/calculate_cost.py training_data.jsonl --model Llama-3.1-70B --json
```

The script:
1. Loads the correct tokenizer for the selected model
2. Counts tokens in your JSONL file (supports chat, text, and instruction formats)
3. Calculates the estimated training cost

## Cost Formula

```
Training Cost = (total_tokens × epochs × train_price_per_million) / 1_000_000
```

Where:
- `total_tokens` = tokens in your training dataset (from tokenization)
- `epochs` = number of training passes (default: 3)
- `train_price_per_million` = model-specific training rate from pricing table

---

## Tinker Pricing

> **All prices as of January 5, 2026**
> Source: https://thinkingmachines.ai/tinker/

All prices are in **USD per million tokens**.

| Category | Description |
|----------|-------------|
| **Prefill** | Processing input context (inference) |
| **Sample** | Generating output tokens (inference) |
| **Train** | Training/fine-tuning tokens |

### Qwen Models

| Model | Prefill | Sample | Train |
|-------|---------|--------|-------|
| Qwen3-4B-Instruct-2507 | $0.07 | $0.22 | $0.22 |
| Qwen3-8B | $0.13 | $0.40 | $0.40 |
| Qwen3-30B-A3B | $0.12 | $0.30 | $0.36 |
| Qwen3-VL-30B-A3B-Instruct | $0.18 | $0.44 | $0.53 |
| Qwen3-32B | $0.49 | $1.47 | $1.47 |
| Qwen3-235B-Instruct-2507 | $0.68 | $1.70 | $2.04 |
| Qwen3-VL-235B-A22B-Instruct | $1.02 | $2.56 | $3.07 |

### Llama Models

| Model | Prefill | Sample | Train |
|-------|---------|--------|-------|
| Llama-3.2-1B | $0.03 | $0.09 | $0.09 |
| Llama-3.2-3B | $0.06 | $0.18 | $0.18 |
| Llama-3.1-8B | $0.13 | $0.40 | $0.40 |
| Llama-3.1-70B | $1.05 | $3.16 | $3.16 |

### DeepSeek Models

| Model | Prefill | Sample | Train |
|-------|---------|--------|-------|
| DeepSeek-V3.1 | $1.13 | $2.81 | $3.38 |

### GPT-OSS Models

| Model | Prefill | Sample | Train |
|-------|---------|--------|-------|
| GPT-OSS-120B | $0.18 | $0.44 | $0.52 |
| GPT-OSS-20B | $0.12 | $0.30 | $0.36 |

### Moonshot Models

| Model | Prefill | Sample | Train |
|-------|---------|--------|-------|
| Kimi-K2-Thinking | $0.98 | $2.44 | $2.93 |

---

## Model-to-Tokenizer Mapping

Use the correct HuggingFace tokenizer for accurate token counting:

| Model | HuggingFace Tokenizer |
|-------|----------------------|
| Qwen3-4B-Instruct-2507 | `Qwen/Qwen3-4B` |
| Qwen3-8B | `Qwen/Qwen3-8B` |
| Qwen3-30B-A3B | `Qwen/Qwen3-30B-A3B` |
| Qwen3-32B | `Qwen/Qwen3-32B` |
| Qwen3-235B-Instruct-2507 | `Qwen/Qwen3-235B-A22B-Instruct` |
| Qwen3-VL-* | `Qwen/Qwen2.5-VL-7B-Instruct` (shared VL tokenizer) |
| Llama-3.2-1B | `meta-llama/Llama-3.2-1B-Instruct` |
| Llama-3.2-3B | `meta-llama/Llama-3.2-3B-Instruct` |
| Llama-3.1-8B | `meta-llama/Llama-3.1-8B-Instruct` |
| Llama-3.1-70B | `meta-llama/Llama-3.1-70B-Instruct` |
| DeepSeek-V3.1 | `deepseek-ai/DeepSeek-V3` |
| GPT-OSS-* | `Qwen/Qwen3-8B` (compatible tokenizer) |
| Kimi-K2-Thinking | `moonshotai/Kimi-K2-Instruct` |

---

## Tokenization

The bundled `scripts/calculate_cost.py` handles tokenization automatically. For custom use:

```python
from transformers import AutoTokenizer

# Load the correct tokenizer for your model
tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen3-8B", trust_remote_code=True)

# Count tokens
token_count = len(tokenizer.encode("Your training text here"))
```

### Supported JSONL Formats

The script handles these training data formats:

**Chat format** (recommended):
```json
{"messages": [{"role": "user", "content": "..."}, {"role": "assistant", "content": "..."}]}
```

**Text format**:
```json
{"text": "Your training text here"}
```

**Instruction format** (Alpaca-style):
```json
{"instruction": "...", "input": "...", "output": "..."}
```

---

## Quick Cost Examples

### Example 1: Qwen3-8B on 1M tokens, 3 epochs
```
Dataset tokens: 1,000,000
Training tokens: 1,000,000 × 3 = 3,000,000
Cost: 3.0M × $0.40/M = $1.20
```

### Example 2: Llama-3.1-70B on 5M tokens, 2 epochs
```
Dataset tokens: 5,000,000
Training tokens: 5,000,000 × 2 = 10,000,000
Cost: 10.0M × $3.16/M = $31.60
```

### Example 3: Qwen3-235B on 2M tokens, 4 epochs
```
Dataset tokens: 2,000,000
Training tokens: 2,000,000 × 4 = 8,000,000
Cost: 8.0M × $2.04/M = $16.32
```

---

## Important Notes

1. **LoRA Fine-Tuning**: Tinker uses Low-Rank Adaptation (LoRA), not full fine-tuning
2. **Token Counting**: Always use the model's native tokenizer for accurate counts - different tokenizers produce different token counts for the same text
3. **Vision Models**: VL models have higher costs due to image processing overhead
4. **trust_remote_code**: Required for some tokenizers (Qwen, DeepSeek)

Related Skills

training-data-curation

148
from sundial-org/skills

Guidelines for creating high-quality datasets for LLM post-training (SFT/DPO/RLHF). Use when preparing data for fine-tuning, evaluating data quality, or designing data collection strategies.

tinker

148
from sundial-org/skills

Fine-tune LLMs using the Tinker API. Covers supervised fine-tuning, reinforcement learning, LoRA training, vision-language models, and both high-level Cookbook patterns and low-level API usage.

cs448b-visualization

148
from sundial-org/skills

Data visualization design based on Stanford CS448B. Use for: (1) choosing chart types, (2) selecting visual encodings, (3) critiquing visualizations, (4) building D3.js visualizations, (5) designing interactions/animations, (6) choosing colors, (7) visualizing networks, (8) visualizing text. Covers Bertin, Mackinlay, Cleveland & McGill.

skill

148
from sundial-org/skills

Find, install, create, improve, and publish AI agent skills through the Sundial ecosystem. Use when the user wants to find or search for skills, install a skill, create a new skill, improve or evaluate an existing skill, or publish a skill to Sundial Hub. Trigger phrases include "find a skill", "install skill", "create a skill", "make a skill", "improve this skill", "evaluate skill", "publish skill", "push skill", "search for skills".

skill-to-card

148
from sundial-org/skills

End-to-end workflow that creates a skill from a description and attached files, publishes it to Sundial as a private skill, generates a trading card (front + back with QR code), and sends it to a printer. Use when the user wants to create a skill and get a printed trading card, or says "skill to card", "create and print a skill card", "make me a skill with a card".

project-referee

148
from sundial-org/skills

Critiques ML conference papers with reviewer-style feedback. Use when users want to anticipate reviewer concerns, identify weaknesses, check claim-evidence gaps, or find missing citations.

neuro-symbolic-reasoning

148
from sundial-org/skills

Neuro-symbolic AI combining LLMs with symbolic solvers. Use when exploring neuro-symbolic approaches (ideation, no code) or implementing solver integrations (code).

icml-reviewer

148
from sundial-org/skills

Paper reviewer that evaluates machine learning research projects following official ICML reviewer guidelines. Provides comprehensive reviews with actionable feedback across all key dimensions: claims/evidence, relation to prior work, originality, significance, clarity, and reproducibility. Also provides formative feedback on incomplete drafts, proposals, and research code repositories. MANDATORY TRIGGERS: review paper, ICML review, paper review, evaluate paper, research paper feedback, ML paper review, conference review, academic review, paper critique, NeurIPS review, ICLR review, project proposal, research proposal, paper draft, early feedback, incomplete paper, work in progress, WIP review, review repo, review codebase, research project review

cs-research-methodology

148
from sundial-org/skills

Conduct a literature review and develop a CS research proposal. Use when asked to review a research area, find gaps in existing work, and propose a novel research contribution. The output is a research proposal identifying an assumption to challenge (the "bit flip") and how to validate it.

commit-splitter

148
from sundial-org/skills

Split large sets of uncommitted changes into logical, well-organized commits. Use when the user has many uncommitted changes and wants structured commits, or proactively suggest when detecting a large diff that would benefit from splitting.

codex

148
from sundial-org/skills

Run OpenAI's Codex CLI agent in non-interactive mode using `codex exec`. Use when delegating coding tasks to Codex, running Codex in scripts/automation, or when needing a second agent to work on a task in parallel.

ai-co-scientist

148
from sundial-org/skills

Transform Claude Code into an AI Scientist that orchestrates research workflows using tree-based hypothesis exploration. Triggers on "research project", "scientific experiment", "run experiments", "AI scientist", "tree search experimentation", "systematic study".