Skip to main content

Prerequisites

  • The Python SDK installed — see Install.
  • Familiarity with runtime choice — qairt for Qualcomm AI Hub Models, llama_cpp for any GGUF.
The SDK follows the same design as Hugging Face transformers — load with AutoModelForCausalLM.from_pretrained(), then call .generate().

LLM inference (GGUF)

Any GGUF model from Hugging Face runs via llama_cpp. Model weights are downloaded on first use.

LLM inference (QAIRT)

Pre-compiled bundles from Qualcomm AI Hub run entirely on the Hexagon NPU via the qairt runtime. Use device_map="qairt" (or "npu"). Model weights are downloaded on first use.

VLM inference (QAIRT)

Download a sample image first:
Then run inference:

Audio inference (GGUF)

Audio input runs on the llama.cpp backend with an audio-capable model — its mmproj must carry a conformer encoder. google/gemma-4-E2B-it-qat-q4_0-gguf is one such model. Load it with AutoModelForVision2Seq, then pass file paths to generate(images=[...], audios=[...]) — a single call can carry both.
Audio input runs on the llama.cpp backend only. QAIRT bundles report capabilities()['audio'] == False and raise GenieXError(-201201): Multimodal generation failed if given audio.
Download a sample clip and photo:
Then run inference:
Output (verified on device_map="npu", Snapdragon X Elite):

Jupyter notebook walkthrough

For laptop users, follow the step-by-step Jupyter notebook at examples/python/windows.ipynb — it covers environment setup and inference end-to-end.

Next steps

API reference

All classes, methods, and parameters for the Python SDK.

Models

Supported models, GGUF on Hugging Face, and self-converted Qualcomm AI Engine Direct bundles.