❝

Most people read "self-hosted Tinker" and think the value is the four API calls. The API is the easy part: OpenRL implements 48 of the 95 public methods in the Tinker SDK and skips the other 47. The real product is underneath, in a GPU time-slicer that freezes whole CUDA processes, a scheduler that breaks up job convoys, and a weight-sync path that went from 57 seconds to under one.

SnackOnAI Engineering | Senior AI Systems Researcher | Technical Deep Dive | November 28, 2026

Found this useful?
A tip keeps the deep-dives free for everyone.
$0 of $10,000 · 0 supporters
$1,000 Silver
$5,000 Gold
$10,000 Platinum
Other amount

Promise and Fence

The promise: by the end of this issue you will know how OpenRL turns a Tinker training loop on your laptop into scheduled GPU work on Kubernetes, how it packs several RL jobs onto the same GPUs, and which Tinker features silently do not work yet.

The fence: this is not a Tinker review and not an RL algorithms tutorial. I cloned openrl-dev/openrl at commit eae6e40 (v0.6.18, Nov 19, 2026), read the architecture and design docs, ran its memory estimator and loss functions locally, and read the scheduler code. I did not deploy it on a GKE cluster, so the throughput and latency numbers below are the project's own measurements.

What It Actually Does

OpenRL is a self-hosted server that speaks the Tinker API. You keep your RL loop in plain Python on your machine, pip install tinker, point ServiceClient(base_url=...) at your cluster, and OpenRL does the GPU work.

The loop is built from four primitives:

Primitive

What it does on the cluster

sample

vLLM generates rollouts and token logprobs from a chosen adapter version

forward_backward

the trainer computes the loss and accumulates gradients for one adapter

optim_step

AdamW updates that adapter's weights and its own optimizer state

save_state / save_weights_for_sampler

snapshots the weights so the sampler can load that exact policy

Two corrections to the launch framing:

  • "LoRA only" is out of date. The June 2026 research preview started with LoRA. On main, the roadmap says LoRA and full fine-tuning both run behind the same Tinker-compatible API, with FFT shipped as a separate manifest (openrl-fft.yaml).

  • The home has changed. The repo moved from gke-labs/open-rl to openrl-dev/openrl, and Google donated the project to the CNCF Sandbox at KubeCon in Salt Lake City this month.

The Architecture, Unpacked

Follow one arrow pair: the loop on your laptop never sees a GPU. Everything between "enqueue by model_id" and the time-slicer at the bottom exists so several of those loops can share the same hardware without corrupting each other's state.

Four decisions matter.

1. Futures, not RPCs. Every training call returns a request ID immediately; the client long-polls retrieve_future. A 40-second backward pass on a shared cluster cannot be a blocking HTTP call, and futures let the SDK pipeline sample, train and save requests.

2. Tenant batches, serialized. The queue groups work by model_id, and the trainer processes one tenant batch at a time. The architecture doc is explicit: switching the active adapter mid-backward or mid-step would mix gradients and AdamW moments across customers. Concurrency comes from between tenant batches, not within them.

3. Freeze processes, not tensors. For co-located jobs, the node-local time-slicer grants one workload per GPU claim. On release it runs cuda-checkpoint --action checkpoint --pid <pid>, which moves the process's whole GPU state into host memory; on the next acquire it restores it. No framework hooks, no custom offload code in vLLM or PyTorch.

4. Ship deltas, not checkpoints. For full fine-tuning, the trainer exports only the parameters that changed, publishes a Redis message, and samplers stage the delta in pinned host memory while they sleep, then DMA it straight into existing VRAM addresses.

The Code, Annotated

The scheduler that breaks convoys (real code, accel_timeslicer/single_node.py)

def next_waiter(self, claim: str) -> str | None:
    """The earliest waiter under fifo, the least recently served otherwise."""
    waiting = [self.workloads[n].workload for n in self.waiting_workloads
               if self.workloads[n].workload.claim == claim]
    if not waiting:
        return None
    if self.scheduling_policy == "fifo" or len(waiting) == 1:
        return waiting[0].name
    # Under FIFO, identical RL jobs fall into lockstep: all three queue on the
    # trainer GPU while the sampler GPU idles, then all three queue on the
    # sampler while the trainer idles. Picking whoever left the GPU LONGEST AGO
    # pushes a delayed job to the front, which de-phases the jobs so one trains
    # while another samples.
    return min(waiting, key=lambda w: self.last_release_time.get(w.name, 0.0)).name  # ← THIS is the trick

async def release(self, workload):
    ...
    checkpointed = await self.run_checkpoint(state)   # cuda-checkpoint: GPU state → host RAM
    # The grant is held THROUGH the checkpoint, so the next job is never
    # restored on top of memory that is still in use.
    self.last_release_time[workload.name] = time.time()

