Prime Traces SDK
Upload and query training, evaluation and inference traces through the Prime Traces service.
⚠️ Prime Traces is in closed beta. Access is granted per account, and the service is not yet on a public URL.
Install
uv add prime-traces # or: pip install prime-traces
Upload
upload_records takes JSON-compatible mappings or any object exposing
to_record() — which verifiers Trace / Episode and prime-rl Rollout
already do, so producers can hand over their own objects. Records are
serialized lazily into bounded batches, so nothing buffers the whole run or
round-trips through disk.
from prime_traces import LineFormat, TracesClient
client = TracesClient() # PRIME_API_KEY / PRIME_TRACES_URL / ~/.prime/config.json
receipts = client.upload_records(traces, context={"source": "prime-rl"})
# One complete episode per record, for multi-agent runs
receipts = client.upload_records(episodes, line_format=LineFormat.EPISODE)
# Already have a completed JSONL file, or encoded bytes?
receipts = client.upload_file("traces.jsonl", context={"source": "hosted_eval"})
receipts = client.upload_lines(encoded_lines)
Query
page = client.list(run_id="run_9f3k2m", reward_min=0.9, has_error=False)
for summary in page.items:
print(summary.trace_id, summary.score.reward)
for summary in client.iter(task_id="tb2-0187"): # paginates for you
...
summary = client.get(trace_id)
raw = client.get_raw(trace_id) # exact stored document
client.download_raw(trace_id, "trace.json") # streamed, for large traces
client.delete(trace_id)
client.delete_run("run_9f3k2m")
Summaries are projections of the stored document, which is kept verbatim —
fields the producer never recorded come back as None. Deleting something that
is already gone raises NotFoundError rather than passing silently.
Episodes are read-only:
page = client.list_episodes(run_id="run_9f3k2m")
detail = client.get_episode(episode_id) # + member aggregate under .traces
members = client.list_episode_traces(episode_id, has_error=True)
Async
AsyncTracesClient mirrors TracesClient method for method.
import asyncio
from prime_traces import AsyncTracesClient
async def main():
async with AsyncTracesClient() as client:
await client.upload_records(traces, context={"source": "prime-rl"})
page, episodes = await asyncio.gather( # reads overlap
client.list(run_id="run_9f3k2m"),
client.list_episodes(run_id="run_9f3k2m"),
)
async for summary in client.iter(task_id="tb2-0187"):
...
asyncio.run(main())
Configuration
| Source | Meaning |
|---|---|
PRIME_API_KEY |
Platform API token, needs traces:read / traces:write scopes |
PRIME_TRACES_URL |
Base URL of the Prime Traces service (required during closed beta) |
PRIME_TEAM_ID |
Optional team context, sent as X-Prime-Team-ID |
~/.prime/config.json |
Shared prime CLI config (api_key, team_id, traces_url) |
Precedence is constructor argument → environment variable → config file.
Not yet available
- Exports — the service route exists but is unimplemented, so wrapping it would ship a method that cannot succeed.
- Search and free-text queries.
Examples
The runnable basic_usage.py example covers
upload, query, downloads and error handling.
Related packages
- prime — Prime CLI, including
prime traces - prime-sandboxes — Sandboxes SDK
- prime-evals — Evals SDK
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file prime_traces-0.0.2.tar.gz.
File metadata
- Download URL: prime_traces-0.0.2.tar.gz
- Upload date:
- Size: 50.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57a6d93bcd603edfd837fdd166563a93040dd9f71762ca1f29c19ec4b9e9f583
|
|
| MD5 |
59bd9bf8c3f0d78022aa2b8cf5d7b3e1
|
|
| BLAKE2b-256 |
f39f10c2ed46378b005e943c7f591b0ed2ff90e321e85c3f7ddaf66dfb5ca1f9
|
Provenance
The following attestation bundles were made for prime_traces-0.0.2.tar.gz:
Publisher:
release-traces.yml on PrimeIntellect-ai/prime
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prime_traces-0.0.2.tar.gz -
Subject digest:
57a6d93bcd603edfd837fdd166563a93040dd9f71762ca1f29c19ec4b9e9f583 - Sigstore transparency entry: 2509137457
- Sigstore integration time:
-
Permalink:
PrimeIntellect-ai/prime@f80c8ade3a8611f803aacf0c093c6538002eb667 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/PrimeIntellect-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-traces.yml@f80c8ade3a8611f803aacf0c093c6538002eb667 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file prime_traces-0.0.2-py3-none-any.whl.
File metadata
- Download URL: prime_traces-0.0.2-py3-none-any.whl
- Upload date:
- Size: 38.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b3f5b7b6db646815ecfb867668e2cabcdfec77e7f0f186506058a5896f101da7
|
|
| MD5 |
a5b50adea7c094a6385cbd5089daf386
|
|
| BLAKE2b-256 |
8daa7b5b4107135bec3f21de17fb34c2b205adf22cdffe91b7ef5da4e0df72cd
|
Provenance
The following attestation bundles were made for prime_traces-0.0.2-py3-none-any.whl:
Publisher:
release-traces.yml on PrimeIntellect-ai/prime
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
prime_traces-0.0.2-py3-none-any.whl -
Subject digest:
b3f5b7b6db646815ecfb867668e2cabcdfec77e7f0f186506058a5896f101da7 - Sigstore transparency entry: 2509137515
- Sigstore integration time:
-
Permalink:
PrimeIntellect-ai/prime@f80c8ade3a8611f803aacf0c093c6538002eb667 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/PrimeIntellect-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-traces.yml@f80c8ade3a8611f803aacf0c093c6538002eb667 -
Trigger Event:
workflow_dispatch
-
Statement type: