Skip to main content

Class: LlamaCppCompletionModel<CONTEXT_WINDOW_SIZE>

Type parameters

NameType
CONTEXT_WINDOW_SIZEextends number | undefined

Hierarchy

Implements

Accessors

contextWindowSize

get contextWindowSize(): CONTEXT_WINDOW_SIZE

Returns

CONTEXT_WINDOW_SIZE

Implementation of

TextStreamingBaseModel.contextWindowSize

Defined in

packages/modelfusion/src/model-provider/llamacpp/LlamaCppCompletionModel.ts:221


modelInformation

get modelInformation(): ModelInformation

Returns

ModelInformation

Implementation of

TextStreamingBaseModel.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/LlamaCppCompletionModel.ts:217


settingsForEvent

get settingsForEvent(): Partial<LlamaCppCompletionModelSettings<CONTEXT_WINDOW_SIZE>>

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

Returns

Partial<LlamaCppCompletionModelSettings<CONTEXT_WINDOW_SIZE>>

Implementation of

TextStreamingBaseModel.settingsForEvent

Overrides

AbstractModel.settingsForEvent

Defined in

packages/modelfusion/src/model-provider/llamacpp/LlamaCppCompletionModel.ts:293

Constructors

constructor

new LlamaCppCompletionModel<CONTEXT_WINDOW_SIZE>(settings?): LlamaCppCompletionModel<CONTEXT_WINDOW_SIZE>

Type parameters

NameType
CONTEXT_WINDOW_SIZEextends undefined | number

Parameters

NameType
settingsLlamaCppCompletionModelSettings<CONTEXT_WINDOW_SIZE>

Returns

LlamaCppCompletionModel<CONTEXT_WINDOW_SIZE>

Overrides

AbstractModel&lt;LlamaCppCompletionModelSettings&lt;CONTEXT_WINDOW_SIZE&gt;&gt;.constructor

Defined in

packages/modelfusion/src/model-provider/llamacpp/LlamaCppCompletionModel.ts:209

Methods

asObjectGenerationModel

asObjectGenerationModel<INPUT_PROMPT, LlamaCppPrompt>(promptTemplate): ObjectFromTextStreamingModel<INPUT_PROMPT, unknown, TextStreamingModel<unknown, TextGenerationModelSettings>> | ObjectFromTextStreamingModel<INPUT_PROMPT, LlamaCppPrompt, TextStreamingModel<LlamaCppPrompt, TextGenerationModelSettings>>

Type parameters

Name
INPUT_PROMPT
LlamaCppPrompt

Parameters

NameType
promptTemplateObjectFromTextPromptTemplate<INPUT_PROMPT, LlamaCppPrompt> | FlexibleObjectFromTextPromptTemplate<INPUT_PROMPT, unknown>

Returns

ObjectFromTextStreamingModel<INPUT_PROMPT, unknown, TextStreamingModel<unknown, TextGenerationModelSettings>> | ObjectFromTextStreamingModel<INPUT_PROMPT, LlamaCppPrompt, TextStreamingModel<LlamaCppPrompt, TextGenerationModelSettings>>

Defined in

packages/modelfusion/src/model-provider/llamacpp/LlamaCppCompletionModel.ts:390


callAPI

callAPI<RESPONSE>(prompt, callOptions, options): Promise<RESPONSE>

Type parameters

Name
RESPONSE

Parameters

NameType
promptLlamaCppCompletionPrompt
callOptionsFunctionCallOptions
optionsObject
options.responseFormatLlamaCppCompletionResponseFormatType<RESPONSE>

Returns

Promise<RESPONSE>

Defined in

packages/modelfusion/src/model-provider/llamacpp/LlamaCppCompletionModel.ts:227


countPromptTokens

countPromptTokens(prompt): Promise<number>

Parameters

NameType
promptLlamaCppCompletionPrompt

Returns

Promise<number>

Implementation of

TextStreamingBaseModel.countPromptTokens

Defined in

packages/modelfusion/src/model-provider/llamacpp/LlamaCppCompletionModel.ts:332


doGenerateTexts

