In-Process Embedding Models
Maven Coordinates
In addition to the LangChain4j integration core dependencies, add:
<dependency>
<groupId>io.helidon.integrations.langchain4j.providers</groupId>
<artifactId>helidon-integrations-langchain4j-providers-lc4j-in-process</artifactId>
</dependency>
Depending on configured model type, add model artifact dependencies as
follows:
- For
type: all_minilm_l6_v2, add:pom.xml<dependency> <groupId>dev.langchain4j</groupId> <artifactId>langchain4j-embeddings-all-minilm-l6-v2</artifactId> </dependency> - For
type: all_minilm_l6_v2_q, add:pom.xml<dependency> <groupId>dev.langchain4j</groupId> <artifactId>langchain4j-embeddings-all-minilm-l6-v2-q</artifactId> </dependency> - For
type: custom, no additional model-specific dependency is required. Configurepath-to-model,path-to-tokenizer, andpooling-mode.
In-Process Embedding Model
Provider key: lc4j-in-process.
LangChain4j in-process embedding models run ONNX embedding inference locally in your process (see LangChain4j documentation).
In Helidon, a named entry under langchain4j.models with provider: lc4j-in-process is created as a named singleton declarative service bean in the
Helidon service registry. This is how foo-bar-embedding-model becomes
available for content retrievers and direct injection.
For type: custom, configure model and tokenizer paths and pooling mode:
If type: custom is selected but any of path-to-model, path-to-tokenizer,
or pooling-mode is missing, Helidon fails startup with a configuration
exception.
Configuration properties:
Configuration options
| Key | Type | Default | Description |
|---|---|---|---|
path- | Path | The path to the tokenizer file (e.g., "/path/to/tokenizer.json") | |
path- | Path | The path to the modelPath file (e.g., "/path/to/model.onnx") | |
executor | Thread | Executor configuration used by the embedding model | |
pooling- | Pooling | The pooling model to use | |
type | In | Which in-process ONNX model variant should be used | |
enabled | Boolean | true | Whether the embedding model is enabled |