Class JlamaEmbeddingModel

All Implemented Interfaces:
EmbeddingModel

public class JlamaEmbeddingModel extends DimensionAwareEmbeddingModel
  • Constructor Details

    • JlamaEmbeddingModel

      public JlamaEmbeddingModel(Path modelCachePath, String modelName, String authToken, Integer threadCount, Boolean quantizeModelAtRuntime, com.github.tjake.jlama.model.functions.Generator.PoolingType poolingType, Path workingDirectory)
  • Method Details

    • builder

    • embedAll

      public Response<List<Embedding>> embedAll(List<TextSegment> textSegments)
      Description copied from interface: EmbeddingModel
      Embeds the text content of a list of TextSegments.

      This is a convenience method over EmbeddingModel.embed(EmbeddingRequest), so listeners are notified and the model's default per-call parameters are applied here too. A provider implements its embedding logic by overriding EmbeddingModel.doEmbed(EmbeddingRequest) (preferred); it may still override this method for batch-specific behavior that the request/response API does not carry (for example applying a document title from TextSegment metadata).

      Parameters:
      textSegments - the text segments to embed.
      Returns:
      the embeddings.
    • modelName

      public String modelName()
      Description copied from interface: EmbeddingModel
      Returns the name of the underlying embedding model.

      Implementations are encouraged to override this method and provide the actual model name. The default implementation returns "unknown", which indicates that the model name is unknown.

      Returns:
      the model name or a fallback value if not provided