doGenerateTexts(prompt, options): Promise<{ rawResponse: { content: string ; generation_settings: { frequency_penalty: number ; ignore_eos: boolean ; logit_bias: number[] ; mirostat: number ; mirostat_eta: number ; mirostat_tau: number ; model: string ; n_ctx: number ; n_keep: number ; n_predict: number ; n_probs: number ; penalize_nl: boolean ; presence_penalty: number ; repeat_last_n: number ; repeat_penalty: number ; seed: number ; stop: string[] ; stream: boolean ; temperature?: number ; tfs_z: number ; top_k: number ; top_p: number ; typical_p: number } ; model: string ; prompt: string ; stop: true ; stopped_eos: boolean ; stopped_limit: boolean ; stopped_word: boolean ; stopping_word: string ; timings: { predicted_ms: number ; predicted_n: number ; predicted_per_second: null | number ; predicted_per_token_ms: null | number ; prompt_ms?: null | number ; prompt_n: number ; prompt_per_second: null | number ; prompt_per_token_ms: null | number } ; tokens_cached: number ; tokens_evaluated: number ; tokens_predicted: number ; truncated: boolean } ; textGenerationResults: { finishReason: "length" | "stop" | "unknown" ; text: string = rawResponse.content }[] ; usage: { completionTokens: number = rawResponse.tokens_predicted; promptTokens: number = rawResponse.tokens_evaluated; totalTokens: number } }>

Parameters

NameType
promptLlamaCppCompletionPrompt
optionsFunctionCallOptions

Returns

Promise<{ rawResponse: { content: string ; generation_settings: { frequency_penalty: number ; ignore_eos: boolean ; logit_bias: number[] ; mirostat: number ; mirostat_eta: number ; mirostat_tau: number ; model: string ; n_ctx: number ; n_keep: number ; n_predict: number ; n_probs: number ; penalize_nl: boolean ; presence_penalty: number ; repeat_last_n: number ; repeat_penalty: number ; seed: number ; stop: string[] ; stream: boolean ; temperature?: number ; tfs_z: number ; top_k: number ; top_p: number ; typical_p: number } ; model: string ; prompt: string ; stop: true ; stopped_eos: boolean ; stopped_limit: boolean ; stopped_word: boolean ; stopping_word: string ; timings: { predicted_ms: number ; predicted_n: number ; predicted_per_second: null | number ; predicted_per_token_ms: null | number ; prompt_ms?: null | number ; prompt_n: number ; prompt_per_second: null | number ; prompt_per_token_ms: null | number } ; tokens_cached: number ; tokens_evaluated: number ; tokens_predicted: number ; truncated: boolean } ; textGenerationResults: { finishReason: "length" | "stop" | "unknown" ; text: string = rawResponse.content }[] ; usage: { completionTokens: number = rawResponse.tokens_predicted; promptTokens: number = rawResponse.tokens_evaluated; totalTokens: number } }>

Implementation of

TextStreamingBaseModel.doGenerateTexts

Defined in

packages/modelfusion/src/model-provider/llamacpp/LlamaCppCompletionModel.ts:337


doStreamText

doStreamText(prompt, options): Promise<AsyncIterable<Delta<{ content: string ; generation_settings: { frequency_penalty: number ; ignore_eos: boolean ; logit_bias: number[] ; mirostat: number ; mirostat_eta: number ; mirostat_tau: number ; model: string ; n_ctx: number ; n_keep: number ; n_predict: number ; n_probs: number ; penalize_nl: boolean ; presence_penalty: number ; repeat_last_n: number ; repeat_penalty: number ; seed: number ; stop: string[] ; stream: boolean ; temperature?: number ; tfs_z: number ; top_k: number ; top_p: number ; typical_p: number } ; model: string ; prompt: string ; stop: true ; stopped_eos: boolean ; stopped_limit: boolean ; stopped_word: boolean ; stopping_word: string ; timings: { predicted_ms: number ; predicted_n: number ; predicted_per_second: null | number ; predicted_per_token_ms: null | number ; prompt_ms?: null | number ; prompt_n: number ; prompt_per_second: null | number ; prompt_per_token_ms: null | number } ; tokens_cached: number ; tokens_evaluated: number ; tokens_predicted: number ; truncated: boolean } | { content: string ; stop: false }>>>

Parameters

NameType
promptLlamaCppCompletionPrompt
optionsFunctionCallOptions

Returns

