Milvus

No Python, No Problem: Model Inference with ONNX in Java, or Any Other Language

May 30, 2025Stefan Webb
No Python, No Problem: Model Inference with ONNX in Java, or Any Other Language
SummaryAI, from the source post

This post details how to export HuggingFace models (specifically text embedding models) into the ONNX format and then perform inference using these ONNX models directly from Java. It covers exporting both the model and its tokenizer using Python libraries like `sentence-transformers` and `onnxruntime-extensions`, and then demonstrates how to load and run these ONNX files within a Java application using the ONNX Runtime Java API. This enables local, language-agnostic model inference for AI applications, particularly relevant for data ingestion into vector databases like Milvus.

More from the AI Data Storage Engine trail