Skip to main content
Quantization jobs run on R3AL GPU infrastructure. The flow is always: upload the model, submit the job (which returns a job_id), poll the job, then download its artifacts.

Upload a model

Models are uploaded to R2 with a presigned PUT. Ask for a grant, then PUT the file bytes to the returned URL.
PUT the file to upload_url, then reference it in a job as r2://<object_key>. Single uploads are limited to 5 GB. Calibration images are uploaded the same way.

Submit a job

Jobs accept r2://<key> model references and always return 202 with a job_id.
Both quantize and qat are asynchronous: they return a job_id immediately, since a run can take longer than an HTTP client’s timeout. Poll the job for progress and the result.

Poll a job

status moves through pending, running, then a terminal completed or error. On completed, result carries the deliverable metadata; on error, an error object with a code and message.

Download artifacts

Once a job is completed, request presigned download URLs for its artifacts.
Download each url (presigned GET). The bundle contains the quantized ONNX model and r3alai_manifest.json.

Delete a job

Removes the job and its artifacts. 404 if the id does not exist.

Usage and plan

Returns your plan and remaining free runs. Each quantize or qat job consumes one run; a run beyond your quota fails with 402 plan_limit_reached (see Errors).

Method field

method applies to POST /v1/quantize only:
  • ptq_static (default): requires calibration_data (a list of uploaded image refs).
  • ptq_dynamic: no calibration data needed; it quantizes MatMul and Gemm layers, so it suits MatMul-heavy models rather than convolution-heavy backbones.
QAT settings (wbit, abit, epochs) go on POST /v1/qat. See the Python SDK for the field-level reference; only the transport differs.