Skip to main content

Class: LlamaDeuce

Llama2 LLM implementation

Hierarchy

  • BaseLLM

    LlamaDeuce

Constructors

constructor

new LlamaDeuce(init?): LlamaDeuce

Parameters

NameType
init?Partial<LlamaDeuce>

Returns

LlamaDeuce

Overrides

BaseLLM.constructor

Defined in

packages/core/src/llm/LLM.ts:407

Properties

chatStrategy

chatStrategy: DeuceChatStrategy

Defined in

packages/core/src/llm/LLM.ts:401


maxTokens

Optional maxTokens: number

Defined in

packages/core/src/llm/LLM.ts:404


model

model: "Llama-2-70b-chat-old" | "Llama-2-70b-chat-4bit" | "Llama-2-13b-chat-old" | "Llama-2-13b-chat-4bit" | "Llama-2-7b-chat-old" | "Llama-2-7b-chat-4bit"

Defined in

packages/core/src/llm/LLM.ts:400


replicateSession

replicateSession: ReplicateSession

Defined in

packages/core/src/llm/LLM.ts:405


temperature

temperature: number

Defined in

packages/core/src/llm/LLM.ts:402


topP

topP: number

Defined in

packages/core/src/llm/LLM.ts:403

Accessors

metadata

get metadata(): Object

Returns

Object

NameType
contextWindownumber
maxTokensundefined | number
model"Llama-2-70b-chat-old" | "Llama-2-70b-chat-4bit" | "Llama-2-13b-chat-old" | "Llama-2-13b-chat-4bit" | "Llama-2-7b-chat-old" | "Llama-2-7b-chat-4bit"
temperaturenumber
tokenizerundefined
topPnumber

Overrides

BaseLLM.metadata

Defined in

packages/core/src/llm/LLM.ts:427

Methods

chat

chat(params): Promise<AsyncIterable<ChatResponseChunk>>

Parameters

NameType
paramsLLMChatParamsStreaming

Returns

Promise<AsyncIterable<ChatResponseChunk>>

Overrides

BaseLLM.chat

Defined in

packages/core/src/llm/LLM.ts:565

chat(params): Promise<ChatResponse>

Parameters

NameType
paramsLLMChatParamsNonStreaming

Returns

Promise<ChatResponse>

Overrides

BaseLLM.chat

Defined in

packages/core/src/llm/LLM.ts:568


complete

complete(params): Promise<AsyncIterable<CompletionResponse>>

Parameters

NameType
paramsLLMCompletionParamsStreaming

Returns

Promise<AsyncIterable<CompletionResponse>>

Inherited from

BaseLLM.complete

Defined in

packages/core/src/llm/base.ts:18

complete(params): Promise<CompletionResponse>

Parameters

NameType
paramsLLMCompletionParamsNonStreaming

Returns

Promise<CompletionResponse>

Inherited from

BaseLLM.complete

Defined in

packages/core/src/llm/base.ts:21


mapMessageTypeA16Z

mapMessageTypeA16Z(messageType): string

Parameters

NameType
messageTypeMessageType

Returns

string

Defined in

packages/core/src/llm/LLM.ts:474


mapMessagesToPrompt

mapMessagesToPrompt(messages): Object

Parameters

NameType
messagesChatMessage[]

Returns

Object

NameType
promptstring
systemPromptany

Defined in

packages/core/src/llm/LLM.ts:438


mapMessagesToPromptA16Z

mapMessagesToPromptA16Z(messages): Object

Parameters

NameType
messagesChatMessage[]

Returns

Object

NameType
promptstring
systemPromptundefined

Defined in

packages/core/src/llm/LLM.ts:460


mapMessagesToPromptMeta

mapMessagesToPromptMeta(messages, opts?): Object

Parameters

NameType
messagesChatMessage[]
opts?Object
opts.replicate4Bit?boolean
opts.withBos?boolean
opts.withNewlines?boolean

Returns

Object

NameType
promptstring
systemPromptany

Defined in

packages/core/src/llm/LLM.ts:487


tokens

tokens(messages): number

Parameters

NameType
messagesChatMessage[]

Returns

number

Overrides

BaseLLM.tokens

Defined in

packages/core/src/llm/LLM.ts:423