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:
- Python 3.12 or newer.
- An API key for an organization with credit. Authenticate shows where to create one.
- A project name. This can be any name you choose. Your training runs and saved models are kept under it.
Two things are good to know before you train:
- Your program has to keep running for the whole training run. The training happens on Looper, but your program sends each step and keeps the session open. If your program stops, for example because your laptop goes to sleep, the session expires after 60 seconds, and its training run is shut down. A run can't be resumed from a checkpoint yet, so it starts again from the beginning. For long runs, use a machine that stays on, such as a server or a cloud VM. See When a session expires.
- Your trained model is kept on Looper. You can sample it through Looper, or download its weights to run it yourself. See Checkpoint.
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?
- See what a model writes for a few prompts. For example, to try a model out, or to compare a model before and after training. Go to Try a model.
- Measure how well a model does on a set of questions. For example, to get a score you can compare between models. Go to Evaluate a model.
- Train a model. Go to question 2.
2. What do you have?
- Examples of the answers you want (SFT). For example, questions paired with good answers, or chats with ideal replies. The model learns to write answers like your examples. This is called supervised fine-tuning (SFT).
- Questions and a way to check whether an answer is good, but no example answers (RL). For example, math problems with known results, or coding tasks with tests. The model writes its own answers, your code scores them, and the model learns to write more answers like the high-scoring ones. This is called reinforcement learning (RL).
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:
- None of the training code. Use the cookbook as it is. You provide only the data and, for RL, pick one of its built-in ways to score answers, such as checking a final number or running code against tests.
- Some of it. This is where most people land. Let the cookbook run the training, and swap in your own pieces where you need them. That's often your own scoring, but it can also be your own way of loading data, or your own tools for the model to use. If the training loop itself needs to work differently, you can copy it and change it.
- All of it. You write the training loop yourself, call by call. Choose this if you need to train in a way the cookbook doesn't support, such as switching between SFT and RL during training, or changing the learning rate as RL goes.
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
- Quickstart: install the SDK, set up your key, and check that it works.
- 101: Hello Looper: sample a model and read its answers, step by step.
- Sampling: choose a model, control how answers are written, and read the results.
- Available models: the models you can use.
- Checkpoint: Sample a checkpoint: try a model you trained and saved.
Evaluate a model
- Quickstart: install the SDK, set up your key, and check that it works.
- Sampling: Create a sampling client: start a sampler for the model you want to measure.
- Verifiers: how each answer is scored.
- Evaluation: run your questions and read the scores.
SFT with the cookbook
- How training works: read the Supervised fine-tuning section.
- What you build: what the cookbook does for you, and what you provide.
- Quickstart: install the SDK, set up your key, and check that it works.
- SFT with the cookbook: get your data ready, train with one command or a short script, and try the trained model.
- Choosing settings: which model and settings to start with, and what to change.
- Supervised learning: the cookbook's SFT loop in full.
- Message formatting: how your conversations become training data, including thinking and tools.
- 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
- How training works: how RL works, and the trainer and sampler.
- What you build: what the cookbook does for you, and how to use your own scoring.
- Quickstart: install the SDK, set up your key, and check that it works.
- RL with the cookbook: choose your problems, train with one command or a short script, and read the results.
- Choosing settings: which model and settings to start with, and what to change.
- Verifiers: how answers are scored, and how to write your own.
- Reinforcement learning: the cookbook's RL loops in full, synchronous and asynchronous.
- Evaluation: measure the model before and after training.
- 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:
- Your own scoring: A verifier of your own.
- Your own data loading: A dataset of your own.
- Your own tools for the model: An environment of your own.
- A different loop: copy
looper_cookbook/train_rl.pyortrain_rl_async.pyand edit it.
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
- How training works: read the Supervised fine-tuning section.
- What you build: what you write yourself, and which cookbook helpers you can still borrow.
- Quickstart: install the SDK, set up your key, and check that it works.
- SFT with your own loop: a short training loop to start from, and what to add for a real run.
- Choosing settings: which model and settings to start with, and what to change.
- Session: connect to Looper, and handle timeouts and retries.
- Training: every training call in detail. Read up to and including Set the learning rate.
- Checkpoint: save the trained model, and try it out.
- API reference: every call and its options.
RL with your own loop
- How training works: how RL works, the trainer and sampler, and synchronous and asynchronous RL.
- What you build: what you write yourself, and which cookbook helpers you can still borrow.
- Quickstart: install the SDK, set up your key, and check that it works.
- RL with your own loop: a short RL round to start from, and what to add for a real run.
- Choosing settings: which model and settings to start with, and what to change.
- Session: connect to Looper, and handle timeouts and retries.
- Training: every training call in detail, especially Choose a loss, Train on rewards and Submit ahead.
- Sampling: especially Sample a run's own weights.
- Checkpoint: save the trained model, and try it out.
- 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.
Everything else
- Available models: which models you can train and sample, and their sizes.
- The cookbook: every part of the cookbook, one page each.
- The tutorials: notebooks that teach Looper a step at a time.
- The SDK reference: calls, values and errors.