Promise<AsyncIterable<Delta<{ content: string ; generation_settings: { frequency_penalty: number ; ignore_eos: boolean ; logit_bias: number[] ; mirostat: number ; mirostat_eta: number ; mirostat_tau: number ; model: string ; n_ctx: number ; n_keep: number ; n_predict: number ; n_probs: number ; penalize_nl: boolean ; presence_penalty: number ; repeat_last_n: number ; repeat_penalty: number ; seed: number ; stop: string[] ; stream: boolean ; temperature?: number ; tfs_z: number ; top_k: number ; top_p: number ; typical_p: number } ; model: string ; prompt: string ; stop: true ; stopped_eos: boolean ; stopped_limit: boolean ; stopped_word: boolean ; stopping_word: string ; timings: { predicted_ms: number ; predicted_n: number ; predicted_per_second: null | number ; predicted_per_token_ms: null | number ; prompt_ms?: null | number ; prompt_n: number ; prompt_per_second: null | number ; prompt_per_token_ms: null | number } ; tokens_cached: number ; tokens_evaluated: number ; tokens_predicted: number ; truncated: boolean } | { content: string ; stop: false }>>>

Implementation of

TextStreamingBaseModel.doStreamText

Defined in

packages/modelfusion/src/model-provider/llamacpp/LlamaCppCompletionModel.ts:380


extractTextDelta

extractTextDelta(delta): string

Parameters

NameType
deltaunknown

Returns

string

Implementation of

TextStreamingBaseModel.extractTextDelta

Defined in

packages/modelfusion/src/model-provider/llamacpp/LlamaCppCompletionModel.ts:386


processTextGenerationResponse

processTextGenerationResponse(rawResponse): Object

Parameters

NameType
rawResponseObject
rawResponse.contentstring
rawResponse.generation_settingsObject
rawResponse.generation_settings.frequency_penaltynumber
rawResponse.generation_settings.ignore_eosboolean
rawResponse.generation_settings.logit_biasnumber[]
rawResponse.generation_settings.mirostatnumber
rawResponse.generation_settings.mirostat_etanumber
rawResponse.generation_settings.mirostat_taunumber
rawResponse.generation_settings.modelstring
rawResponse.generation_settings.n_ctxnumber
rawResponse.generation_settings.n_keepnumber
rawResponse.generation_settings.n_predictnumber
rawResponse.generation_settings.n_probsnumber
rawResponse.generation_settings.penalize_nlboolean
rawResponse.generation_settings.presence_penaltynumber
rawResponse.generation_settings.repeat_last_nnumber
rawResponse.generation_settings.repeat_penaltynumber
rawResponse.generation_settings.seednumber
rawResponse.generation_settings.stopstring[]
rawResponse.generation_settings.streamboolean
rawResponse.generation_settings.temperature?number
rawResponse.generation_settings.tfs_znumber
rawResponse.generation_settings.top_knumber
rawResponse.generation_settings.top_pnumber
rawResponse.generation_settings.typical_pnumber
rawResponse.modelstring
rawResponse.promptstring
rawResponse.stoptrue
rawResponse.stopped_eosboolean
rawResponse.stopped_limitboolean
rawResponse.stopped_wordboolean
rawResponse.stopping_wordstring
rawResponse.timingsObject
rawResponse.timings.predicted_msnumber
rawResponse.timings.predicted_nnumber
rawResponse.timings.predicted_per_secondnull | number
rawResponse.timings.predicted_per_token_msnull | number
rawResponse.timings.prompt_ms?null | number
rawResponse.timings.prompt_nnumber
rawResponse.timings.prompt_per_secondnull | number
rawResponse.timings.prompt_per_token_msnull | number
rawResponse.tokens_cachednumber
rawResponse.tokens_evaluatednumber
rawResponse.tokens_predictednumber
rawResponse.truncatedboolean

Returns

Object

