Quickstart
If you haven't read Start here yet, read it first. It tells you which docs to read, and in what order, for what you want to do.
This page gets you set up to use Looper. You install the SDK, set your API key and project, and run a short check that everything works. Everyone should read it, whether you'll use the cookbook or write your own loop.
This page covers:
- Install: install the SDK and the packages the examples use.
- Set your key and environment: tell your programs your API key and project.
- Check your setup: connect to Looper to make sure your key and project work.
- Next steps: where to go next, to try a model or to train one.
Install
You need Python 3.12 or newer.
pip install "goaly-looper==0.1.0b6" "transformers==5.19.0" "jinja2==3.1.6"
This installs three packages. Only the SDK is needed for the check on this page, but the examples in the rest of the docs use all three:
goaly-looperis the SDK, which you import aslooper_sdk. It's how your program calls Looper.transformersturns text into tokens and back on your machine. The SDK sends Looper token ids, never text, so your program does this step itself. It downloads only the model's tokenizer, never its weights.jinja2is used bytransformersto put a question into the model's chat format.
Set your key and environment
export LOOPER_API_KEY=...
export LOOPER_PROJECT=my-project
LOOPER_API_KEYis your API key. The SDK reads it on its own. Authenticate shows where to create one. Your organization needs credit for it to work.LOOPER_PROJECTis your project's name, which can be anything you choose. Your training runs and saved models are kept under it.
Check your setup
This short script connects to Looper and lists your project's saved models (checkpoints). It doesn't start any GPUs, so it runs in a few seconds. A new project has no checkpoints yet, so it should print 0.
Save it as check.py, and run it with python check.py:
import asyncio
import os
from looper_sdk import ServiceClient
async def main():
config = ServiceClient.Config(
project=os.environ["LOOPER_PROJECT"],
)
async with await config.build() as service:
checkpoints = await service.list_checkpoints()
print(f"connected to {config.project}: {len(checkpoints)} checkpoints")
asyncio.run(main())
If it prints a line like connected to my-project: 0 checkpoints, your setup works. If it fails, the error says why:
Unauthenticated: Looper doesn't recognize your key. Check thatLOOPER_API_KEYholds a key you created in the portal.SpendRefused: your organization has no credit. Looper needs credit to open a session.KeyError: 'LOOPER_PROJECT': the environment variable isn't set in the shell you ran the script from.
async with opens a session, and closes it when the block ends. Session explains sessions.
Next steps
To try a model, with no training, go to 101: Hello Looper, which samples a model step by step. Sampling has every option.
To train a model, you can use the cookbook's ready-made loops, or write your own loop with the SDK. What you build explains the difference.
- With the cookbook: Supervised learning for SFT, and Reinforcement learning for RL.
- With your own loop: SFT with your own loop and RL with your own loop. Each starts with a short script you can run and build on.
To learn step by step instead, the tutorials go from a first sample to the cookbook's loops.