Prime Intellect Runs SDK - Track eval and training runs on the Prime platform
Actively maintained. Last release 9 days ago, commits in 26 of the last 26 weeks. A safe choice.
pip install prime-runsPrime Runs SDK
Track evaluation and training runs on the Prime Intellect platform: init()
opens the run, records stream out while it proceeds, and finish() closes it
out with a terminal status.
Install
uv add prime-runs # or: pip install prime-runs
uv add 'prime-runs[train]' # training runs: adds pyarrow for the sample table
Eval runs
import prime_runs as pr
run = pr.init(
name="gsm8k-qwen3-8b",
environments=["gsm8k"], # hub names (get-or-create) or owner/name slugs
model="Qwen/Qwen3-8B",
framework="verifiers",
config="eval.toml", # the launched file, stored byte for byte
)
print(run.url) # https://app.primeintellect.ai/dashboard/evaluations/...
for episode in rollouts:
run.log_episodes([episode]) # a queue put; bare traces: log_traces()
run.finish(summary=pr.metrics.from_episodes(episodes))
init() is called before the first rollout. Every record the run uploads is
keyed to it: the SDK sets run.id and run.type on the uploaded copy of each
trace and episode, over whatever run id the producer recorded locally, and
keeps the rest of that block (name, work). A producer never needs to know
the platform's id; run.url is the handle. A with run: block finishes for
you: an exception marks the run failed, Ctrl-C cancelled, and a process
that exits without finishing is reported crashed by an atexit hook. An
evaluation that stops without completing is closed out on the platform as
FAILED or CANCELLED (a crash arrives as FAILED with the reason in
error_message), so it never shows as running forever; a run the platform
already closed is left as it is.
config= takes the path to the launched file (kept verbatim under
config_source, comments and all) or a mapping stored as given; put a file
under pr.CONFIG_SOURCE_KEY in the mapping to send both. Nothing is redacted.
Training runs
run = pr.init(
kind="train",
name="qwen3-8b-gsm8k-rl",
model="Qwen/Qwen3-8B", # the base model
environments=["primeintellect/gsm8k"], # hub ids, passed through
training=pr.TrainingSpec(max_steps=1000, batch_size=64, rollouts_per_example=8),
config=train_config.model_dump(),
team_id="team_...", # external runs belong to a team
)
for step, (episodes, metrics) in enumerate(training_loop):
run.log_episodes(episodes) # episodes carry run.work.step (TrainRunInfo)
run.log_metrics(metrics, step=step)
run.finish()