Looper Documentation
Looper Cookbook

Start here

Read this page to learn what Looper runs for you, what you can train with it, and where to start.

Looper is a hosted service that trains and samples language models. Your Python program provides the data and runs the training, either with ready-made training code or with your own. Looper does the heavy computation on its GPUs, and the model's weights stay there, never on your computer.

There's a lot in these docs, and you won't need most of it for any one task. Answer the three questions below to find the pages that matter for what you're doing.

Before you start

Whatever you do, you need:

Two things are good to know before you train:

Get help from an AI assistant

If you'd like an AI assistant to help you, click the button below. It copies a prompt that tells the assistant how to help you, followed by the full text of every page of these docs. Paste it all into a new chat with your assistant, and it will guide you through setup and your task, one step at a time. To read the prompt first, click Show the prompt under the button.

Show the prompt
I want to use Looper, a hosted service for training and sampling language models. After this message are Looper's complete docs, one page at a time.

Please help me get set up and do my task, using only what the docs say:

1. First, ask me the three questions on the docs' Start here page, about what I want to do, what I have, and how much I want to write. Then tell me which path on that page fits me.
2. Help me install the SDK, set my API key and project, and run the setup check, as the Quickstart page shows.
3. Then walk me through my path one step at a time. Write complete code I can run, using the calls and settings the docs show, and explain what each part does in plain words.
4. If something I want isn't covered by the docs, tell me so, instead of guessing.

When I share an error, explain what it means and how to fix it, using the docs.

The copied text is long, because it holds every page. Most assistants can take it all in one message.

1. What do you want to do?

2. What do you have?

Then go to question 3.

3. How much do you want to write?

Ready-made code can run the training for you. This code is called the cookbook, and you can use as much or as little of it as you like:

You don't have to decide for good now. You can start with the cookbook as it is, then swap in your own pieces as you need them. What you build explains each option.

The cookbook isn't on PyPI yet. You install it from a clone of its repository, goalyinc/looper-cookbook, as The cookbook shows. The SDK, which is all you need to write your own loop, installs with pip.

None or some of it: with the cookbook All of it: your own loop
SFT SFT with the cookbook SFT with your own loop
RL RL with the cookbook RL with your own loop

Your path

Each path lists the pages to read, in order. You can skip everything else until you need it.

Try a model

  1. Quickstart: install the SDK, set up your key, and check that it works.
  2. 101: Hello Looper: sample a model and read its answers, step by step.
  3. Sampling: choose a model, control how answers are written, and read the results.
  4. Available models: the models you can use.
  5. Checkpoint: Sample a checkpoint: try a model you trained and saved.

Evaluate a model

  1. Quickstart: install the SDK, set up your key, and check that it works.
  2. Sampling: Create a sampling client: start a sampler for the model you want to measure.
  3. Verifiers: how each answer is scored.
  4. Evaluation: run your questions and read the scores.

SFT with the cookbook

  1. How training works: read the Supervised fine-tuning section.
  2. What you build: what the cookbook does for you, and what you provide.
  3. Quickstart: install the SDK, set up your key, and check that it works.
  4. SFT with the cookbook: get your data ready, train with one command or a short script, and try the trained model.
  5. Choosing settings: which model and settings to start with, and what to change.
  6. Supervised learning: the cookbook's SFT loop in full.
  7. Message formatting: how your conversations become training data, including thinking and tools.
  8. Checkpoint: what you can do with the trained model.

To swap in your own pieces: if your data isn't in a JSONL file of conversations, see A dataset of your own. To change the loop itself, copy looper_cookbook/train_sft.py and edit it.

Tutorials: 201: Chat data, then 301: The SFT loop.

RL with the cookbook

  1. How training works: how RL works, and the trainer and sampler.
  2. What you build: what the cookbook does for you, and how to use your own scoring.
  3. Quickstart: install the SDK, set up your key, and check that it works.
  4. RL with the cookbook: choose your problems, train with one command or a short script, and read the results.
  5. Choosing settings: which model and settings to start with, and what to change.
  6. Verifiers: how answers are scored, and how to write your own.
  7. Reinforcement learning: the cookbook's RL loops in full, synchronous and asynchronous.
  8. Evaluation: measure the model before and after training.
  9. Checkpoint: what you can do with the trained model.

Before you train, check that the model gets your problems right some of the time, but not always. RL learns nothing from a problem the model always gets right, or always gets wrong. Choose your problems explains how to check.

To swap in your own pieces:

If the model uses tools while it answers, such as running shell commands, also read Episode sessions, Environments and Sandboxes.

Tutorial: 302: The RL loop. For a complete example, see the Code RL recipe.

SFT with your own loop

  1. How training works: read the Supervised fine-tuning section.
  2. What you build: what you write yourself, and which cookbook helpers you can still borrow.
  3. Quickstart: install the SDK, set up your key, and check that it works.
  4. SFT with your own loop: a short training loop to start from, and what to add for a real run.
  5. Choosing settings: which model and settings to start with, and what to change.
  6. Session: connect to Looper, and handle timeouts and retries.
  7. Training: every training call in detail. Read up to and including Set the learning rate.
  8. Checkpoint: save the trained model, and try it out.
  9. API reference: every call and its options.

Tutorials: 101, 102 and 103.

RL with your own loop

  1. How training works: how RL works, the trainer and sampler, and synchronous and asynchronous RL.
  2. What you build: what you write yourself, and which cookbook helpers you can still borrow.
  3. Quickstart: install the SDK, set up your key, and check that it works.
  4. RL with your own loop: a short RL round to start from, and what to add for a real run.
  5. Choosing settings: which model and settings to start with, and what to change.
  6. Session: connect to Looper, and handle timeouts and retries.
  7. Training: every training call in detail, especially Choose a loss, Train on rewards and Submit ahead.
  8. Sampling: especially Sample a run's own weights.
  9. Checkpoint: save the trained model, and try it out.
  10. API reference: every call and its options.

Before you train, check that the model gets your problems right some of the time, but not always. RL learns nothing from a problem the model always gets right, or always gets wrong. Choose your problems explains why.

Tutorials: 101 to 104.

Everything else