Skip to main content
The tinker backend is rLLM’s async-first training backend that provides a unified architecture for both agent and workflow training. It’s designed for flexibility and ease of use with built-in support for LoRA and seamless integration with the tinker service.

Overview

tinker backend features:
  • Async-First Design: Native async/await support throughout the training pipeline
  • Unified Architecture: Single codebase for agent and workflow training
  • Service-Based: Uses tinker service for model serving and training
  • Simplified API: Cleaner configuration and easier setup
Python Version: Requires Python >= 3.11 for tinker backend

Installation

Install rLLM with the tinker backend:

Dependencies

The tinker backend includes (from pyproject.toml):

Basic Usage

Agent Training

Train a math agent with tinker backend. The recommended path is to use the cookbooks/math cookbook, which already wires an AgentFlow + Evaluator against the unified trainer:
train.py
Run via the cookbook’s pre-baked tinker launch script:

Workflow Training

For legacy Workflow-based training on tinker, use the unified trainer (rllm.trainer.unified_trainer.AgentTrainer) — the old rllm.trainer.AgentTrainer(backend="tinker") path has been removed. See cookbooks/workflow/solver_judge/ for a runnable example:
train_workflow_tinker.py

Configuration

The tinker backend uses tinker_rl_trainer.yaml configuration:

Model Configuration

string
default:"Qwen/Qwen3-8B"
Model path (HuggingFace or local)
integer
default:"32"
LoRA rank (parameter-efficient fine-tuning)
boolean
default:"true"
Train LoRA on output embedding layer
boolean
default:"true"
Train LoRA on attention layers
boolean
default:"true"
Train LoRA on MLP layers

Training Configuration

integer
default:"16"
Number of rollouts per prompt (for GRPO)
integer
default:"1"
Number of rollouts per validation prompt
float
default:"2e-5"
Learning rate for optimizer
integer
default:"32768"
Maximum sequence length (prompt + response)
integer
default:"1"
Number of minibatches per update (currently only 1 is fully tested)

Algorithm Configuration

string
default:"grpo"
Advantage estimator: “grpo”, “reinforce”, or “distill”
float
default:"1.0"
Discount factor for rewards
string
default:"trajectory"
Grouping level: “trajectory” or “step”
boolean
default:"false"
Normalize advantages by standard deviation in GRPO

Data Configuration

integer
default:"64"
Training batch size
integer
default:"32"
Validation batch size
integer
default:"2048"
Maximum prompt length in tokens
integer
default:"2048"
Maximum response length in tokens

Trainer Configuration

integer
default:"10"
Number of training epochs
integer
default:"5"
Validation frequency (in steps)
integer
default:"20"
Checkpoint save frequency (in steps)
string
default:"/tmp/rllm-tinker-checkpoints"
Checkpoint directory

LoRA Training

tinker backend has native LoRA support built-in:
Configure LoRA parameters:
Set model.train_unembed=false for Fireworks AI compatibility when deploying LoRA adapters.

Tinker Service

Local Service

By default, tinker backend uses a local service:

Remote Service

Connect to a remote tinker service:

Sampling Configuration

Configure sampling parameters:
float
default:"1.0"
Sampling temperature
float
default:"1.0"
Top-p (nucleus) sampling parameter
Important: Setting temperature or top_p away from 1.0 is not recommended by tinker and can cause mysterious issues with logprobs. See tinker-cookbook#86 for discussion.

Rollout Engine Configuration

string
default:"medium"
Reasoning effort level: “low”, “medium”, “high”
boolean
default:"false"
Accumulate reasoning tokens across steps
boolean
default:"false"
Disable thinking tokens in responses
boolean
default:"false"
Bypass renderer and use parser directly

Checkpointing

tinker backend provides flexible checkpointing:

Automatic Checkpointing

Resume from Checkpoint

Resume from a tinker checkpoint:

Manual Checkpoint Loading

Distillation Support

tinker backend supports knowledge distillation from teacher models:
Run distillation training:

Advanced Features

Fused Forward-Backward and Optimizer Step

For better performance, tinker can fuse forward-backward pass with optimizer step:
This optimization reduces overhead by combining gradient computation and parameter updates into a single operation.

Multi-Step Agents

For multi-turn agent interactions:

Workflow Parallel Tasks

Control parallelism in workflow execution:

Monitoring

Configure logging backends:

Example Configuration

Complete configuration for MATH dataset training:
config.yaml

Performance Optimization

Increase Batch Size

Tune data.train_batch_size and training.group_size for better GPU utilization

Use LoRA

Enable LoRA for faster training and lower memory usage

Fuse Operations

Set fuse_forward_backward_and_optim_step=true for reduced overhead

Parallel Workflows

Increase workflow.n_parallel_tasks for workflow-based training

Troubleshooting

tinker requires Python >= 3.11. Upgrade your Python version:
If you see warnings about temperature or top_p:
Setting these away from 1.0 can cause logprob issues.
Currently only num_minibatches=1 is fully tested:
Ensure the checkpoint directory exists:
If using remote service, verify the URL:

Comparison with verl

Key differences from verl backend: See Backend Comparison for detailed feature comparison.

See Also

verl Backend

Distributed training with verl

Backend Comparison

Compare tinker vs verl features

tinker Cookbook

Official tinker cookbook repository

Agent Trainer

Learn about AgentTrainer API