NameType
rawResponse{ content: string ; generation_settings: { frequency_penalty: number ; ignore_eos: boolean ; logit_bias: number[] ; mirostat: number ; mirostat_eta: number ; mirostat_tau: number ; model: string ; n_ctx: number ; n_keep: number ; n_predict: number ; n_probs: number ; penalize_nl: boolean ; presence_penalty: number ; repeat_last_n: number ; repeat_penalty: number ; seed: number ; stop: string[] ; stream: boolean ; temperature?: number ; tfs_z: number ; top_k: number ; top_p: number ; typical_p: number } ; model: string ; prompt: string ; stop: true ; stopped_eos: boolean ; stopped_limit: boolean ; stopped_word: boolean ; stopping_word: string ; timings: { predicted_ms: number ; predicted_n: number ; predicted_per_second: null | number ; predicted_per_token_ms: null | number ; prompt_ms?: null | number ; prompt_n: number ; prompt_per_second: null | number ; prompt_per_token_ms: null | number } ; tokens_cached: number ; tokens_evaluated: number ; tokens_predicted: number ; truncated: boolean }
rawResponse.contentstring
rawResponse.generation_settings{ frequency_penalty: number ; ignore_eos: boolean ; logit_bias: number[] ; mirostat: number ; mirostat_eta: number ; mirostat_tau: number ; model: string ; n_ctx: number ; n_keep: number ; n_predict: number ; n_probs: number ; penalize_nl: boolean ; presence_penalty: number ; repeat_last_n: number ; repeat_penalty: number ; seed: number ; stop: string[] ; stream: boolean ; temperature?: number ; tfs_z: number ; top_k: number ; top_p: number ; typical_p: number }
rawResponse.generation_settings.frequency_penaltynumber
rawResponse.generation_settings.ignore_eosboolean
rawResponse.generation_settings.logit_biasnumber[]
rawResponse.generation_settings.mirostatnumber
rawResponse.generation_settings.mirostat_etanumber
rawResponse.generation_settings.mirostat_taunumber
rawResponse.generation_settings.modelstring
rawResponse.generation_settings.n_ctxnumber
rawResponse.generation_settings.n_keepnumber
rawResponse.generation_settings.n_predictnumber
rawResponse.generation_settings.n_probsnumber
rawResponse.generation_settings.penalize_nlboolean
rawResponse.generation_settings.presence_penaltynumber
rawResponse.generation_settings.repeat_last_nnumber
rawResponse.generation_settings.repeat_penaltynumber
rawResponse.generation_settings.seednumber
rawResponse.generation_settings.stopstring[]
rawResponse.generation_settings.streamboolean
rawResponse.generation_settings.temperature?number
rawResponse.generation_settings.tfs_znumber
rawResponse.generation_settings.top_knumber
rawResponse.generation_settings.top_pnumber
rawResponse.generation_settings.typical_pnumber
rawResponse.modelstring
rawResponse.promptstring
rawResponse.stoptrue
rawResponse.stopped_eosboolean
rawResponse.stopped_limitboolean
rawResponse.stopped_wordboolean
rawResponse.stopping_wordstring
rawResponse.timings{ predicted_ms: number ; predicted_n: number ; predicted_per_second: null | number ; predicted_per_token_ms: null | number ; prompt_ms?: null | number ; prompt_n: number ; prompt_per_second: null | number ; prompt_per_token_ms: null | number }
rawResponse.timings.predicted_msnumber
rawResponse.timings.predicted_nnumber
rawResponse.timings.predicted_per_secondnull | number
rawResponse.timings.predicted_per_token_msnull | number
rawResponse.timings.prompt_ms?null | number
rawResponse.timings.prompt_nnumber
rawResponse.timings.prompt_per_secondnull | number
rawResponse.timings.prompt_per_token_msnull | number
rawResponse.tokens_cachednumber
rawResponse.tokens_evaluatednumber
rawResponse.tokens_predictednumber
rawResponse.truncatedboolean
textGenerationResults{ finishReason: "length" | "stop" | "unknown" ; text: string = rawResponse.content }[]
usage{ completionTokens: number = rawResponse.tokens_predicted; promptTokens: number = rawResponse.tokens_evaluated; totalTokens: number }
usage.completionTokensnumber
usage.promptTokensnumber
usage.totalTokensnumber

Defined in

packages/modelfusion/src/model-provider/llamacpp/LlamaCppCompletionModel.ts:357


restoreGeneratedTexts

restoreGeneratedTexts(rawResponse): Object

Parameters

NameType
rawResponseunknown

Returns

Object