One min() over release timestamps. The project's own 3-job, 2-GPU test measured average step time falling from 143.70 s under FIFO to 130.26 s under LRS (−9.4%) and the fastest step from 70.19 s to 50.89 s (−27.5%).

The loss you think you asked for (real code, training/losses.py, run locally)

def importance_sampling_loss(target_logprobs, weights, old_logprobs, advantages):
    ratio = policy_ratio(target_logprobs, old_logprobs)       # exp(new − old), clamped at ±20 in log space
    elementwise_loss = -(ratio * advantages) * weights        # NO clipping
    return torch.nan_to_num(elementwise_loss, nan=0.0, posinf=0.0, neginf=0.0)  # blowups become 0, silently

def ppo_loss(target_logprobs, weights, old_logprobs, advantages, loss_config):
    diff = torch.clamp(target_logprobs - old_logprobs, min=-20.0, max=20.0)
    ratio = torch.exp(diff)
    epsilon = loss_config.get("clip_range", 0.2) if loss_config else 0.2
    surr = torch.min(ratio * advantages, torch.clamp(ratio, 1 - epsilon, 1 + epsilon) * advantages)
    ...

# The README's RL loop calls:
#   forward_backward_async(datums, loss_fn="importance_sampling", loss_fn_config={"clip_range": 0.2})
# but the trainer dispatches importance_sampling WITHOUT loss_config.  ← THIS is the trick
# Toy check (new logprob −0.5 vs old −1.5, advantage 1.0):
#   policy ratio         = 2.7183
#   importance_sampling  = −2.7183   (clip_range ignored)
#   ppo, clip 0.2        = −1.2000

Three loss functions in 40 lines, and forward_backward_custom is on the unsupported list, so you cannot bring your own. If you copy the README loop expecting clipped updates, a token whose probability jumped e-fold gets a 2.27× larger push than PPO would give it.

Sizing a job before it lands (real code, server/estimator.py, run locally)

from estimator import footprint
GiB = 1024**3
for ft in ("lora", "full"):
    for role in ("trainer", "sampler"):
        f = footprint("Qwen/Qwen3-4B-Instruct-2507", ft, role)  # suffix stripped → "qwen3-4b"
        print(ft, role, round(f.accelerator_bytes / GiB, 2), f.resources)

# lora trainer   11.49 GiB device, 28Gi host   ← bf16 frozen base (2 B/param) + 4 GiB reserve
# lora sampler   19.39 GiB device, 32Gi host   ← weights + 8 LoRA slots + KV for 65,536 tokens (9 GiB)
# full trainer   33.95 GiB device, 73Gi host   ← 8 B/param: bf16 weights + grads + fp32 master
# full sampler   17.46 GiB device, 32Gi host
# Unknown models are sized as qwen3-8b on purpose: "sized large, not small".  ← THIS is the trick

The estimator is a placement claim, not a vLLM setting: it decides which GPU a pod may land on. Its comments record why the host limit equals the request: an 8B FFT sampler ran at 39 GiB against a 34 GiB request and pushed a neighbour into the OOM killer.

It In Action

Input: the repo's text-to-SQL recipe on the getting-started cluster (one g2-standard-24 node with two NVIDIA L4s, 24 GB each), google/gemma-4-e2b, LoRA rank 32 (the script default). The loop runs on a laptop.

Step

What happens

Number

SFT

5 steps on 100 examples, lr 5e-5

execution match 8% → 12%

RL

80 steps × 8 prompts × 8 samples = 5,120 rollouts, lr 5e-6

execution match 12% → 40% (+28 points)

Reward

SQL executed in local SQLite on the laptop, scored, advantages computed

reward EWMA climbs about 5.4×

Compile rate

share of generated SQL that runs at all

~16% → ~62%

Now size the same idea for the input card's model, Qwen3-4B-Instruct-2507, rank 16 on all seven projections (my arithmetic, using the estimator above):

Item

Number

LoRA parameters

36 layers × 917,504 = 33,030,144 (0.82% of 4.02B)

Adapter size

66 MB in bf16; AdamW moments 264 MB in fp32

LoRA trainer + sampler

11.49 + 19.39 = 30.9 GiB: more than one 24 GB L4, so one job takes both GPUs

Second job

must wait for a time-slice: cuda-checkpoint parks job A in host RAM (28 + 32 GiB requests)

Full fine-tune trainer

33.95 GiB: does not fit on one L4 at all; the FFT doc shards it across two with FSDP

Weight sync per step (FFT, 8B)

full reload 57.18 s → in-place delta ~950 ms on the critical path (60×)

