Skip to main content

HTTP API

The server is a FastAPI application; llmclick serve starts it, Swagger lives at /docs. All routes under /api take Authorization: Bearer <API_TOKEN> when that setting is configured. Errors are {"detail": "..."} with 401 (no or wrong token), 403 (a path outside API_PATHS), 404 (missing config, job or report), 409 (cancelling a finished job) or 422 (a request or config that does not fit the schema).

GET /health​

Liveness check

Open without a token, for the container healthcheck.

StatusMeaning
200Successful Response

POST /api/config/load​

Check a config file on the server

The experiment key and stage plan of a YAML under API_PATHS. Nothing runs or is written.

ParameterInRequiredDescription
config_pathqueryyesYAML path on the server, relative to its working directory
authorizationheadernoBearer <API_TOKEN>; needed only when the server sets API_TOKEN
StatusMeaning
200Successful Response
422Validation Error

POST /api/config/validate​

Check an inline config

The same check as /load for a config sent in the body, in the shape of the YAML.

ParameterInRequiredDescription
authorizationheadernoBearer <API_TOKEN>; needed only when the server sets API_TOKEN

Request body: Config

StatusMeaning
200Successful Response
422Validation Error

POST /api/jobs​

Run a config in the background

Submitting the same config again while it runs returns the same job; after it ends, the run continues from the stages already built.

ParameterInRequiredDescription
authorizationheadernoBearer <API_TOKEN>; needed only when the server sets API_TOKEN

Request body: JobRequest

StatusMeaning
202Successful Response
422Validation Error

GET /api/jobs​

List jobs

Newest first.

ParameterInRequiredDescription
statusquerynoOnly jobs in this status
limitquerynoOnly the most recent jobs
authorizationheadernoBearer <API_TOKEN>; needed only when the server sets API_TOKEN
StatusMeaning
200Successful Response
422Validation Error

GET /api/jobs/{job_id}​

Get a job's status and progress

ParameterInRequiredDescription
job_idpathyesThe job_id a run request returned
authorizationheadernoBearer <API_TOKEN>; needed only when the server sets API_TOKEN
StatusMeaning
200Successful Response
422Validation Error

DELETE /api/jobs/{job_id}​

Cancel a pending or running job

The job stops at its next progress report and is then cancelled; poll it to see that. What its stages built so far stays, so submitting the same config again continues from there. 409 for a finished job.

ParameterInRequiredDescription
job_idpathyesThe job_id a run request returned
authorizationheadernoBearer <API_TOKEN>; needed only when the server sets API_TOKEN
StatusMeaning
202Successful Response
422Validation Error

GET /api/evaluations​

List evaluation reports

Every report the evaluation recipes wrote under the output directory, with its headline scores.

ParameterInRequiredDescription
output_dirquerynoWhere the experiments are
recipequerynoOnly this evaluation recipe
experimentquerynoOnly evaluations of this modeling experiment (directory)
authorizationheadernoBearer <API_TOKEN>; needed only when the server sets API_TOKEN
StatusMeaning
200Successful Response
422Validation Error

GET /api/evaluations/{experiment}​

Get one evaluation report in full

ParameterInRequiredDescription
experimentpathyesThe evaluation experiment's key, as the list shows it
output_dirquerynoWhere the experiments are
authorizationheadernoBearer <API_TOKEN>; needed only when the server sets API_TOKEN
StatusMeaning
200Successful Response
422Validation Error

GET /api/system/recipes​

List the recipes

Per recipe: its stages and the keys its registries accept (sources, teachers, ...).

ParameterInRequiredDescription
authorizationheadernoBearer <API_TOKEN>; needed only when the server sets API_TOKEN
StatusMeaning
200Successful Response
422Validation Error

Schemas​

ConfigSummary​

FieldTypeDefaultDescription
validbooleanTrueAlways true here: an invalid config is a 422 instead
recipestringrequiredThe recipe the config names (pipeline.recipe)
experimentstringrequiredExperiment key: the config's name and a hash of what decides its result
directorystringrequiredWhere the experiment's files go
stageslist[string]requiredStages a run would execute or reuse, in order
configobject (extra keys allowed)requiredThe config with every default filled in

EvaluationSummary​

FieldTypeDefaultDescription
experimentstringrequiredThe evaluation experiment's key
recipestringrequiredThe evaluation recipe that wrote the report
directorystringrequiredThe evaluation experiment's directory
reportstringrequiredPath of report.json
modelobject (extra keys allowed)requiredThe evaluated model (experiment, checkpoint, recipe), or the runs of a comparison
scoresobject (extra keys allowed)requiredThe headline numbers; the report holds everything
contaminationobject (extra keys allowed) | null

JobRequest​

FieldTypeDefaultDescription
config_pathstring | nullYAML path on the server, relative to the working directory
configobject (extra keys allowed) | nullInline config with the same shape as the YAML

JobResponse​

FieldTypeDefaultDescription
job_idstringrequiredThe experiment key plus a hash of the stages run: the same request gives the same job
statusstringrequiredpending, running, done, failed, cancelled or interrupted
recipestringrequiredThe recipe the config names
experimentstringrequiredExperiment key
directorystringrequiredWhere the experiment's files go
stageslist[string]requiredStages this job runs or reuses, in order
progressobject (extra keys allowed)requiredThe running stage and how far it is
device_slotinteger | nullWhich worker, and so which accelerator, ran the job
resultobject (extra keys allowed) | nullEvery stage's outputs, once the job is done
errorstring | nullWhy the job failed