Run hosted model conversion and download deployable artifacts.
The target-specific helpers RVC2, RVC3, RVC4, and Hailo are the
recommended conversion API. Each helper prepares target options and delegates
to convert, which coordinates the complete HubAI workflow:
- Read model metadata from a model file, YAML config, or NN Archive.
- Create or reuse model and variant resources.
- Upload the source model as an instance.
- Start an export job and wait for it to finish.
- Download the exported instance.
Example
Convert an ONNX model for RVC4 with HubAI's general calibration data.
result = client.convert.RVC4(
path="detector.onnx",
name="detector",
quantization_mode="INT8_STANDARD",
quantization_data="GENERAL",
)
print(result.downloaded_path)- Input configuration:
- path may point to a model file, an NN Archive, or a YAML configuration. Additional opts override values loaded from that configuration. A dictionary is usually easiest in Python; the flat list form exists for the command-line interface.
- Resource reuse:
- Pass model_id or variant_id to attach the conversion to existing
resources. Without them,
convertcreates resources and reuses a model with the same slug if one already exists. - Quantization:
- RVC4 and Hailo accept a built-in calibration domain, a dataset ID beginning with aid_, or a local ZIP file. Passing a ZIP path uploads it for the export job. RVC2 and RVC3 ignore quantization inputs because those helpers expose their platform-specific precision controls instead.
| Function | convert |
Starts the online conversion process. |
| Function | |
Convert a model to Hailo format. |
| Function | RVC2 |
Convert a model to RVC2 format. |
| Function | RVC3 |
Convert a model to RVC3 format. |
| Function | RVC4 |
Convert a model to RVC4 format. |
| Function | _combine |
Merge generic options with target-prefixed conversion options. |
| Function | _export |
Starts an export job for a model instance. |
| Function | _get |
Fetch a model instance response, returning None if missing. |
| Function | _resolve |
Resolve the exported model instance from a completed export job. |
| Function | _wait |
Wait until an exported model instance is actually downloadable. |
Target, opts: list[ str] | None = None, /, *, path: str, name: str | None = None, license_type: License = 'undefined', is_public: bool | None = False, description_short: str = '<empty>', description: str | None = None, architecture_id: UUID | str | None = None, tasks: list[ Task] | None = None, links: list[ str] | None = None, is_yolo: bool = False, model_id: UUID | str | None = None, variant_version: str | None = None, variant_description: str | None = None, repository_url: str | None = None, commit_hash: str | None = None, quantization_mode: QuantizationMode | None = None, domain: str | None = None, variant_tags: list[ str] | None = None, variant_id: UUID | str | None = None, quantization_data: QuantizationData | PathType | None = None, max_quantization_images: int | None = None, instance_tags: list[ str] | None = None, input_shape: list[ int] | None = None, is_deployable: bool | None = None, output_dir: str | None = None, tool_version: str | None = None, yolo_input_shape: list[ int] | None = None, yolo_version: YoloVersion | None = None, yolo_class_names: list[ str] | None = None) -> ConvertResponse:
¶
Starts the online conversion process.
| Parameters | |
target:Target | Target platform. |
opts:list[ | Additional options for the conversion process. |
path:str | Path to the model file, NN Archive, or configuration file. |
name:str | None | Model name. If not specified, the name is taken from the configuration file or the model file. |
licenseLicense | License type. |
isbool | None | Whether the model is public (True), private (False), or team-scoped (None). |
descriptionstr | Short description of the model. |
description:str | None | Full description of the model. |
architectureUUID | str | None | Architecture ID. |
tasks:list[ | Tasks this model supports. |
links:list[ | Links to related resources. |
isbool | Whether the model is a YOLO model. |
modelUUID | str | None | ID of an existing model resource. If specified, that model is used instead of creating a new one. |
variantstr | None | Model version. If not specified, the version is auto-incremented from the latest version of the model. If no versions exist, the version is "0.1.0". |
variantstr | None | Full description of the model variant. |
repositorystr | None | URL of the repository. |
commitstr | None | Commit hash. |
quantizationQuantizationMode | None | Quantization mode to use during conversion. Must be one of INT8_STANDARD, INT8_ACCURACY_FOCUSED, INT8_INT16_MIXED, INT8_INT16_MIXED_ACCURACY_FOCUSED, or FP16_STANDARD. INT8_STANDARD is standard INT8 quantization with calibration for optimal performance and model size. INT8_ACCURACY_FOCUSED is INT8 quantization with calibration that may improve accuracy without reducing performance or increasing model size, depending on the model. INT8_INT16_MIXED uses 8-bit weights and 16-bit activations across all layers for improved numeric stability and accuracy at the cost of performance and model size. INT8_INT16_MIXED_ACCURACY_FOCUSED is a mixed INT8 and INT16 calibration-based mode that prioritizes accuracy over throughput. FP16_STANDARD is FP16 quantization without calibration for models that require higher accuracy and numeric stability at the cost of performance and model size. |
domain:str | None | Domain of the model. |
variantlist[ | Tags for the model variant. |
variantUUID | str | None | ID of an existing model version resource. If specified, that version is used instead of creating a new one. |
quantizationQuantizationData | PathType | None | Data used to quantize this model. This can be a predefined domain (DRIVING, FOOD, GENERAL, INDOORS, RANDOM, WAREHOUSE, CLIP, UNKNOWN), a dataset ID, or a path to a local quantization .zip file. Pass the .zip path itself instead of CUSTOM; the SDK normalizes local zip inputs automatically. |
maxint | None | Maximum number of quantization images. |
instancelist[ | Tags for the model instance. |
inputlist[ | Input shape for the model instance. |
isbool | None | Whether the model instance is deployable. |
outputstr | None | Directory path for the downloaded files. If not specified, the downloader creates a directory named after the exported instance slug under the current working directory. |
toolstr | None | Version of the tool used for conversion. For RVC2 and RVC3 this is the IR version, while for RVC4 this is the SNPE version. |
yololist[ | Input shape for YOLO models. |
yoloYoloVersion | None | YOLO version. |
yololist[ | Class names for YOLO models. |
| Returns | |
ConvertResponse | Conversion result containing the downloaded output path, export job, and exported model instance. |
PathType, optimization_level: Literal[ -100, 0, 1, 2, 3, 4] = 2, compression_level: Literal[ 0, 1, 2, 3, 4, 5] = 2, batch_size: int = 8, alls: list[ str] | None = None, opts: Kwargs | list[ str] | None = None, **hub_kwargs) -> ConvertResponse:
¶
Convert a model to Hailo format.
| Parameters | |
path:PathType | Path to the model file to convert. |
optimizationLiteral[ | Optimization level for the conversion. |
compressionLiteral[ | Compression level for the conversion. |
batchint | Batch size for the conversion. |
alls:list[ | Hailo ALLS commands applied during conversion. |
opts:Kwargs | list[ | Additional conversion options. These can override config values. |
| name | Model name. If not specified, the name is taken from the configuration file or the model file. |
| license | License type. |
| is | Whether the model is public (True), private (False), or team-scoped (None). |
| description | Short description of the model. |
| description | Full description of the model. |
| architecture | Architecture ID. |
| tasks | Tasks this model supports. |
| links | Links to related resources. |
| is | Whether the model is a YOLO model. |
| model | ID of an existing model resource. If specified, that model is used instead of creating a new one. |
| variant | Model version. If not specified, the version is auto-incremented from the latest version of the model. If no versions exist, the version is "0.1.0". |
| variant | Full description of the model variant. |
| repository | URL of the repository. |
| commit | Commit hash. |
| quantization | Quantization mode. |
| quantization | Data used to quantize this model. This can be a predefined domain (DRIVING, FOOD, GENERAL, INDOORS, RANDOM, WAREHOUSE, CLIP, UNKNOWN), a dataset ID, or a path to a local quantization .zip file. |
| max | Maximum number of quantization images. |
| domain | Domain of the model. |
| variant | Tags for the model variant. |
| variant | ID of an existing model version resource. If specified, that version is used instead of creating a new one. |
| input | Input shape for the model instance. |
| is | Whether the model instance is deployable. |
| output | Directory path for the downloaded files. If not specified, the downloader creates a directory named after the exported instance slug under the current working directory. |
| tool | Version of the tool used for conversion. For RVC2 and RVC3 this is the IR version, while for RVC4 this is the SNPE version. |
| yolo | Input shape for YOLO models. |
| yolo | YOLO version. |
| yolo | Class names for YOLO models. |
| **hub | Additional keyword arguments passed to convert. |
| Returns | |
ConvertResponse | Conversion result containing the downloaded output path, export job, and exported model instance. |
PathType, mo_args: list[ str] | None = None, compile_tool_args: list[ str] | None = None, compress_to_fp16: bool = True, number_of_shaves: int = 8, superblob: bool = True, opts: Kwargs | list[ str] | None = None, **hub_kwargs) -> ConvertResponse:
¶
Convert a model to RVC2 format.
| Parameters | |
path:PathType | Path to the model file to convert. |
molist[ | Additional arguments for the Model Optimizer. |
compilelist[ | Additional arguments for the compile tool. |
compressbool | Whether to compress the model weights to FP16. |
numberint | Number of shaves to use for the conversion. |
superblob:bool | Whether to create a superblob for the model. |
opts:Kwargs | list[ | Additional conversion options. These can override config values. |
| name | Model name. If not specified, the name is taken from the configuration file or the model file. |
| license | License type. |
| is | Whether the model is public (True), private (False), or team-scoped (None). |
| description | Short description of the model. |
| description | Full description of the model. |
| architecture | Architecture ID. |
| tasks | Tasks this model supports. |
| links | Links to related resources. |
| is | Whether the model is a YOLO model. |
| model | ID of an existing model resource. If specified, that model is used instead of creating a new one. |
| variant | Model version. If not specified, the version is auto-incremented from the latest version of the model. If no versions exist, the version is "0.1.0". |
| variant | Full description of the model variant. |
| repository | URL of the repository. |
| commit | Commit hash. |
| domain | Domain of the model. |
| variant | Tags for the model variant. |
| variant | ID of an existing model version resource. If specified, that version is used instead of creating a new one. |
| input | Input shape for the model instance. |
| is | Whether the model instance is deployable. |
| output | Directory path for the downloaded files. If not specified, the downloader creates a directory named after the exported instance slug under the current working directory. |
| tool | Version of the tool used for conversion. For RVC2 and RVC3 this is the IR version, while for RVC4 this is the SNPE version. |
| yolo | Input shape for YOLO models. |
| yolo | YOLO version. |
| yolo | Class names for YOLO models. |
| **hub | Additional keyword arguments passed to convert. |
| Returns | |
ConvertResponse | Conversion result containing the downloaded output path, export job, and exported model instance. |
PathType, mo_args: list[ str] | None = None, compile_tool_args: list[ str] | None = None, compress_to_fp16: bool = True, pot_target_device: PotDevice | Literal[ 'VPU', 'ANY'] = PotDevice.VPU, opts: Kwargs | list[ str] | None = None, **hub_kwargs) -> ConvertResponse:
¶
Convert a model to RVC3 format.
| Parameters | |
path:PathType | Path to the model file to convert. |
molist[ | Additional arguments for the Model Optimizer. |
compilelist[ | Additional arguments for the compile tool. |
compressbool | Whether to compress the model weights to FP16. |
potPotDevice | Literal[ | Target device for POT quantization. |
opts:Kwargs | list[ | Additional conversion options. These can override config values. |
| name | Model name. If not specified, the name is taken from the configuration file or the model file. |
| license | License type. |
| is | Whether the model is public (True), private (False), or team-scoped (None). |
| description | Short description of the model. |
| description | Full description of the model. |
| architecture | Architecture ID. |
| tasks | Tasks this model supports. |
| links | Links to related resources. |
| is | Whether the model is a YOLO model. |
| model | ID of an existing model resource. If specified, that model is used instead of creating a new one. |
| variant | Model version. If not specified, the version is auto-incremented from the latest version of the model. If no versions exist, the version is "0.1.0". |
| variant | Full description of the model variant. |
| repository | URL of the repository. |
| commit | Commit hash. |
| domain | Domain of the model. |
| variant | Tags for the model variant. |
| variant | ID of an existing model version resource. If specified, that version is used instead of creating a new one. |
| input | Input shape for the model instance. |
| is | Whether the model instance is deployable. |
| output | Directory path for the downloaded files. If not specified, the downloader creates a directory named after the exported instance slug under the current working directory. |
| tool | Version of the tool used for conversion. For RVC2 and RVC3 this is the IR version, while for RVC4 this is the SNPE version. |
| yolo | Input shape for YOLO models. |
| yolo | YOLO version. |
| yolo | Class names for YOLO models. |
| **hub | Additional keyword arguments passed to convert. |
| Returns | |
ConvertResponse | Conversion result containing the downloaded output path, export job, and exported model instance. |
PathType, snpe_onnx_to_dlc_args: list[ str] | None = None, snpe_dlc_quant_args: list[ str] | None = None, snpe_dlc_graph_prepare_args: list[ str] | None = None, use_per_channel_quantization: bool = True, use_per_row_quantization: bool = False, htp_socs: list[ Literal[ 'sm8350', 'sm8450', 'sm8550', 'sm8650', 'qcs6490', 'qcs8550']] | None = None, opts: Kwargs | list[ str] | None = None, **hub_kwargs) -> ConvertResponse:
¶
Convert a model to RVC4 format.
| Parameters | |
path:PathType | Path to the model file to convert. |
snpelist[ | Additional arguments for the SNPE ONNX to DLC conversion. |
snpelist[ | Additional arguments for SNPE DLC quantization. |
snpelist[ | Additional arguments for SNPE DLC graph preparation. |
usebool | Whether to use per-channel quantization. |
usebool | Whether to use per-row quantization. |
htplist[ | HTP SoCs for the final DLC graph. |
opts:Kwargs | list[ | Additional conversion options. These can override config values. |
| name | Model name. If not specified, the name is taken from the configuration file or the model file. |
| license | License type. |
| is | Whether the model is public (True), private (False), or team-scoped (None). |
| description | Short description of the model. |
| description | Full description of the model. |
| architecture | Architecture ID. |
| tasks | Tasks this model supports. |
| links | Links to related resources. |
| is | Whether the model is a YOLO model. |
| model | ID of an existing model resource. If specified, that model is used instead of creating a new one. |
| variant | Model version. If not specified, the version is auto-incremented from the latest version of the model. If no versions exist, the version is "0.1.0". |
| variant | Full description of the model variant. |
| repository | URL of the repository. |
| commit | Commit hash. |
| quantization | Quantization mode to use during conversion. Must be one of INT8_STANDARD, INT8_ACCURACY_FOCUSED, INT8_INT16_MIXED, INT8_INT16_MIXED_ACCURACY_FOCUSED, or FP16_STANDARD. INT8_STANDARD is standard INT8 quantization with calibration for optimal performance and model size. INT8_ACCURACY_FOCUSED is INT8 quantization with calibration that may improve accuracy without reducing performance or increasing model size, depending on the model. INT8_INT16_MIXED uses 8-bit weights and 16-bit activations across all layers for improved numeric stability and accuracy at the cost of performance and model size. INT8_INT16_MIXED_ACCURACY_FOCUSED is a mixed INT8 and INT16 calibration-based mode that prioritizes accuracy over throughput. FP16_STANDARD is FP16 quantization without calibration for models that require higher accuracy and numeric stability at the cost of performance and model size. |
| domain | Domain of the model. |
| variant | Tags for the model variant. |
| variant | ID of an existing model version resource. If specified, that version is used instead of creating a new one. |
| quantization | Data used to quantize this model. This can be a predefined domain (DRIVING, FOOD, GENERAL, INDOORS, RANDOM, WAREHOUSE, CLIP, UNKNOWN), a dataset ID, or a path to a local quantization .zip file. Pass the .zip path itself instead of CUSTOM; the SDK normalizes local zip inputs automatically. |
| max | Maximum number of quantization images. |
| input | Input shape for the model instance. |
| is | Whether the model instance is deployable. |
| output | Directory path for the downloaded files. If not specified, the downloader creates a directory named after the exported instance slug under the current working directory. |
| tool | Version of the tool used for conversion. For RVC2 and RVC3 this is the IR version, while for RVC4 this is the SNPE version. |
| yolo | Input shape for YOLO models. |
| yolo | YOLO version. |
| yolo | Class names for YOLO models. |
| **hub | Additional keyword arguments passed to convert. |
| Returns | |
ConvertResponse | Conversion result containing the downloaded output path, export job, and exported model instance. |
Target, target_kwargs: Kwargs, opts: list[ str] | Kwargs | None) -> list[ str]:
¶
Merge generic options with target-prefixed conversion options.
| Returns | |
list[ | A flat option list ready for config parsing. |
str, identifier: UUID | str, target: Target, quantization_mode: QuantizationMode | None, quantization_data: str | None, max_quantization_images: int | None = None, yolo_version: str | None = None, yolo_class_names: list[ str] | None = None, **kwargs) -> JobMessageResponse:
¶
Starts an export job for a model instance.
| Returns | |
JobMessageResponse | The created export job response. |
Fetch a model instance response, returning None if missing.
| Returns | |
ModelInstanceResponse | None | The model instance response, or None if the instance does not exist yet. |
Resolve the exported model instance from a completed export job.
| Returns | |
ModelInstanceResponse | The exported model instance once it is ready to download. |
str, *, timeout_seconds: int = 180, poll_interval_seconds: int = 2) -> ModelInstanceResponse:
¶
Wait until an exported model instance is actually downloadable.
| Returns | |
ModelInstanceResponse | The exported model instance once it becomes downloadable. |