Loading...
Loading...
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.
npx skill4agent add sundial-org/skills tinker-training-cost# 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 --jsonTraining Cost = (total_tokens × epochs × train_price_per_million) / 1_000_000total_tokensepochstrain_price_per_millionAll prices as of January 5, 2026 Source: https://thinkingmachines.ai/tinker/
| Category | Description |
|---|---|
| Prefill | Processing input context (inference) |
| Sample | Generating output tokens (inference) |
| Train | Training/fine-tuning tokens |
| 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 |
| 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 |
| Model | Prefill | Sample | Train |
|---|---|---|---|
| DeepSeek-V3.1 | $1.13 | $2.81 | $3.38 |
| Model | Prefill | Sample | Train |
|---|---|---|---|
| GPT-OSS-120B | $0.18 | $0.44 | $0.52 |
| GPT-OSS-20B | $0.12 | $0.30 | $0.36 |
| Model | Prefill | Sample | Train |
|---|---|---|---|
| Kimi-K2-Thinking | $0.98 | $2.44 | $2.93 |
| Model | HuggingFace Tokenizer |
|---|---|
| Qwen3-4B-Instruct-2507 | |
| Qwen3-8B | |
| Qwen3-30B-A3B | |
| Qwen3-32B | |
| Qwen3-235B-Instruct-2507 | |
| Qwen3-VL-* | |
| Llama-3.2-1B | |
| Llama-3.2-3B | |
| Llama-3.1-8B | |
| Llama-3.1-70B | |
| DeepSeek-V3.1 | |
| GPT-OSS-* | |
| Kimi-K2-Thinking | |
scripts/calculate_cost.pyfrom 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")){"messages": [{"role": "user", "content": "..."}, {"role": "assistant", "content": "..."}]}{"text": "Your training text here"}{"instruction": "...", "input": "...", "output": "..."}Dataset tokens: 1,000,000
Training tokens: 1,000,000 × 3 = 3,000,000
Cost: 3.0M × $0.40/M = $1.20Dataset tokens: 5,000,000
Training tokens: 5,000,000 × 2 = 10,000,000
Cost: 10.0M × $3.16/M = $31.60Dataset tokens: 2,000,000
Training tokens: 2,000,000 × 4 = 8,000,000
Cost: 8.0M × $2.04/M = $16.32