Class OnnxScoringModel

java.lang.Object
dev.langchain4j.model.scoring.onnx.OnnxScoringModel
All Implemented Interfaces:
ScoringModel, AutoCloseable

public class OnnxScoringModel extends Object
A scoring (reranking) model that runs within your Java application's process using ONNX runtime.
Many models (e.g., from HuggingFace) can be used, as long as they are in the ONNX format.

Load only model files you trust. ONNX runtime parses the model file with native code, and a crafted model file can exploit flaws in the runtime, for example to read other files on your machine or to crash the JVM.