Class: LlamaDeuce
Llama2 LLM implementation
Hierarchy
BaseLLM
↳
LlamaDeuce
Constructors
constructor
• new LlamaDeuce(init?
)
Parameters
Name | Type |
---|---|
init? | Partial <LlamaDeuce > |
Overrides
BaseLLM.constructor
Defined in
packages/core/src/llm/LLM.ts:358
Properties
chatStrategy
• chatStrategy: DeuceChatStrategy
Defined in
packages/core/src/llm/LLM.ts:352
maxTokens
• Optional
maxTokens: number
Defined in
packages/core/src/llm/LLM.ts:355
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:351
replicateSession
• replicateSession: ReplicateSession
Defined in
packages/core/src/llm/LLM.ts:356
temperature
• temperature: number
Defined in
packages/core/src/llm/LLM.ts:353
topP
• topP: number
Defined in
packages/core/src/llm/LLM.ts:354
Accessors
metadata
• get
metadata(): Object
Returns
Object
Name | Type |
---|---|
contextWindow | number |
maxTokens | undefined | 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" |
temperature | number |
tokenizer | undefined |
topP | number |
Overrides
BaseLLM.metadata
Defined in
packages/core/src/llm/LLM.ts:378
Methods
chat
▸ chat(params
): Promise
<AsyncIterable
<ChatResponseChunk
>>
Parameters
Name | Type |
---|---|
params | LLMChatParamsStreaming |
Returns
Promise
<AsyncIterable
<ChatResponseChunk
>>
Overrides
BaseLLM.chat
Defined in
packages/core/src/llm/LLM.ts:516
▸ chat(params
): Promise
<ChatResponse
>
Parameters
Name | Type |
---|---|
params | LLMChatParamsNonStreaming |
Returns
Promise
<ChatResponse
>
Overrides
BaseLLM.chat
Defined in
packages/core/src/llm/LLM.ts:519
complete
▸ complete(params
): Promise
<AsyncIterable
<CompletionResponse
>>
Parameters
Name | Type |
---|---|
params | LLMCompletionParamsStreaming |
Returns
Promise
<AsyncIterable
<CompletionResponse
>>
Inherited from
BaseLLM.complete
Defined in
packages/core/src/llm/base.ts:18
▸ complete(params
): Promise
<CompletionResponse
>
Parameters
Name | Type |
---|---|
params | LLMCompletionParamsNonStreaming |
Returns
Promise
<CompletionResponse
>
Inherited from
BaseLLM.complete
Defined in
packages/core/src/llm/base.ts:21
mapMessageTypeA16Z
▸ mapMessageTypeA16Z(messageType
): string
Parameters
Name | Type |
---|---|
messageType | MessageType |
Returns
string
Defined in
packages/core/src/llm/LLM.ts:425
mapMessagesToPrompt
▸ mapMessagesToPrompt(messages
): Object
Parameters
Name | Type |
---|---|
messages | ChatMessage [] |
Returns
Object
Name | Type |
---|---|
prompt | string |
systemPrompt | any |
Defined in
packages/core/src/llm/LLM.ts:389
mapMessagesToPromptA16Z
▸ mapMessagesToPromptA16Z(messages
): Object
Parameters
Name | Type |
---|---|
messages | ChatMessage [] |
Returns
Object
Name | Type |
---|---|
prompt | string |
systemPrompt | undefined |
Defined in
packages/core/src/llm/LLM.ts:411
mapMessagesToPromptMeta
▸ mapMessagesToPromptMeta(messages
, opts?
): Object
Parameters
Name | Type |
---|---|
messages | ChatMessage [] |
opts? | Object |
opts.replicate4Bit? | boolean |
opts.withBos? | boolean |
opts.withNewlines? | boolean |
Returns
Object
Name | Type |
---|---|
prompt | string |
systemPrompt | any |
Defined in
packages/core/src/llm/LLM.ts:438
tokens
▸ tokens(messages
): number
Parameters
Name | Type |
---|---|
messages | ChatMessage [] |
Returns
number
Overrides
BaseLLM.tokens