Skip to main content

OpenVINO Model API

PyPI Downloads

Pre-Merge Test Build Docs

License OpenSSF Scorecard

Introduction

Model API is a set of wrapper classes for particular tasks and model architectures, simplifying data preprocess and postprocess as well as routine procedures (model loading, asynchronous execution, etc.). It is aimed at simplifying end-to-end model inference for different deployment scenarios, including local execution and serving. The Model API is based on the OpenVINO inference API.

How it works

Model API searches for additional information required for model inference, data, pre/postprocessing, label names, etc. directly in OpenVINO Intermediate Representation. This information is used to prepare the inference data, process and output the inference results in a human-readable format.

Currently, ModelAPI supports models trained in OpenVINO Training Extensions framework. Training Extensions embed all the metadata required for inference into model file. For models coming from other than Training Extensions frameworks metadata generation step is required before using ModelAPI.

Supported model formats

Features

  • Python API
  • Synchronous and asynchronous inference
  • Local inference and serving through the REST API
  • Model preprocessing embedding for faster inference

Installation

pip install openvino-model-api

Repository layout

This repository contains two independently installable Python subprojects:

  • model_api/ — the inference library published as openvino-model-api with a minimal runtime dependency set.
  • model_converter/ — conversion tooling published as openvino-model-converter, with conversion-time dependencies such as PyTorch, TorchVision, OpenVINO, ONNX, and NNCF.

Each subproject owns its own pyproject.toml and uv.lock. Shared repository files, including this README.md, LICENSE, CONTRIBUTING.md, SECURITY.md, and CI workflows, remain at the repository root.

Usage

from model_api.models import Model

# Create a model wrapper from a compatible model generated by OpenVINO Training Extensions
# To work with an OVMS-served model, pass its endpoint instead of a file path, e.g. "localhost:8000/v2/models/ssdlite_mobilenet_v2"
model = Model.create_model("model.xml")

# Run synchronous inference locally
result = model(image)  # image is numpy.ndarray

# Print results in model-specific format
print(f"Inference result: {result}")

Prepare a model for InferenceAdapter

There are usecases when it is not possible to modify an internal ov::Model and it is hidden behind InferenceAdapter. For example the model can be served using OVMS. create_model() can construct a model from a given InferenceAdapter. That approach assumes that the model in InferenceAdapter was already configured by create_model() called with a string (a path or a model name). It is possible to prepare such model:

model = DetectionModel.create_model("~/.cache/omz/public/ssdlite_mobilenet_v2/FP16/ssdlite_mobilenet_v2.xml")
model.save("serialized.xml")

Usage with generic OpenVINO models

ModelAPI uses custom field in rt_info/model_info section of OpenVINO IR to store metadata required for preprocessing and postprocessing. If you have a generic OpenVINO model without such metadata, you can provide that metadata in configuration argument of create_model() method:

from model_api.models import Model

# Create a model wrapper from a compatible model generated by OpenVINO Training Extensions
model = Model.create_model(
    "model.xml",
    configuration={
        "model_type": "Segmentation",
        "blur_strength": 1,
        "labels": ["object"],
        "soft_threshold": 0.5,
    }
)

# Run synchronous inference locally
result = model(image)  # image is numpy.ndarray

# Print results in model-specific format
print(f"Inference result: {result}")

# Save the model with metadata already embedded (passing configuration is not required anymore)
model.save("serialized_with_metadata.xml")

For more details please refer to the examples of this project.

Metadata

Release files for openvino-model-api 0.4.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for openvino-model-api 0.4.8
File Size Uploaded Provenance Actions
openvino_model_api-0.4.8.tar.gz 620.7 kB With provenance Details for openvino_model_api-0.4.8.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for openvino-model-api 0.4.8
File Interpreter ABI Platform Actions
openvino_model_api-0.4.8-py3-none-any.whl Python 3 none any Details for openvino_model_api-0.4.8-py3-none-any.whl

Total release size: 766.6 kB

Release files / openvino_model_api-0.4.8.tar.gz

Download URL openvino_model_api-0.4.8.tar.gz
Size 620.7 kB
Tags Source
SHA-256 checksum
How to use checksums
461c7007cd4f58697e0193aee3ccc9f94d76159801a4caee677036a1332d548e
BLAKE2b-256 checksum
How to use checksums
2ee9413574456ebf3e4788eacc87892a90e61e85c4e7fdf3a78236f2473fc176
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Release files / openvino_model_api-0.4.8-py3-none-any.whl

Download URL openvino_model_api-0.4.8-py3-none-any.whl
Size 145.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d34ce8d882b2b952bba40d7299555bbee08d1a753666958429457cfcc62cee7a
BLAKE2b-256 checksum
How to use checksums
1b0ccf5e8ca60fda4f97c5baa6483d66f61a1232e0eb199737219a97e85e14ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Security for openvino-model-api 0.4.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for openvino_model_api-0.4.8.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4.8 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page