Lumbridge Compute

Open

Lumbridge RL Train small models on your own GPU.

Lumbridge RL is the trainer under Train. It trains open-weight models on hardware you own: supervised fine-tuning on one GPU, and a reinforcement-learning loop on two.

Tour

See RL at work.

Lumbridge RLDark theme
A terminal where the lumbridge-rl trainer starts an 80-step fine-tuning run on one GPU: optimizer, scheduler and data are set up, then the first four steps print a loss falling from 3.05 to 0.20
A fine-tuning run starting on one GPU.Dark themeOpen full size

The config

One file per run.

The model, the LoRA settings, the data and the batch size. The trainer reads the file and starts.

Lumbridge RLDark theme
A terminal showing a lumbridge-rl config file for a five-step LoRA test: the model, LoRA rank 16 and alpha 32, test data, batch size 2 and a sequence length of 1024
One config file describes a run: model, LoRA, data, batch.Dark themeOpen full size
FIG. 1 — From a TOML file to trained weights

What it does

What RL does.

Fine-tuning on one GPU

uv run sft takes a TOML config and trains on one GPU: full weights or LoRA, with activation checkpointing and a chunked output head. Checkpoints land under the run’s output folder.

The RL loop

uv run rl starts an inference server, an orchestrator and a trainer. The orchestrator samples answers from environments, scores them and sends batches to the trainer, which pushes new weights back.

Installs beside running models

scripts/lumbridge/spark-setup.sh installs on an arm64 GPU machine with unified memory. It caps compile jobs, runs at idle priority and ends with a five-step smoke test.

A Gemma 4 adapter

A thin adapter over the reference Gemma 4 modules, with explicit block-causal and sliding-window masks for packed rows. Weights load with no conversion, and a check script compares it with the reference on real weights.

Memory, measured

On unified memory the trainer’s peak-memory figure counts every process on the machine. scripts/lumbridge/measure-mem.sh samples the memory the system has left, so you see what the run itself took.

Close to upstream

The changes are small and kept in files named for Lumbridge. The package keeps its upstream name, and every upstream file touched is listed in LUMBRIDGE.md.

How it works

One config, three processes.

Every entry point reads the same kind of TOML file. Settings compose from files, then the command line, and --dry-run writes the resolved configs without starting anything.

  1. 1

    The trainer

    Trains with sharded data parallel, and flash attention where the model allows it. It trains the layouts it has model code for, including Llama, Qwen and Gemma 4, and stops at setup for anything else.

  2. 2

    The inference server

    vLLM with routes added for loading new weights and LoRA adapters during a run. uv run inference starts it on its own.

  3. 3

    The orchestrator

    Runs environments, samples groups of answers, scores them, computes advantages and hands batches to the trainer. It also runs evals at a set interval.

  4. 4

    The Lumbridge layer

    The install script, the smoke configs in configs/lumbridge, the Gemma 4 adapter and the memory script. Lumbridge Train writes an SFT config per run and calls uv run sft here.

Use it

Install, smoke-test, train.

Everything runs through uv from a clone of the repository. The smoke configs train for five steps on generated data: they check the setup, not a model.

The install script, a fine-tuning run, the memory check and a dry run of the RL loop
# install on a unified-memory GPU machine, then a 5-step SFT smoke test
scripts/lumbridge/spark-setup.sh

# supervised fine-tuning from a TOML config
uv run sft @ configs/lumbridge/spark-smoke.toml

# LoRA SFT through the Gemma 4 adapter, and the memory it took
scripts/lumbridge/measure-mem.sh configs/lumbridge/bolt-e4b-smoke.toml

# the RL loop: resolve the configs without starting it
uv run rl @ examples/basic/reverse-text/rl.toml \
  --dry-run --output-dir out --run.name check

Docs

The manual for RL.

In the repository.

  1. 01

    Training

  2. 02

    Configuration

  3. 03

    Algorithms

  4. 04

    Inference

  5. 05

    Eval

  6. 06

    Scaling

  7. 07

    What changed

Guide chapter: Factory and models

Works with

What RL works with.

Not yet

  • A decision loss: loss on the answer tokens, plus a temperature-calibration step.
  • Context parallelism in the Gemma 4 adapter, which uses plain attention, not flash attention.
  • RL on one GPU. The loop puts inference and the trainer on separate GPUs.
FIG. 2 — Where RL sits in Lumbridge

Questions

Questions about RL.

How is it different from the trainer it forked?

It adds an install profile for a shared unified-memory machine, a Gemma 4 adapter, smoke configs and a memory script. Everything else is upstream code, merged in regularly.

Does anything leave my machine?

Training runs where you start it. Model weights download from wherever your config points, and outside logging is optional.