NameType
rawResponse{ content: string ; generation_settings: { frequency_penalty: number ; ignore_eos: boolean ; logit_bias: number[] ; mirostat: number ; mirostat_eta: number ; mirostat_tau: number ; model: string ; n_ctx: number ; n_keep: number ; n_predict: number ; n_probs: number ; penalize_nl: boolean ; presence_penalty: number ; repeat_last_n: number ; repeat_penalty: number ; seed: number ; stop: string[] ; stream: boolean ; temperature?: number ; tfs_z: number ; top_k: number ; top_p: number ; typical_p: number } ; model: string ; prompt: string ; stop: true ; stopped_eos: boolean ; stopped_limit: boolean ; stopped_word: boolean ; stopping_word: string ; timings: { predicted_ms: number ; predicted_n: number ; predicted_per_second: null | number ; predicted_per_token_ms: null | number ; prompt_ms?: null | number ; prompt_n: number ; prompt_per_second: null | number ; prompt_per_token_ms: null | number } ; tokens_cached: number ; tokens_evaluated: number ; tokens_predicted: number ; truncated: boolean }
rawResponse.contentstring
rawResponse.generation_settings{ frequency_penalty: number ; ignore_eos: boolean ; logit_bias: number[] ; mirostat: number ; mirostat_eta: number ; mirostat_tau: number ; model: string ; n_ctx: number ; n_keep: number ; n_predict: number ; n_probs: number ; penalize_nl: boolean ; presence_penalty: number ; repeat_last_n: number ; repeat_penalty: number ; seed: number ; stop: string[] ; stream: boolean ; temperature?: number ; tfs_z: number ; top_k: number ; top_p: number ; typical_p: number }
rawResponse.generation_settings.frequency_penaltynumber
rawResponse.generation_settings.ignore_eosboolean
rawResponse.generation_settings.logit_biasnumber[]
rawResponse.generation_settings.mirostatnumber
rawResponse.generation_settings.mirostat_etanumber
rawResponse.generation_settings.mirostat_taunumber
rawResponse.generation_settings.modelstring
rawResponse.generation_settings.n_ctxnumber
rawResponse.generation_settings.n_keepnumber
rawResponse.generation_settings.n_predictnumber
rawResponse.generation_settings.n_probsnumber
rawResponse.generation_settings.penalize_nlboolean
rawResponse.generation_settings.presence_penaltynumber
rawResponse.generation_settings.repeat_last_nnumber
rawResponse.generation_settings.repeat_penaltynumber
rawResponse.generation_settings.seednumber
rawResponse.generation_settings.stopstring[]
rawResponse.generation_settings.streamboolean
rawResponse.generation_settings.temperature?number
rawResponse.generation_settings.tfs_znumber
rawResponse.generation_settings.top_knumber
rawResponse.generation_settings.top_pnumber
rawResponse.generation_settings.typical_pnumber
rawResponse.modelstring
rawResponse.promptstring
rawResponse.stoptrue
rawResponse.stopped_eosboolean
rawResponse.stopped_limitboolean
rawResponse.stopped_wordboolean
rawResponse.stopping_wordstring
rawResponse.timings{ predicted_ms: number ; predicted_n: number ; predicted_per_second: null | number ; predicted_per_token_ms: null | number ; prompt_ms?: null | number ; prompt_n: number ; prompt_per_second: null | number ; prompt_per_token_ms: null | number }
rawResponse.timings.predicted_msnumber
rawResponse.timings.predicted_nnumber
rawResponse.timings.predicted_per_secondnull | number
rawResponse.timings.predicted_per_token_msnull | number
rawResponse.timings.prompt_ms?null | number
rawResponse.timings.prompt_nnumber
rawResponse.timings.prompt_per_secondnull | number
rawResponse.timings.prompt_per_token_msnull | number
rawResponse.tokens_cachednumber
rawResponse.tokens_evaluatednumber
rawResponse.tokens_predictednumber
rawResponse.truncatedboolean
textGenerationResults{ finishReason: "length" | "stop" | "unknown" ; text: string = rawResponse.content }[]
usage{ completionTokens: number = rawResponse.tokens_predicted; promptTokens: number = rawResponse.tokens_evaluated; totalTokens: number }
usage.completionTokensnumber
usage.promptTokensnumber
usage.totalTokensnumber

Implementation of

TextStreamingBaseModel.restoreGeneratedTexts

Defined in

packages/modelfusion/src/model-provider/llamacpp/LlamaCppCompletionModel.ts:348


withChatPrompt

withChatPrompt(): PromptTemplateTextStreamingModel<ChatPrompt, LlamaCppCompletionPrompt, LlamaCppCompletionModelSettings<CONTEXT_WINDOW_SIZE>, LlamaCppCompletionModel<CONTEXT_WINDOW_SIZE>>

Returns this model with a chat prompt template.

Returns

PromptTemplateTextStreamingModel<ChatPrompt, LlamaCppCompletionPrompt, LlamaCppCompletionModelSettings<CONTEXT_WINDOW_SIZE>, LlamaCppCompletionModel<CONTEXT_WINDOW_SIZE>>

Implementation of

TextStreamingBaseModel.withChatPrompt

Defined in

packages/modelfusion/src/model-provider/llamacpp/LlamaCppCompletionModel.ts:441


