This section uses the Qwen3-VL-4B-Instruct model as an example to illustrate the on-device execution workflow.
This workflow applies to quantized models running directly on the device. Please first refer to the On-device Preparation section to complete the environment setup and understand the correspondence between the model and example.
The current vlm_demoonly supports single-image input. Multi-image input will be supported in future releases.
In the oellm_runtime directory, the VLM example uses the following files and folders:
The on-device configuration file {model}_config.json contains user-configurable parameters as follows:
| Parameter | Description | Required / Optional |
|---|---|---|
model_type | Description: Model type Type: stringValues: Qwen2.5-VL, Qwen3-VL, InternVL | Required |
model_dir | Description: Folder path storing on-device model files Type: string | Required |
vit_model_file | Description: Vision model filename Type: string | Required |
llm_model_file | Description: Language model filename Type: string | Required |
embed_weight_file_path | Description: Embedding weight filename Type: string | Required |
vit_bpu_core | Description: BPU cores used for vision model. Multiple cores specified as [0,1,2,3]Type: [int] | Required |
prefill_bpu_core | Description: BPU cores used by the language model during the prefill stage. Specify multiple cores as [0,1,2,3]Type: [int] | Required |
decode_bpu_core | Description: BPU cores used by the language model during the decode stage. Specify multiple cores as [0,1,2,3]Type: [int] | Required |
vocabulary_path | Description: Tokenizer configuration directory path Type: string | Required |
Do not modify other configuration parameters, as it may cause inference errors.
Example qwen3vl_4b_config.json:
A one-click script run_vlm.shis provided. Example commands:
Script contents:
Executable parameters:
Conversation Control Commands
| Command | Description |
|---|---|
<prompt> | Input text prompt |
/image <image_path> | Load local image, replacing previously loaded image |
regen | Regenerate the current response |
reset | Clear memory and previously loaded image information |
exit | Exit the program |
Method 1. Load image during model initialization:
Method 2. Load image during interactive session:
Enter text directly after [User] <<< prompt, for example: