ONNX Configuration¶
Required catalog fields¶
Every ONNX alias needs:
aliastask— one ofraw,rerank,embed,embed_sparse,embed_multi_vector,embed_hybrid,embed_image,nlp,ocr,document_extractprovider_id: "local/onnx"model_id
Example:
{
"alias": "raw/minilm",
"task": "raw",
"provider_id": "local/onnx",
"model_id": "nixiesearch/all-MiniLM-L6-v2-onnx",
"options": {
"artifact": "model.onnx"
}
}
model_id¶
Supported forms:
- absolute local path
- relative local path
- Hugging Face repo ID
HF repos are snapshotted into cache before ONNX Runtime loads the artifact.
Provider options¶
local/onnx supports a common set of options across every task:
artifactmax_batch_sizeexecution_providersgraph_optimization_levelinter_op_num_threadsintra_op_num_threadscache_dir
Most tasks also accept task-specific keys (validated per task):
embed:tokenizer_path,pooling(cls/mean/max/last-token),normalize,dimensions,max_seq_len,token_type_ids,output_namererank:max_seq_len,style(cross-encoder/generative),instructionembed_sparse:tokenizer_path,sparse_method(mlm/lexical),output_name,output_index,max_seq_len,token_type_ids,top_kembed_multi_vector:tokenizer_path,dimensions,normalize,drop_special_tokens,output_name,output_index,max_seq_len,token_type_idsembed_image:onnx_path,image_size,dimensions,normalization(siglip/imagenet),pool(none/mean),normalize,output_namenlp:onnx_path,tokenizer_path,label_maps_path,max_seq_lenocr:onnx_path,char_dict_path,image_height,image_width,normalization,blank_class,output_name, plus an optional DBNet detection stage (det_onnx_path,det_model_id,det_limit_side,det_bin_threshold,det_box_score_threshold,det_unclip_ratio,det_min_box_size,det_input_name,det_output_name)document_extract:style(granite-docling/mineru/olmocr),onnx_path,tokenizer_path,max_seq_len
artifact¶
Use artifact when the HF repo contains more than one .onnx file.
If a repo has exactly one .onnx file, artifact can be omitted.
execution_providers¶
execution_providers is an ordered list.
Examples:
Supported names:
cpucudacoremldirectml
Defaults:
- CPU-only builds:
["cpu"] gpu-cudabuilds: ORT-backed providers prefer["cuda", "cpu"]
Batch tuning¶
max_batch_size controls the ceiling for dynamic-batch models.
For non-batch models, Uni-Xervo falls back to sequential execution in run_batch().
ORT tuning¶
Example:
Accepted optimization levels:
disablebasicextendedall
Validation behavior¶
Uni-Xervo validates ONNX options at runtime build/register time.
It rejects:
- unknown option keys,
- wrong value types,
- unsupported execution provider names,
- invalid batch/thread counts.
Schema files:
schemas/model-catalog.schema.jsonschemas/provider-options/onnx.schema.json