Skip to main content
Every vision model follows the same path: export to ONNX (if needed), quantize on the platform, monitor the job, download the result, validate locally.
The R3AL.AI SDK is model-agnostic. Classification, detection, segmentation, pose, custom architectures: if you can export it to ONNX, you can quantize it with the same API. Quantization runs on the platform; export and validation run locally.

0. Authenticate

See Using the platform for creating an account and API key.

1. Export to ONNX (if needed)

If you already have .onnx, skip to step 2. Otherwise, pass the checkpoint straight to quantize() and the SDK exports it locally before upload (local export needs the matching extra, for example r3alai[export-torch]):
Supported export sources: onnx (passthrough), pytorch, ultralytics, tensorflow, tflite, paddle. Discover them with r3alai.quant.list_export_sources().

2. Choose PTQ or QAT

See Quantization methods for the full decision guide.

3. Quantize via the platform (PTQ)

Each call uploads your model, runs the job on R3AL GPUs, streams progress, and downloads the bundle.
If the model needs a special preprocessing step to convert images to input tensors, please handle the preprocessing step yourself. By default, standard preprocessing is applied. See Calibration.

4. Or train with QAT

When PTQ loses too much accuracy (especially at low bit widths):
See QAT explained.

5. Monitor the job

quantize() and train_qat() block and print live progress. You can also open the platform’s Jobs page to watch status and progress, and to review past runs. See Using the platform.

6. Validate locally before shipping

Latency matters on your deployment hardware, so validation runs locally:
See Benchmarking for fidelity checks and how to read the numbers.

7. Check the deliverable

The manifest records the exact config used. See Output & manifest.

Next steps

Using the platform

Accounts, API keys, the Jobs page, and your plan.

Quantization methods

Dynamic vs static INT8 or INT4, and when to use QAT.

Calibration

Building a good image set for ptq_static and QAT.

Python SDK

The Quantizer facade, PlatformClient, and Job.