The Roboflow Inference Python SDK provides a simple interface to deploy and interact with computer vision models from Roboflow. It enables users to perform tasks like object detection, classification, and segmentation locally or via the Roboflow API, abstracting away complex machine learning and deployment details. The current version is 1.2.2, with frequent patch and minor releases.
pip install inference-sdkVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize the Inference HTTP client, set your API key (preferably via environment variable), and perform object detection inference on an image from a URL using a specified Roboflow model ID.
Review your application's inference performance and behavior after updating. If issues arise, consult the documentation for opting out of `inference-models` or adapting your model usage.
Upgrade your Python environment to 3.10, 3.11, or 3.12 to ensure full compatibility and receive future updates.
Install PyTorch and torchvision with CUDA support *before* installing `inference-gpu`. Example: `pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121` (replace `cu121` with your CUDA version), then `pip install inference-gpu`.
Install PyTorch and torchvision with the correct CUDA version for your system: `pip install torch torchvision --index-url https://download.pytorch.org/whl/cuXX` (replace `cuXX` with your CUDA version, e.g., `cu121`), then `pip install inference-gpu`.
Double-check your `model_id` for typos, ensure your `ROBOFLOW_API_KEY` is correct and has access to the model, and verify that your inference environment meets the model's requirements (e.g., sufficient RAM, GPU memory).
Ensure you are accessing results using the documented properties (e.g., `result.predictions`). Consult the official documentation for the response object structure for your `inference-sdk` version. If using an older `inference-sdk` version, upgrade to the latest stable release.