The punchline of that table: on the default getting-started hardware, "several RL jobs on the same GPUs" means taking turns, not running side by side. Packing works because RL steps spend so much time on CPU rewards and environments, not because the jobs fit in memory together.

Why This Design Works

RL loops are mostly waiting. Trainers wait on samplers, and samplers wait on rewards that are CPU- or network-bound. Freezing an idle job's GPU state and handing the device to a job that is ready turns that wait time into someone else's compute.

LoRA makes multi-tenancy cheap. One frozen base model serves every tenant. Each job adds a 66 MB adapter and a 264 MB optimizer state, and vLLM can hold eight adapters at once. That is the economic core of Tinker, and OpenRL keeps it.

The API boundary is a team boundary. Researchers own data, rewards and loss inputs; platform engineers own queues, DRA claims and node pools. Google pitches it the way Kubernetes separated infrastructure from applications, and the code backs it up: nothing in the loop knows where the GPUs are.

What it trades away. Custom losses (forward_backward_custom is unsupported), the whole checkpoint management and session API (list, delete, publish, archive), multi-GPU trainers for medium dense models (on the roadmap), and models outside the estimator's table, which get sized as an 8B.

Technical Moats

  1. Process-level GPU time-slicing. Using cuda-checkpoint to park and restore entire trainer and sampler processes, holding the grant through the checkpoint so nothing is restored onto live memory, is subtle systems work that most RL frameworks avoid by dedicating GPUs.

  2. The weight-sync path. Four generations of design docs took an 8B full-weight sync from 57.18 s (re-reading 15.26 GiB over NFS) to about 950 ms on the critical path via sparse deltas, pinned DRAM pre-staging and in-place index_copy_ into VRAM, while removing 15.3 GB of per-worker host snapshots.

  3. Kubernetes-native placement. A Go controller binds DRA resource claims, so trainer and sampler pods land on the same node under the same time-slicer. It needs GKE 1.35+ and the NVIDIA DRA driver, and that dependency stack is itself a moat.

Contrarian Insights

1. "Tinker-compatible" means half of Tinker. The project's own compatibility test against tinker==0.29.0 reports 48 supported and 47 unsupported public methods. Every checkpoint management call (list_checkpoints, delete_checkpoint, publish_checkpoint_from_tinker_path), every session and training-run query, and forward_backward_custom fail. The training loop works. The surrounding workflow, where you find, prune and publish what you trained, does not. Tinker-cookbook recipes that only use the four primitives will run; recipes that bring a custom loss will not.

2. GPU packing is time-sharing, and its ceiling is your host RAM. On the reference two-L4 node, one LoRA job on Qwen3-4B already needs both GPUs (11.49 + 19.39 GiB). A second job runs only when the first is checkpointed into host memory, and each parked FFT trainer for a 4B model holds about 22.5 GiB pinned. The project's own notes record a 7B FFT trainer being OOM-killed at 110 GiB. Utilization goes up, but so does the bill for RAM-heavy nodes, and the measured win from smarter scheduling on three tiny jobs was 9.4% average step time. Real, not magic.

❝

Surprising Takeaway: OpenRL's default README loop asks for clip_range=0.2 on importance_sampling, and the server throws it away. The trainer calls the importance-sampling loss without any config, so updates are unclipped, and nan_to_num quietly turns any infinite term into zero. In RL, a silently dropped hyperparameter is worse than a crash: the curve still goes up, just for the wrong reasons.

TL;DR For Engineers

  • OpenRL is a self-hosted Tinker server from Google's GKE Labs, now in the CNCF Sandbox. Your loop runs on a laptop; sample, forward_backward, optim_step and save_state run on Kubernetes.

  • Multi-tenancy = one frozen base + per-job LoRA and AdamW state, serialized tenant batches, and a node time-slicer that parks idle jobs with cuda-checkpoint and picks the least recently served job next.

  • Compatibility is 48 of 95 SDK methods: no custom losses, no checkpoint management API; only cross_entropy, importance_sampling and ppo.

  • On two L4s, one Qwen3-4B LoRA job needs about 30.9 GiB across trainer and sampler, so jobs take turns; FFT is supported on main with sparse delta sync (57 s → ~1 s).

  • The README's clip_range on importance_sampling is ignored. Use loss_fn="ppo" if you want clipping.

Explain It Like I'm New

Teaching an AI model a new skill through practice, called reinforcement learning, works like coaching. The model tries an answer, something scores it, and the model is nudged toward better answers. Repeat thousands of times.

The coaching itself is the interesting part for researchers. The hard part for everyone else is the machinery: expensive graphics cards, software that must be installed just right, and keeping several experiments from stepping on each other.