withInstructionPrompt

withInstructionPrompt(): PromptTemplateTextStreamingModel<InstructionPrompt, LlamaCppCompletionPrompt, LlamaCppCompletionModelSettings<CONTEXT_WINDOW_SIZE>, LlamaCppCompletionModel<CONTEXT_WINDOW_SIZE>>

Returns this model with an instruction prompt template.

Returns

PromptTemplateTextStreamingModel<InstructionPrompt, LlamaCppCompletionPrompt, LlamaCppCompletionModelSettings<CONTEXT_WINDOW_SIZE>, LlamaCppCompletionModel<CONTEXT_WINDOW_SIZE>>

Implementation of

TextStreamingBaseModel.withInstructionPrompt

Defined in

packages/modelfusion/src/model-provider/llamacpp/LlamaCppCompletionModel.ts:432


withJsonOutput

withJsonOutput(schema): this

When possible, limit the output generation to the specified JSON schema, or super sets of it (e.g. JSON in general).

Parameters

NameType
schemaSchema<unknown> & JsonSchemaProducer

Returns

this

Implementation of

TextStreamingBaseModel.withJsonOutput

Defined in

packages/modelfusion/src/model-provider/llamacpp/LlamaCppCompletionModel.ts:406


withPromptTemplate

withPromptTemplate<INPUT_PROMPT>(promptTemplate): PromptTemplateTextStreamingModel<INPUT_PROMPT, LlamaCppCompletionPrompt, LlamaCppCompletionModelSettings<CONTEXT_WINDOW_SIZE>, LlamaCppCompletionModel<CONTEXT_WINDOW_SIZE>>

Maps the prompt for the full Llama.cpp prompt template (incl. image support).

Type parameters

Name
INPUT_PROMPT

Parameters

NameType
promptTemplateTextGenerationPromptTemplate<INPUT_PROMPT, LlamaCppCompletionPrompt>

Returns

PromptTemplateTextStreamingModel<INPUT_PROMPT, LlamaCppCompletionPrompt, LlamaCppCompletionModelSettings<CONTEXT_WINDOW_SIZE>, LlamaCppCompletionModel<CONTEXT_WINDOW_SIZE>>

Implementation of

TextStreamingBaseModel.withPromptTemplate

Defined in

packages/modelfusion/src/model-provider/llamacpp/LlamaCppCompletionModel.ts:453


withSettings

withSettings(additionalSettings): LlamaCppCompletionModel<CONTEXT_WINDOW_SIZE>

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

Parameters

NameType
additionalSettingsPartial<LlamaCppCompletionModelSettings<CONTEXT_WINDOW_SIZE>>

Returns

LlamaCppCompletionModel<CONTEXT_WINDOW_SIZE>

Example

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

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

Implementation of

TextStreamingBaseModel.withSettings

Overrides

AbstractModel.withSettings

Defined in

packages/modelfusion/src/model-provider/llamacpp/LlamaCppCompletionModel.ts:475


withTextPrompt

withTextPrompt(): PromptTemplateTextStreamingModel<string, LlamaCppCompletionPrompt, LlamaCppCompletionModelSettings<CONTEXT_WINDOW_SIZE>, LlamaCppCompletionModel<CONTEXT_WINDOW_SIZE>>

Returns this model with a text prompt template.

Returns

PromptTemplateTextStreamingModel<string, LlamaCppCompletionPrompt, LlamaCppCompletionModelSettings<CONTEXT_WINDOW_SIZE>, LlamaCppCompletionModel<CONTEXT_WINDOW_SIZE>>

Implementation of

TextStreamingBaseModel.withTextPrompt

Defined in

packages/modelfusion/src/model-provider/llamacpp/LlamaCppCompletionModel.ts:423

Properties

provider

Readonly provider: "llamacpp"

Overrides

AbstractModel.provider

Defined in

packages/modelfusion/src/model-provider/llamacpp/LlamaCppCompletionModel.ts:216


settings

Readonly settings: LlamaCppCompletionModelSettings<CONTEXT_WINDOW_SIZE>

Implementation of

TextStreamingBaseModel.settings

Inherited from

AbstractModel.settings

Defined in

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


tokenizer

Readonly tokenizer: LlamaCppTokenizer

Implementation of

TextStreamingBaseModel.tokenizer

Defined in

packages/modelfusion/src/model-provider/llamacpp/LlamaCppCompletionModel.ts:225