NanoGPT Evals and Observability API
NanoGPT Evals lets you run durable prompt and model experiments, freeze datasets, version scorers, inspect traces, and aggregate latency, cost, token, error, and score trends. The API is available under/api/v1/evals/*.
The same platform powers Prompt Lab at /prompt-lab.
Core Concepts
Projects
A project groups datasets, experiments, traces, and dashboard metrics. If an experiment is created without aproject_id, NanoGPT uses a default Prompt Lab project for the authenticated user.
Datasets and Dataset Versions
A dataset is an editable set of eval rows. A dataset version is a frozen snapshot of the dataset at a point in time. Experiments should use dataset versions when reproducibility matters. Dataset rows support:Scorers
A scorer grades candidate outputs. Scorers are versioned, so an experiment stores the exact scorer snapshot used at run time. Supported scorer types:exact_matchcontainsregexjson_schemathresholdllm_judgepairwise_llm
This version does not run arbitrary JavaScript or Python scorers.
Experiments
An experiment compares one or more candidates over a dataset or inline rows. Experiments are asynchronous and durable. Experiment statuses:queuedin_progresscompletedfailedcancelled
Traces
A trace records a generation or scoring call. Traces store metadata, timings, usage, cost, status, and errors. Prompt and output content is not stored unless explicitly requested.Privacy Defaults
By default, traces are metadata-only. NanoGPT stores prompt and output content only when:- a user explicitly saves Prompt Lab dataset or experiment content
- an API caller passes a content-storage opt-in such as
nanogpt_eval_store_content: true
content_suppressed_reason.
Current suppression reasons include:
Authentication
Use the same authentication as the NanoGPT API. For API callers, pass your API key in theAuthorization header:
Limits
Current experiment limits:- up to 100 eval items per dataset or inline run
- up to 5 candidates per experiment
- up to 10 scorers per experiment
- up to 100 generation and scoring work units per experiment
429 with Retry-After.
Object Shapes
Project
Dataset Version
Scorer
Experiment
Trace
Quick Start
1. Create a dataset
2. Freeze a dataset version
3. Create a scorer
4. Create an async experiment
queued or in_progress. Poll the experiment until status is terminal.
5. Poll the experiment
6. Read output items
API Reference
Projects
List projects
Create project
Get project
Update project
Delete project
Datasets
List datasets
Create dataset
evaldataset_ and contain 6 to 80 letters, numbers, underscores, or dashes after the prefix.
Get dataset
Delete dataset
Dataset Versions
List dataset versions
Create dataset version
Scorers
List scorers
Create scorer
llm_judge, prompt is required.
If both id and scorer_id are omitted, NanoGPT generates a scorer ID.
Get latest scorer
Delete scorer
Scorer Configuration
exact_match
Compares output toexpected_output.
Config:
contains
Checks whether output contains a configured value orexpected_output.
Config:
regex
Checks whether output matches a regular expression. Config:pattern is omitted, the scorer uses expected_output as the pattern.
json_schema
Parses output as JSON and validates a supported JSON-schema subset. Config:typerequiredpropertiesitemsenumminimummaximumminLengthmaxLength
threshold
Converts a value to a number and passes if it is greater than or equal to a threshold. Config:outputexpected_outputmetadata.score
llm_judge
Calls a judge model and expects JSON:0..1.
Prompt templates may reference:
{{input}}{{output}}{{expected_output}}{{context}}{{system}}{{metadata.some_key}}
pairwise_llm
Compares a challenger candidate against a baseline candidate with an LLM judge. A score of1 means the challenger is better, 0 means the baseline is better, and 0.5 means a tie.
Config:
Experiments
List experiments
Create experiment
dataset_iddataset_version_id- inline
dataoritems
dataset_id and dataset_version_id.
For inline experiments, content storage must be enabled because the experiment needs row snapshots to run asynchronously.
Candidate fields:
The endpoint returns
202 Accepted and an experiment object.
Get experiment
Cancel experiment
Rerun experiment
List experiment output items
Response:
Traces
List traces
Get trace
Dashboard
Returns aggregate metrics:
Opt-in Chat Completion Tracing
Normal/v1/chat/completions requests do not create eval traces.
To trace a normal API request, add metadata.nanogpt_eval_trace: true to the chat completion request.
Example:
NanoGPT strips only
metadata.nanogpt_eval_* keys before provider dispatch. Other metadata keys remain untouched.
If nanogpt_eval_store_content is omitted or false, the trace stores metadata, usage, cost, latency, status, and errors, but not prompt or output content.
If nanogpt_eval_store_content is true but the request does not produce output text available to the trace recorder, NanoGPT keeps the trace metadata-only and records content_suppressed_reason: "output_content_unavailable" in trace metadata.
Legacy Evaluator Endpoints
The original evaluator API remains available for compatibility.List legacy evaluators
Create legacy evaluator
eval_ and contain 6 to 80 letters, numbers, underscores, or dashes after the prefix.
Run legacy evaluator
dataset_id or inline data.
Get stored legacy run
Get stored legacy run output items
Retention
Default retention is 30 days. Trace records, stored trace content, jobs, and old experiment artifacts are cleaned up by the eval cleanup job. Projects, datasets, dataset versions, and scorers are durable until deleted.Error Responses
Validation errors return HTTP400:
404:
429:
500:
Operational Notes
The eval platform stores durable project, dataset, scorer, experiment, trace, and score records in dedicated tables, including:eval_projectseval_dataset_versionseval_scorer_versionseval_experimentseval_experiment_itemseval_traceseval_trace_scores