Thinking Machines, a startup, solved this with a service called Tinker. You write the coaching logic on your own laptop, and their servers do the heavy lifting through a handful of simple commands. The catch is that your data and models run on their machines.

OpenRL is Google's open-source version of that idea that you run on your own servers. It speaks the same commands, so code written for Tinker mostly works unchanged.

Its cleverest trick is sharing. Most of the time, an experiment's graphics card sits idle while answers are being scored. OpenRL freezes the idle experiment, sets it aside in ordinary memory, and lets another experiment use the card, like a restaurant seating a new party while the last one waits for the bill.

This matters because practical AI customization is moving in-house. Companies want to train models on private data without building a research platform from scratch.

See It In Action

  • Google's GKE Labs turns reinforcement learning into a Kubernetes workload (theCUBE at KubeCon NA 2026, via SiliconANGLE): siliconangle.com. Sunil Arora and Justin Santa Barbara explain why GKE Labs built OpenRL and how it fits the Kubernetes model; the best primary-source context on intent.

  • Getting started (OpenRL docs): docs/getting-started.md. A step-by-step GKE deployment with two L4s, the DRA driver and your first SFT and RL jobs from a laptop, plus the optional FFT manifest.

  • From Mac to GKE (OpenRL blog): docs/blog/from-mac-to-gke.md. Shows the "prototype locally, scale remotely" workflow end to end.

  • Text-to-SQL RL recipe (OpenRL examples): examples/text-to-sql. A runnable SFT plus GRPO notebook with result curves from 8% to 40% execution match; the most concrete demo of the API in use.

  • FFT architecture guide (OpenRL docs): docs/fft/fft.md. Time-slicing, LRS vs FIFO measurements and memory sizing tables; the engineering deep dive behind the GPU-sharing claims.

Community Conversation

  • InfoQ (infoq.com): frames OpenRL as an experimental self-hosted API whose efficiency comes from running multiple RL jobs on your infrastructure to raise overall GPU utilization. This issue's sizing table shows what that means on two L4s.

  • Cloud Native Now (cloudnativenow.com): notes that Google hasn't yet documented how OpenRL plugs into KubeFlow pipelines, an integration gap for teams with existing ML platforms.

  • byteiota (byteiota.com): argues that with llm-d for inference and OpenRL for post-training, the CNCF now hosts a complete open pipeline, and notes the donation came before the API stabilized.

  • SkyRL on GKE (discuss.google.dev): SkyRL ships a JAX backend for the Tinker API on TPUs or GPUs. Tinker is becoming a de facto protocol with multiple backends, which is the strongest argument for OpenRL's compatibility bet.

  • Exploring Next podcast (episode transcript): a skeptical but fair take, pointing out that the preview started with LoRA only, so reading it as a full post-training factory on day one gets ahead of the source.

Conclusion: Adopt OpenRL for the Scheduler, Not for the Compatibility Badge

OpenRL proves that Tinker's four-primitive design is a protocol, not a product, and that you can run it on your own Kubernetes cluster today. The genuinely hard engineering is all below the API: process-level GPU checkpointing, least-recently-served turn-taking, DRA-based placement and a weight-sync path that went from 57 seconds to under one.

Treat the compatibility claim with care. Half the SDK is missing, custom losses are out, and one README hyperparameter is silently dropped. If your team runs many small LoRA RL experiments on private data, OpenRL is the most credible self-hosted option and worth deploying now. If you depend on custom objectives or Tinker's checkpoint workflow, wait for the roadmap, or contribute those pieces yourself.

References

  • Hu et al., LoRA: Low-Rank Adaptation of Large Language Models (2021). arXiv:2106.09685

  • Shao et al., DeepSeekMath: Pushing the Limits of Mathematical Reasoning in Open Language Models (introduces GRPO, 2024). arXiv:2402.03300

  • Schulman et al., Proximal Policy Optimization Algorithms (2017). arXiv:1707.06347

  • Sheng et al., HybridFlow: A Flexible and Efficient RLHF Framework (verl, 2024). arXiv:2409.19256

  • Kwon et al., Efficient Memory Management for Large Language Model Serving with PagedAttention (vLLM, 2023). arXiv:2309.06180

Summary

OpenRL is a self-hosted Tinker server that runs your laptop's RL loop on Kubernetes, packing jobs onto shared GPUs with cuda-checkpoint time-slicing, least-recently-served scheduling and sparse in-place weight sync. It supports 48 of 95 Tinker SDK methods, no custom losses, and on two L4s, jobs take turns rather than run side by side.

Sponsored Ad
If you enjoy practical AI insights, check out SnackOnAI and support the newsletter by subscribing, sharing, and exploring our sponsored ad—it helps us keep building and delivering value 🚀

Recommended for you

View all
caret-right