# AI Hub
Source: [https://docs.qualcomm.com/doc/80-70015-15B/topic/ai-hub.html](https://docs.qualcomm.com/doc/80-70015-15B/topic/ai-hub.html)
For quick prototyping of models on Qualcomm AI hardware, AI Hub provides a way to
optimize, validate, and deploy machine learning models on-device for vision, audio, and
speech use cases
Refer to the [AI Hub](https://app.aihub.qualcomm.com/docs/hub/getting_started.html#installation) documentation on setup and getting
started.
## Setup
1. Setup your Python environment.
Install [miniconda](https://docs.conda.io/projects/miniconda/en/latest/miniconda-install.html) on your
machine.
**Windows:** When the installation finishes, open
Anaconda prompt from the Start menu.
**macOS/Linux:** When the
installation finishes, open a new shell window.
Set up a Python
virtual environment for Qualcomm^®^ AI
Hub:
source /miniconda3/bin/activate
conda create python=3.8 -n qai_hub
conda activate qai_hubCopy to clipboard
2. Install the AI Hub Python client.
pip3 install qai-hub
pip3 install "qai-hub[torch]"Copy to clipboard
3. Sign into AI Hub.
Go to [AI Hub](https://aihub.qualcomm.com/) and sign in with your
Qualcomm ID to view information about jobs you create.
Once signed in,
navigate to *Account > Settings > API Token*. This should provide an
API token that you can use to configure your client.
4. Configure the client with your API token using the following command in your
terminal.
qai-hub configure --api_token Copy to clipboard
## AI Hub workflow
**Try a preoptimized model.**
1. Navigate to [AI Hub Model Zoo](https://aihub.qualcomm.com/iot/models) to access
preoptimized models available for Qualcomm Linux Development Kits.
2. Filter models available for RB3Gen2 by selecting *Qualcomm QCS6490*
as the chipset in the left-pane.
3. Select a model from the filtered view to navigate to the model page.
4. On the model page, select *Qualcomm QCS6490* from the drop-down
list and choose *TorchScript > TFLite* path.
5. Click on download to begin model download. The downloaded model is already preoptimized
and ready for [deployment](https://docs.qualcomm.com/doc/80-70015-15B/topic/develop-own-app.html).

**Bring your own model**
1. Select a pretrained model in PyTorch or Onnx format.
2. Submit a model for compilation or optimization to AI Hub using python
APIs.
When submitting a compilation job, you must select a device or chipset
and the target runtime to compile the model. For RB3Gen2, the TFLite runtime
is supported.
| Chipset | Runtime | CPU | GPU | HTP |
| --- | --- | --- | --- | --- |
| QCS6490 | TFLite | INT8,FP16, FP32 | FP16,FP32 | INT8,INT16 |
On submission, AI Hub generates a unique ID for the job. You can use this job ID to view job details.
3. AI Hub optimizes the model based your device and runtime selections.
- Optionally, you can submit a job to profile or inference the optimized
model (using Python APIs) on a real device provisioned from a device
farm.
- Profiling: Benchmarks the model on a provisioned device and
provides statistics, including average inference times at the
layer level, runtime configuration, etc.
- Inference: Performs inference using an optimized model on data
submitted as part of the inference job by running the model on a
provisioned device.
4. Each submitted job will be available for review in the AI Hub portal. A
submitted compilation job will provide a downloadable link to the optimized
model. This optimized model can then be deployed on a local development device
like RB3Gen2.
The following is an example of the described workflow taken from the [AI Hub documentation](https://aihub.qualcomm.com/iot/models). In this example, a MobileNet V2
pretrained model from PyTorch is uploaded to AI Hub and compiled to an optimized
TFLite model to run on an RB3Gen2 target.
import qai_hub as hub
import torch
from torchvision.models import mobilenet_v2
import numpy as np
# Using pre-trained MobileNet
torch_model = mobilenet_v2(pretrained=True)
torch_model.eval()
# Trace model (for on-device deployment)
input_shape = (1, 3, 224, 224)
example_input = torch.rand(input_shape)
traced_torch_model = torch.jit.trace(torch_model, example_input)
# Compile and optimize the model for a specific device
compile_job = hub.submit_compile_job(
model=traced_torch_model,
device=hub.Device("QCS6490 (Proxy)"),
input_specs=dict(image=input_shape),
#compile_options="--target_runtime tflite",
)
# Profiling Job
profile_job = hub.submit_profile_job(
model=compile_job.get_target_model(),
device=hub.Device("QCS6490 (Proxy)"),
)
sample = np.random.random((1, 3, 224, 224)).astype(np.float32)
# Inference Job
inference_job = hub.submit_inference_job(
model=compile_job.get_target_model(),
device=hub.Device("QCS6490 (Proxy)"),
inputs=dict(image=[sample]),
)
# Download model
compile_job.download_target_model(filename="/tmp/mobilenetv2.tflite")Copy to clipboard
Note: To deactivate a previously activated qai\_hub environment use the following command.
conda deactivateCopy to clipboard
Once the model is downloaded, it is ready for [deployment](https://docs.qualcomm.com/doc/80-70015-15B/topic/develop-own-app.html).
For more details about the AI Hub workflow and APIs, refer to the [AI Hub Documentation](https://app.aihub.qualcomm.com/docs/hub/index.html#examples).
Last Published: Jan 21, 2026
[Previous Topic
Compile and optimize model](https://docs.qualcomm.com/bundle/publicresource/80-70015-15B/topics/compile-optimize.md) [Next Topic
TFLite](https://docs.qualcomm.com/bundle/publicresource/80-70015-15B/topics/tflite.md)