Skip to main content
The Model class loads ONNX models optimized for text generation using ONNX Runtime.

Constructor

Create a model from a configuration path or Config object.
str
Path to the model directory containing genai_config.json and model.onnx
Config
A Config object with custom execution provider settings

Properties

type

The model architecture type (e.g., “phi3”, “llama”, “phi3v”, “phi4mm”).
str
Model architecture identifier from the configuration

device_type

The device type the model is running on.
str
Device identifier (e.g., “CPU”, “CUDA”, “DML”)

Methods

create_multimodal_processor()

Create a multimodal processor for models that support images and audio.
MultiModalProcessor
Processor for encoding images, audio, and text together

Example Usage

Basic text generation setup:
With custom execution provider:
Multimodal example: