Skip to main content

Class: LlamaCppTextEmbeddingModel

Hierarchy

Implements

Accessors

dimensions

get dimensions(): undefined | number

The size of the embedding vector.

Returns

undefined | number

Implementation of

EmbeddingModel.dimensions

Defined in

packages/modelfusion/src/model-provider/llamacpp/LlamaCppTextEmbeddingModel.ts:47


isParallelizable

get isParallelizable(): boolean

True if the model can handle multiple embedding calls in parallel.

Returns

boolean

Implementation of

EmbeddingModel.isParallelizable

Defined in

packages/modelfusion/src/model-provider/llamacpp/LlamaCppTextEmbeddingModel.ts:42


modelInformation

get modelInformation(): ModelInformation

Returns

ModelInformation

Implementation of

EmbeddingModel.modelInformation

Inherited from

AbstractModel.modelInformation

Defined in

packages/modelfusion/src/model-function/AbstractModel.ts:17


modelName

get modelName(): null

Returns

null

Overrides

AbstractModel.modelName

Defined in

packages/modelfusion/src/model-provider/llamacpp/LlamaCppTextEmbeddingModel.ts:37


settingsForEvent

get settingsForEvent(): Partial<LlamaCppTextEmbeddingModelSettings>

Returns settings that should be recorded in observability events. Security-related settings (e.g. API keys) should not be included here.

Returns

Partial<LlamaCppTextEmbeddingModelSettings>

Implementation of

EmbeddingModel.settingsForEvent

Overrides

AbstractModel.settingsForEvent

Defined in

packages/modelfusion/src/model-provider/llamacpp/LlamaCppTextEmbeddingModel.ts:92

Constructors

constructor

new LlamaCppTextEmbeddingModel(settings?): LlamaCppTextEmbeddingModel

Parameters

NameType
settingsLlamaCppTextEmbeddingModelSettings

Returns

LlamaCppTextEmbeddingModel

Overrides

AbstractModel&lt;LlamaCppTextEmbeddingModelSettings&gt;.constructor

Defined in

packages/modelfusion/src/model-provider/llamacpp/LlamaCppTextEmbeddingModel.ts:30

Methods

callAPI

callAPI(texts, callOptions): Promise<{ embedding: number[] }>

Parameters

NameType
textsstring[]
callOptionsFunctionCallOptions

Returns

Promise<{ embedding: number[] }>

Defined in

packages/modelfusion/src/model-provider/llamacpp/LlamaCppTextEmbeddingModel.ts:57


doEmbedValues

doEmbedValues(texts, options): Promise<{ embeddings: number[][] ; rawResponse: { embedding: number[] } }>

Parameters

NameType
textsstring[]
optionsFunctionCallOptions

Returns

Promise<{ embeddings: number[][] ; rawResponse: { embedding: number[] } }>

Implementation of

EmbeddingModel.doEmbedValues

Defined in

packages/modelfusion/src/model-provider/llamacpp/LlamaCppTextEmbeddingModel.ts:98


tokenize

tokenize(text): Promise<number[]>

Parameters

NameType
textstring

Returns

Promise<number[]>

Defined in

packages/modelfusion/src/model-provider/llamacpp/LlamaCppTextEmbeddingModel.ts:53


withSettings

withSettings(additionalSettings): LlamaCppTextEmbeddingModel

The withSettings method creates a new model with the same configuration as the original model, but with the specified settings changed.

Parameters

NameType
additionalSettingsPartial<LlamaCppTextEmbeddingModelSettings>

Returns

LlamaCppTextEmbeddingModel

Example

const model = new OpenAICompletionModel({
model: "gpt-3.5-turbo-instruct",
maxGenerationTokens: 500,
});

const modelWithMoreTokens = model.withSettings({
maxGenerationTokens: 1000,
});

Implementation of

EmbeddingModel.withSettings

Overrides

AbstractModel.withSettings

Defined in

packages/modelfusion/src/model-provider/llamacpp/LlamaCppTextEmbeddingModel.ts:107

Properties

contextWindowSize

Readonly contextWindowSize: undefined = undefined

Defined in

packages/modelfusion/src/model-provider/llamacpp/LlamaCppTextEmbeddingModel.ts:46


maxValuesPerCall

Readonly maxValuesPerCall: 1

Limit of how many values can be sent in a single API call.

Implementation of

EmbeddingModel.maxValuesPerCall

Defined in

packages/modelfusion/src/model-provider/llamacpp/LlamaCppTextEmbeddingModel.ts:41


provider

Readonly provider: "llamacpp"

Overrides

AbstractModel.provider

Defined in

packages/modelfusion/src/model-provider/llamacpp/LlamaCppTextEmbeddingModel.ts:36


settings

Readonly settings: LlamaCppTextEmbeddingModelSettings

Implementation of

EmbeddingModel.settings

Inherited from

AbstractModel.settings

Defined in

packages/modelfusion/src/model-function/AbstractModel.ts:7