Skip to main content

🚀 What is inference-models?

inference-models is the library to make predictions from computer vision models provided by Roboflow — designed to be fast, reliable, and user-friendly. It offers:

  • Multi-Backend Support: Run models with PyTorch, ONNX, TensorRT, or Hugging Face backends
  • Automatic Model Loading: Smart model resolution and backend selection
  • Minimal Dependencies: Composable extras system for installing only what you need
  • Behavior-Based Interfaces: Models with similar behavior share consistent APIs; custom models can define their own
  • Full Roboflow Platform Support: Run any model trained on Roboflow

Visit our documentation for more information.

🛣️ Roadmap

With release 0.19.0, we have reached the first stable release of inference-models and fully integrated the package to inference - our main inference package, making it selectable backend for running predictions from models.

We are still making changes to add new features and models. API should be fairly stable already, but the problems may still occur. If you encounter any issues, please report them.

💻 Installation

CPU installation:

uv pip install inference-models
# or with pip
pip install inference-models

inference-models can be installed with CUDA and TensorRT support - see Installation Guide for more options.

🏃‍➡️ Usage

Pretrained Models

Load and run a pretrained model:

import cv2
import supervision as sv
from inference_models import AutoModel

# Load pretrained model from Roboflow
model = AutoModel.from_pretrained("rfdetr-base")

# Run inference (works with numpy arrays or torch.Tensor)
image = cv2.imread("<path-to-your-image>")
predictions = model(image)

# Use with supervision
annotator = sv.BoxAnnotator()
annotated = annotator.annotate(image, predictions[0].to_supervision())

Your Roboflow Models

Load and run models trained on the Roboflow platform:

import cv2
import supervision as sv
from inference_models import AutoModel

# Load your custom model from Roboflow
model = AutoModel.from_pretrained(
    "<your-project>/<version>",
    api_key="<your-api-key>"  # model access secured with API key
)

# Run inference (works with numpy arrays or torch.Tensor)
image = cv2.imread("<path-to-your-image>")
predictions = model(image)

# Use with supervision
annotator = sv.BoxAnnotator()
annotated = annotator.annotate(image, predictions[0].to_supervision())

🧠 Supported Model Architectures

  • RFDetr
  • SAM models family
  • Vision-Language Models (Florence, PaliGemma, Qwen, SmolVLM, Moondream)
  • OCR (DocTR, EasyOCR, TrOCR)
  • YOLO
  • and many more

For detailed model documentation, see Supported Models.

🔧 Run your local models

Load your own model implementations from a local directory - models with architectures not in the main inference-models package. This is especially valuable for production deployment of custom models.

from inference_models import AutoModel

model = AutoModel.from_pretrained(
    "/path/to/my_custom_model",
    allow_local_code_packages=True
)

See Load Models from Local Packages for complete details on creating custom model packages.

📄 License

The inference-models package is licensed under Apache 2.0. Individual models may have different licenses - see the Supported Models for details.


Ready to get started? Head to the Quick Overview

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

inference_models-0.31.0.tar.gz (1.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

inference_models-0.31.0-py3-none-any.whl (2.0 MB view details)

Uploaded Python 3

File details

Details for the file inference_models-0.31.0.tar.gz.

File metadata

  • Download URL: inference_models-0.31.0.tar.gz
  • Upload date:
  • Size: 1.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for inference_models-0.31.0.tar.gz
Algorithm Hash digest
SHA256 9ca3d2d3c6d011b445626e3cf8e154ff06a855fd9d41b1c4cefd9b2a2928e16d
MD5 82086b5e5ad7567ec0745def9ae31ba8
BLAKE2b-256 3e57648465c7292a3b6407509b3495512ed2b3c24658e272634bfa293675fc1a

See more details on using hashes here.

Provenance

The following attestation bundles were made for inference_models-0.31.0.tar.gz:

Publisher: publish.pypi.inference_exp.yml on roboflow/inference

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file inference_models-0.31.0-py3-none-any.whl.

File metadata

File hashes

Hashes for inference_models-0.31.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9a0559830196d76e512fe61b84b3bee2dff3e72be1a92e7675ee8cb09ae7bc09
MD5 42f5adc93d922801bf046dcbc48f7e7c
BLAKE2b-256 02502d7cb610131f187959ce206dc3bbe25e0e3fd0a4a0bbefd3fb1d4ed48986

See more details on using hashes here.

Provenance

The following attestation bundles were made for inference_models-0.31.0-py3-none-any.whl:

Publisher: publish.pypi.inference_exp.yml on roboflow/inference

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page