web-llm-runner 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +211 -0
- package/README.md +564 -0
- package/lib/cache_util.d.ts +19 -0
- package/lib/cache_util.d.ts.map +1 -0
- package/lib/config.d.ts +199 -0
- package/lib/config.d.ts.map +1 -0
- package/lib/conversation.d.ts +107 -0
- package/lib/conversation.d.ts.map +1 -0
- package/lib/embedding.d.ts +38 -0
- package/lib/embedding.d.ts.map +1 -0
- package/lib/engine.d.ts +140 -0
- package/lib/engine.d.ts.map +1 -0
- package/lib/error.d.ts +208 -0
- package/lib/error.d.ts.map +1 -0
- package/lib/extension_service_worker.d.ts +54 -0
- package/lib/extension_service_worker.d.ts.map +1 -0
- package/lib/index.d.ts +13 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +13767 -0
- package/lib/index.js.map +1 -0
- package/lib/integrity.d.ts +44 -0
- package/lib/integrity.d.ts.map +1 -0
- package/lib/llm_chat.d.ts +258 -0
- package/lib/llm_chat.d.ts.map +1 -0
- package/lib/message.d.ts +87 -0
- package/lib/message.d.ts.map +1 -0
- package/lib/openai_api_protocols/chat_completion.d.ts +834 -0
- package/lib/openai_api_protocols/chat_completion.d.ts.map +1 -0
- package/lib/openai_api_protocols/completion.d.ts +270 -0
- package/lib/openai_api_protocols/completion.d.ts.map +1 -0
- package/lib/openai_api_protocols/embedding.d.ts +125 -0
- package/lib/openai_api_protocols/embedding.d.ts.map +1 -0
- package/lib/openai_api_protocols/index.d.ts +20 -0
- package/lib/openai_api_protocols/index.d.ts.map +1 -0
- package/lib/service_worker.d.ts +53 -0
- package/lib/service_worker.d.ts.map +1 -0
- package/lib/support.d.ts +117 -0
- package/lib/support.d.ts.map +1 -0
- package/lib/types.d.ts +202 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/utils.d.ts +7 -0
- package/lib/utils.d.ts.map +1 -0
- package/lib/web_worker.d.ts +132 -0
- package/lib/web_worker.d.ts.map +1 -0
- package/lib/wrapper/WebLLMWrapper.d.ts +20 -0
- package/lib/wrapper/WebLLMWrapper.d.ts.map +1 -0
- package/lib/wrapper/llm-worker.d.ts +2 -0
- package/lib/wrapper/llm-worker.d.ts.map +1 -0
- package/package.json +60 -0
package/lib/config.d.ts
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { ResponseFormat } from "./openai_api_protocols";
|
|
2
|
+
import { LogitProcessor, InitProgressCallback, LogLevel } from "./types";
|
|
3
|
+
import { ModelIntegrity } from "./integrity";
|
|
4
|
+
/**
|
|
5
|
+
* Conversation template config
|
|
6
|
+
*/
|
|
7
|
+
export interface ConvTemplateConfig {
|
|
8
|
+
system_template: string;
|
|
9
|
+
system_message: string;
|
|
10
|
+
roles: Record<Role, string>;
|
|
11
|
+
role_templates?: Partial<Record<Role, string>>;
|
|
12
|
+
seps: Array<string>;
|
|
13
|
+
role_content_sep?: string;
|
|
14
|
+
role_empty_sep?: string;
|
|
15
|
+
stop_str: Array<string>;
|
|
16
|
+
system_prefix_token_ids?: Array<number>;
|
|
17
|
+
stop_token_ids: Array<number>;
|
|
18
|
+
add_role_after_system_message?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export declare enum Role {
|
|
21
|
+
user = "user",
|
|
22
|
+
assistant = "assistant",
|
|
23
|
+
tool = "tool"
|
|
24
|
+
}
|
|
25
|
+
export declare const DefaultLogLevel: LogLevel;
|
|
26
|
+
/**
|
|
27
|
+
* Place holders that can be used in role templates.
|
|
28
|
+
* For example, a role template of
|
|
29
|
+
* `<<question>> ${MessagePlaceholders.USER} <<function>> ${MessagePlaceholders.FUNCTION}`
|
|
30
|
+
* will insert the user message to ${MessagePlaceholders.USER}
|
|
31
|
+
* and insert the function message to ${MessagePlaceholders.FUNCTION}
|
|
32
|
+
* at run time.
|
|
33
|
+
*/
|
|
34
|
+
export declare enum MessagePlaceholders {
|
|
35
|
+
system = "{system_message}",
|
|
36
|
+
user = "{user_message}",
|
|
37
|
+
assistant = "{assistant_message}",
|
|
38
|
+
tool = "{tool_message}",
|
|
39
|
+
function = "{function_string}",
|
|
40
|
+
hermes_tools = "{hermes_tools}"
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Information about the tokenizer. Currently, only `token_postproc_method` is used to
|
|
44
|
+
* post process the token table when using grammar.
|
|
45
|
+
*/
|
|
46
|
+
export interface TokenizerInfo {
|
|
47
|
+
token_postproc_method: string;
|
|
48
|
+
prepend_space_in_encode: boolean;
|
|
49
|
+
strip_space_in_decode: boolean;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Config of one chat model, a data structure representing `mlc-chat-config.json`.
|
|
53
|
+
* This only corresponds to the chat-related fields and `tokenizer_files` of `mlc-chat-config.json`.
|
|
54
|
+
* Only these fields affect the conversation in runtime.
|
|
55
|
+
* i.e. The third part in https://llm.mlc.ai/docs/get_started/mlc_chat_config.html.
|
|
56
|
+
*
|
|
57
|
+
* This is initialized in `MLCEngine.reload()` with the model's `mlc-chat-config.json`.
|
|
58
|
+
*/
|
|
59
|
+
export interface ChatConfig {
|
|
60
|
+
tokenizer_files: Array<string>;
|
|
61
|
+
tokenizer_info?: TokenizerInfo;
|
|
62
|
+
token_table_postproc_method?: string;
|
|
63
|
+
vocab_size: number;
|
|
64
|
+
conv_config?: Partial<ConvTemplateConfig>;
|
|
65
|
+
conv_template: ConvTemplateConfig;
|
|
66
|
+
context_window_size: number;
|
|
67
|
+
sliding_window_size: number;
|
|
68
|
+
attention_sink_size: number;
|
|
69
|
+
repetition_penalty: number;
|
|
70
|
+
frequency_penalty: number;
|
|
71
|
+
presence_penalty: number;
|
|
72
|
+
top_p: number;
|
|
73
|
+
temperature: number;
|
|
74
|
+
bos_token_id?: number;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Custom options that can be used to override known config values.
|
|
78
|
+
*/
|
|
79
|
+
export interface ChatOptions extends Partial<ChatConfig> {
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Optional configurations for `CreateMLCEngine()` and `CreateWebWorkerMLCEngine()`.
|
|
83
|
+
*
|
|
84
|
+
* appConfig: Configure the app, including the list of models and whether to use IndexedDB cache.
|
|
85
|
+
* initProgressCallback: A callback for showing the progress of loading the model.
|
|
86
|
+
* logitProcessorRegistry: A register for stateful logit processors, see `webllm.LogitProcessor`.
|
|
87
|
+
*
|
|
88
|
+
* @note All fields are optional, and `logitProcessorRegistry` is only used for `MLCEngine` and not
|
|
89
|
+
* other `MLCEngine`s.
|
|
90
|
+
*/
|
|
91
|
+
export interface MLCEngineConfig {
|
|
92
|
+
appConfig?: AppConfig;
|
|
93
|
+
initProgressCallback?: InitProgressCallback;
|
|
94
|
+
logitProcessorRegistry?: Map<string, LogitProcessor>;
|
|
95
|
+
logLevel?: LogLevel;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Config for a single generation.
|
|
99
|
+
* Essentially `ChatConfig` without `tokenizer_files`, `conv_config`, or `conv_template`.
|
|
100
|
+
* We also support additional fields not present in `mlc-chat-config.json` due to OpenAI-like APIs.
|
|
101
|
+
*
|
|
102
|
+
* Note that all values are optional. If unspecified, we use whatever values in `ChatConfig`
|
|
103
|
+
* initialized during `MLCEngine.reload()`.
|
|
104
|
+
*/
|
|
105
|
+
export interface GenerationConfig {
|
|
106
|
+
repetition_penalty?: number | null;
|
|
107
|
+
ignore_eos?: boolean;
|
|
108
|
+
top_p?: number | null;
|
|
109
|
+
temperature?: number | null;
|
|
110
|
+
max_tokens?: number | null;
|
|
111
|
+
frequency_penalty?: number | null;
|
|
112
|
+
presence_penalty?: number | null;
|
|
113
|
+
stop?: string | null | Array<string>;
|
|
114
|
+
n?: number | null;
|
|
115
|
+
logit_bias?: Record<string, number> | null;
|
|
116
|
+
logprobs?: boolean | null;
|
|
117
|
+
top_logprobs?: number | null;
|
|
118
|
+
response_format?: ResponseFormat | null;
|
|
119
|
+
enable_thinking?: boolean | null;
|
|
120
|
+
enable_latency_breakdown?: boolean | null;
|
|
121
|
+
}
|
|
122
|
+
export declare function postInitAndCheckGenerationConfigValues(config: GenerationConfig): void;
|
|
123
|
+
export declare enum ModelType {
|
|
124
|
+
"LLM" = 0,
|
|
125
|
+
"embedding" = 1,
|
|
126
|
+
"VLM" = 2
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Information for a model.
|
|
130
|
+
* @param model: the huggingface link to download the model weights, accepting four formats:
|
|
131
|
+
* - https://huggingface.co/{USERNAME}/{MODEL}, which we automatically use the main branch
|
|
132
|
+
* - https://huggingface.co/{USERNAME}/{MODEL}/, which we automatically use the main branch
|
|
133
|
+
* - https://huggingface.co/{USERNAME}/{MODEL}/resolve/{BRANCH}
|
|
134
|
+
* - https://huggingface.co/{USERNAME}/{MODEL}/resolve/{BRANCH}/
|
|
135
|
+
* @param model_id: what we call the model.
|
|
136
|
+
* @param model_lib: link to the model library (wasm file) the model uses.
|
|
137
|
+
* @param overrides: partial ChatConfig to override mlc-chat-config.json; can be used to change KVCache settings.
|
|
138
|
+
* @param vram_required_MB: amount of vram in MB required to run the model (can use
|
|
139
|
+
* `utils/vram_requirements` to calculate).
|
|
140
|
+
* @param low_resource_required: whether the model can run on limited devices (e.g. Android phone).
|
|
141
|
+
* @param buffer_size_required_bytes: required `maxStorageBufferBindingSize`, different for each device.
|
|
142
|
+
* @param required_features: feature needed to run this model (e.g. shader-f16).
|
|
143
|
+
* @param model_type: the intended usecase for the model, if unspecified, default to LLM.
|
|
144
|
+
* @param integrity: optional SRI hashes to verify downloaded artifacts. See {@link ModelIntegrity}.
|
|
145
|
+
*/
|
|
146
|
+
export interface ModelRecord {
|
|
147
|
+
model: string;
|
|
148
|
+
model_id: string;
|
|
149
|
+
model_lib: string;
|
|
150
|
+
overrides?: ChatOptions;
|
|
151
|
+
vram_required_MB?: number;
|
|
152
|
+
low_resource_required?: boolean;
|
|
153
|
+
buffer_size_required_bytes?: number;
|
|
154
|
+
required_features?: Array<string>;
|
|
155
|
+
model_type?: ModelType;
|
|
156
|
+
integrity?: ModelIntegrity;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Extra configuration that can be
|
|
160
|
+
* passed to the load.
|
|
161
|
+
*
|
|
162
|
+
* @param model_list: models to be used.
|
|
163
|
+
* @param cacheBackend: the backend to use for caching models and other artifacts.
|
|
164
|
+
* If unspecified, will use the Cache API. For more information, see:
|
|
165
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/Storage_API/Storage_quotas_and_eviction_criteria#what_technologies_store_data_in_the_browser
|
|
166
|
+
* Supported values are:
|
|
167
|
+
* - "cache": browser Cache API.
|
|
168
|
+
* - "indexeddb": IndexedDB-backed cache.
|
|
169
|
+
* - "cross-origin": Chrome Cross-Origin Storage extension-backed cache.
|
|
170
|
+
*
|
|
171
|
+
* @note Note that the Cache API is more well-tested in WebLLM as of now.
|
|
172
|
+
*/
|
|
173
|
+
export type CacheBackend = "cache" | "indexeddb" | "cross-origin";
|
|
174
|
+
export interface AppConfig {
|
|
175
|
+
model_list: Array<ModelRecord>;
|
|
176
|
+
cacheBackend?: CacheBackend;
|
|
177
|
+
}
|
|
178
|
+
export declare function getCacheBackend(appConfig: AppConfig): CacheBackend;
|
|
179
|
+
/**
|
|
180
|
+
* modelVersion: the prebuilt model libraries that the current npm is compatible with, affects the
|
|
181
|
+
* `model_lib`s in `prebuiltAppConfig`.
|
|
182
|
+
*
|
|
183
|
+
* @note The model version does not have to match the npm version, since not each npm update
|
|
184
|
+
* requires an update of the model libraries.
|
|
185
|
+
*/
|
|
186
|
+
export declare const modelVersion = "v0_2_80";
|
|
187
|
+
export declare const modelLibURLPrefix = "https://raw.githubusercontent.com/mlc-ai/binary-mlc-llm-libs/main/web-llm-models/";
|
|
188
|
+
/**
|
|
189
|
+
* Models that support function calling (i.e. usage of `ChatCompletionRequest.tools`). More to come.
|
|
190
|
+
*/
|
|
191
|
+
export declare const functionCallingModelIds: string[];
|
|
192
|
+
/**
|
|
193
|
+
* Default models and model library mapping to be used if unspecified.
|
|
194
|
+
*
|
|
195
|
+
* @note This is the only source of truth of which prebuilt model libraries are compatible with the
|
|
196
|
+
* current WebLLM npm version.
|
|
197
|
+
*/
|
|
198
|
+
export declare const prebuiltAppConfig: AppConfig;
|
|
199
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAQzE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IAC5B,cAAc,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;IAC/C,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACxB,uBAAuB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACxC,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC9B,6BAA6B,CAAC,EAAE,OAAO,CAAC;CACzC;AAED,oBAAY,IAAI;IACd,IAAI,SAAS;IACb,SAAS,cAAc;IACvB,IAAI,SAAS;CACd;AAED,eAAO,MAAM,eAAe,EAAE,QAAiB,CAAC;AAEhD;;;;;;;GAOG;AACH,oBAAY,mBAAmB;IAC7B,MAAM,qBAAqB;IAC3B,IAAI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,CAAC,CAAC;IAClC,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,SAAS,CAAC,EAAE,cAAc,CAAC;CAC5B;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,WAAW,GAAG,cAAc,CAAC;AAElE,MAAM,WAAW,SAAS;IACxB,UAAU,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;IAC/B,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B;AAED,wBAAgB,eAAe,CAAC,SAAS,EAAE,SAAS,GAAG,YAAY,CAKlE;AAED;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,YAAY,CAAC;AACtC,eAAO,MAAM,iBAAiB,sFACuD,CAAC;AAEtF;;GAEG;AACH,eAAO,MAAM,uBAAuB,UAMnC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,EAAE,SA09D/B,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { ChatConfig, ConvTemplateConfig, Role } from "./config";
|
|
2
|
+
import { ChatCompletionContentPart, ChatCompletionContentPartImage, ChatCompletionRequest } from "./openai_api_protocols/index";
|
|
3
|
+
type ImageURL = ChatCompletionContentPartImage.ImageURL;
|
|
4
|
+
/**
|
|
5
|
+
* Helper to keep track of history conversations.
|
|
6
|
+
*/
|
|
7
|
+
export declare class Conversation {
|
|
8
|
+
/** Each message is a tuple of (Role, role_name_str, message), where message can be either a
|
|
9
|
+
* string or an array of contentPart for possible image input.
|
|
10
|
+
*/
|
|
11
|
+
messages: Array<[
|
|
12
|
+
Role,
|
|
13
|
+
string,
|
|
14
|
+
string | Array<ChatCompletionContentPart> | undefined
|
|
15
|
+
]>;
|
|
16
|
+
readonly config: ConvTemplateConfig;
|
|
17
|
+
/** Whether the Conversation object is for text completion with no conversation-style formatting */
|
|
18
|
+
isTextCompletion: boolean;
|
|
19
|
+
/** Used when isTextCompletion is true */
|
|
20
|
+
prompt: string | undefined;
|
|
21
|
+
function_string: string;
|
|
22
|
+
use_function_calling: boolean;
|
|
23
|
+
override_system_message?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Tracks whether the last message is an empty thinking block. Should only
|
|
26
|
+
* be true when we are in the middle of a generation. Will be set to
|
|
27
|
+
* false when the reply is finished with `finishReply()`.
|
|
28
|
+
*/
|
|
29
|
+
private isLastMessageEmptyThinkingReplyHeader;
|
|
30
|
+
constructor(config: ConvTemplateConfig, isTextCompletion?: boolean);
|
|
31
|
+
private getPromptArrayInternal;
|
|
32
|
+
/**
|
|
33
|
+
* Get prompt arrays with the first one as system.
|
|
34
|
+
*
|
|
35
|
+
* It is returned as an array of `string | Array<string | ImageURL>`, where each element of
|
|
36
|
+
* the array represents the formatted message of a role/turn. If the message only contains text,
|
|
37
|
+
* it will be a string that concatenates the role string, message, and separators. If the
|
|
38
|
+
* message contains image(s), it will be an array of string and ImageURL in the order of which
|
|
39
|
+
* they will be prefilled into the model. e.g. it can be something like
|
|
40
|
+
* [
|
|
41
|
+
* "<|system|>\nSome system prompt\n",
|
|
42
|
+
* [
|
|
43
|
+
* "<|user|>\n",
|
|
44
|
+
* imageURL1,
|
|
45
|
+
* "\n",
|
|
46
|
+
* imageURL2,
|
|
47
|
+
* "\n",
|
|
48
|
+
* "Some user input<|end|>\n"
|
|
49
|
+
* ],
|
|
50
|
+
* ]
|
|
51
|
+
*
|
|
52
|
+
* @returns The prompt array.
|
|
53
|
+
*/
|
|
54
|
+
getPromptArray(): Array<string | Array<string | ImageURL>>;
|
|
55
|
+
/**
|
|
56
|
+
* Get the last round of prompt has not been fed as input.
|
|
57
|
+
*
|
|
58
|
+
* @note This function needs to be used with the assumption that
|
|
59
|
+
* the caller call appendMessage then appendReplyHeader.
|
|
60
|
+
*
|
|
61
|
+
* @returns The prompt array.
|
|
62
|
+
*/
|
|
63
|
+
getPromptArrayLastRound(): (string | (string | ChatCompletionContentPartImage.ImageURL)[])[];
|
|
64
|
+
/**
|
|
65
|
+
* Return prompt in an array for non-conversation text completion.
|
|
66
|
+
*/
|
|
67
|
+
getPromptArrayTextCompletion(): Array<string>;
|
|
68
|
+
/**
|
|
69
|
+
* Resets all states for this.conversation.
|
|
70
|
+
*/
|
|
71
|
+
reset(): void;
|
|
72
|
+
getStopStr(): string[];
|
|
73
|
+
getStopTokens(): number[];
|
|
74
|
+
appendMessage(role: Role, message: string | Array<ChatCompletionContentPart>, role_name?: string): void;
|
|
75
|
+
appendReplyHeader(role: Role): void;
|
|
76
|
+
appendEmptyThinkingReplyHeader(role: Role, emptyThinkingBlockStr: string): void;
|
|
77
|
+
finishReply(message: string): void;
|
|
78
|
+
}
|
|
79
|
+
export declare function getConversation(conv_template: ConvTemplateConfig, conv_config?: Partial<ConvTemplateConfig>, isTextCompletion?: boolean): Conversation;
|
|
80
|
+
/**
|
|
81
|
+
* Compare the states of two conversation instances. Equality is defined as their getPromptArray()
|
|
82
|
+
* should return the exact same things, which is determined by fields: messages, function_string,
|
|
83
|
+
* use_function_calling, and override_system_message.
|
|
84
|
+
*
|
|
85
|
+
* @returns True if `convA` equals to `convB`
|
|
86
|
+
* @note We assume convA and convB has the same `this.config`.
|
|
87
|
+
*/
|
|
88
|
+
export declare function compareConversationObject(convA: Conversation, convB: Conversation): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Get a new Conversation object based on the chat completion request.
|
|
91
|
+
*
|
|
92
|
+
* @param request The incoming ChatCompletionRequest
|
|
93
|
+
* @param includeLastMsg Include last message, by default is false. Set to true for testing only.
|
|
94
|
+
* @note By default, `request.messages[-1]` is not included as it would be treated as a normal
|
|
95
|
+
* input to `prefill()`.
|
|
96
|
+
*/
|
|
97
|
+
export declare function getConversationFromChatCompletionRequest(request: ChatCompletionRequest, config: ChatConfig, includeLastMsg?: boolean): Conversation;
|
|
98
|
+
/**
|
|
99
|
+
* Returns the function string based on the request.tools and request.tool_choice, raises erros if
|
|
100
|
+
* encounter invalid request.
|
|
101
|
+
*
|
|
102
|
+
* @param request The chatCompletionRequest we are about to prefill for.
|
|
103
|
+
* @returns The string used to set Conversation.function_string
|
|
104
|
+
*/
|
|
105
|
+
export declare function getFunctionCallUsage(request: ChatCompletionRequest): string;
|
|
106
|
+
export {};
|
|
107
|
+
//# sourceMappingURL=conversation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../src/conversation.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,kBAAkB,EAElB,IAAI,EACL,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,yBAAyB,EACzB,8BAA8B,EAE9B,qBAAqB,EACtB,MAAM,8BAA8B,CAAC;AAetC,KAAK,QAAQ,GAAG,8BAA8B,CAAC,QAAQ,CAAC;AAExD;;GAEG;AACH,qBAAa,YAAY;IAEvB;;OAEG;IACI,QAAQ,EAAE,KAAK,CACpB;QAAC,IAAI;QAAE,MAAM;QAAE,MAAM,GAAG,KAAK,CAAC,yBAAyB,CAAC,GAAG,SAAS;KAAC,CACtE,CAAM;IACP,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;IAEpC,mGAAmG;IAC5F,gBAAgB,EAAE,OAAO,CAAC;IACjC,yCAAyC;IAClC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAE3B,eAAe,SAAM;IACrB,oBAAoB,UAAS;IAC7B,uBAAuB,CAAC,EAAE,MAAM,CAAa;IAEpD;;;;OAIG;IACH,OAAO,CAAC,qCAAqC,CAAS;gBAK1C,MAAM,EAAE,kBAAkB,EAAE,gBAAgB,UAAQ;IAMhE,OAAO,CAAC,sBAAsB;IAmJ9B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,cAAc,IAAI,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,GAAG,QAAQ,CAAC,CAAC;IAO1D;;;;;;;OAOG;IACH,uBAAuB;IAUvB;;OAEG;IACH,4BAA4B,IAAI,KAAK,CAAC,MAAM,CAAC;IAO7C;;OAEG;IACH,KAAK;IAUL,UAAU,IAAI,MAAM,EAAE;IAStB,aAAa;IAIb,aAAa,CACX,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,yBAAyB,CAAC,EAClD,SAAS,CAAC,EAAE,MAAM;IAkBpB,iBAAiB,CAAC,IAAI,EAAE,IAAI;IAU5B,8BAA8B,CAAC,IAAI,EAAE,IAAI,EAAE,qBAAqB,EAAE,MAAM;IAUxE,WAAW,CAAC,OAAO,EAAE,MAAM;CAkB5B;AAED,wBAAgB,eAAe,CAC7B,aAAa,EAAE,kBAAkB,EACjC,WAAW,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,EACzC,gBAAgB,UAAQ,GACvB,YAAY,CAMd;AAED;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,YAAY,EACnB,KAAK,EAAE,YAAY,GAClB,OAAO,CA0ET;AAED;;;;;;;GAOG;AACH,wBAAgB,wCAAwC,CACtD,OAAO,EAAE,qBAAqB,EAC9B,MAAM,EAAE,UAAU,EAClB,cAAc,UAAQ,GACrB,YAAY,CA8Cd;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,qBAAqB,GAAG,MAAM,CAwC3E"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as tvmjs from "@mlc-ai/web-runtime";
|
|
2
|
+
import { Tokenizer } from "@mlc-ai/web-tokenizers";
|
|
3
|
+
import { ChatConfig } from "./config";
|
|
4
|
+
export declare class EmbeddingPipeline {
|
|
5
|
+
private config;
|
|
6
|
+
private tokenizer;
|
|
7
|
+
private tvm;
|
|
8
|
+
private device;
|
|
9
|
+
private vm;
|
|
10
|
+
private prefill;
|
|
11
|
+
private params;
|
|
12
|
+
private contextWindowSize;
|
|
13
|
+
private prefillChunkSize;
|
|
14
|
+
private maxBatchSize;
|
|
15
|
+
private curRoundEmbedTotalTokens;
|
|
16
|
+
private curRoundEmbedTotalTime;
|
|
17
|
+
constructor(tvm: tvmjs.Instance, tokenizer: Tokenizer, config: ChatConfig);
|
|
18
|
+
embedStep(input: string | Array<string> | Array<number> | Array<Array<number>>): Promise<Array<Array<number>>>;
|
|
19
|
+
dispose(): void;
|
|
20
|
+
/**
|
|
21
|
+
* Synchronize the device.
|
|
22
|
+
*/
|
|
23
|
+
sync(): Promise<void>;
|
|
24
|
+
asyncLoadWebGPUPipelines(): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Get the time it took the last `embedStep()` in seconds.
|
|
27
|
+
*/
|
|
28
|
+
getCurRoundEmbedTotalTime(): number;
|
|
29
|
+
/**
|
|
30
|
+
* Get the number of tokens embedded in the last `embedStep()`. This excludes the padded tokens.
|
|
31
|
+
*/
|
|
32
|
+
getCurRoundEmbedTotalTokens(): number;
|
|
33
|
+
/**
|
|
34
|
+
* @returns Prefill tokens per second, starting from the last prefill performed.
|
|
35
|
+
*/
|
|
36
|
+
getCurRoundEmbedTokensPerSec(): number;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=embedding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embedding.d.ts","sourceRoot":"","sources":["../src/embedding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAStC,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,SAAS,CAAY;IAG7B,OAAO,CAAC,GAAG,CAAiB;IAC5B,OAAO,CAAC,MAAM,CAAiB;IAC/B,OAAO,CAAC,EAAE,CAAuB;IACjC,OAAO,CAAC,OAAO,CAAmB;IAClC,OAAO,CAAC,MAAM,CAAkB;IAGhC,OAAO,CAAC,iBAAiB,CAAM;IAC/B,OAAO,CAAC,gBAAgB,CAAM;IAC9B,OAAO,CAAC,YAAY,CAAM;IAG1B,OAAO,CAAC,wBAAwB,CAAK;IACrC,OAAO,CAAC,sBAAsB,CAAK;gBAEvB,GAAG,EAAE,KAAK,CAAC,QAAQ,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU;IA8DnE,SAAS,CACb,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GACnE,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IA2JhC,OAAO;IAQP;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAKrB,wBAAwB;IAM9B;;OAEG;IACH,yBAAyB,IAAI,MAAM;IAInC;;OAEG;IACH,2BAA2B,IAAI,MAAM;IAIrC;;OAEG;IACH,4BAA4B,IAAI,MAAM;CAGvC"}
|
package/lib/engine.d.ts
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { ChatConfig, ChatOptions, AppConfig, GenerationConfig, MLCEngineConfig } from "./config";
|
|
2
|
+
import { LLMChatPipeline } from "./llm_chat";
|
|
3
|
+
import { ChatCompletionRequest, ChatCompletion, ChatCompletionChunk, ChatCompletionRequestNonStreaming, ChatCompletionRequestStreaming, ChatCompletionRequestBase, CompletionCreateParamsNonStreaming, CompletionCreateParamsStreaming, CompletionCreateParamsBase, CompletionCreateParams, Completion, EmbeddingCreateParams, CreateEmbeddingResponse } from "./openai_api_protocols/index";
|
|
4
|
+
import * as API from "./openai_api_protocols/index";
|
|
5
|
+
import { InitProgressCallback, MLCEngineInterface, LogitProcessor, LogLevel } from "./types";
|
|
6
|
+
/**
|
|
7
|
+
* Creates `MLCEngine`, and loads `modelId` onto WebGPU.
|
|
8
|
+
*
|
|
9
|
+
* Equivalent to `new webllm.MLCEngine().reload(...)`.
|
|
10
|
+
*
|
|
11
|
+
* @param modelId model_id of the model to load, either string or string[]. When multiple models
|
|
12
|
+
* are provided, we load all models sequentially. Each modelId needs to either be in
|
|
13
|
+
* `webllm.prebuiltAppConfig`, or in `engineCOnfig.appConfig`.
|
|
14
|
+
* @param engineConfig Optionally configures the engine, see `webllm.MLCEngineConfig`.
|
|
15
|
+
* @param chatOpts Extra options to optionally override the `mlc-chat-config.json` of `modelId`.
|
|
16
|
+
* The size of which needs to match that of `modelId`; chatOpts[i] will be used for modelId[i].
|
|
17
|
+
* @returns An initialized `WebLLM.MLCEngine` with `modelId` loaded.
|
|
18
|
+
* @throws Throws error when device lost (mostly due to OOM); users should re-call `CreateMLCEngine()`,
|
|
19
|
+
* potentially with a smaller model or smaller context window size.
|
|
20
|
+
*/
|
|
21
|
+
export declare function CreateMLCEngine(modelId: string | string[], engineConfig?: MLCEngineConfig, chatOpts?: ChatOptions | ChatOptions[]): Promise<MLCEngine>;
|
|
22
|
+
/**
|
|
23
|
+
* The main interface of MLCEngine, which loads a model and performs tasks.
|
|
24
|
+
*
|
|
25
|
+
* You can either initialize one with `webllm.CreateMLCEngine(modelId)`, or
|
|
26
|
+
* `webllm.MLCEngine().reload(modelId)`.
|
|
27
|
+
*/
|
|
28
|
+
export declare class MLCEngine implements MLCEngineInterface {
|
|
29
|
+
/** For chat.completions.create() */
|
|
30
|
+
chat: API.Chat;
|
|
31
|
+
/** For completions.create() */
|
|
32
|
+
completions: API.Completions;
|
|
33
|
+
/** For embeddings.create() */
|
|
34
|
+
embeddings: API.Embeddings;
|
|
35
|
+
/** Maps each loaded model's modelId to its pipeline */
|
|
36
|
+
private loadedModelIdToPipeline;
|
|
37
|
+
/** Maps each loaded model's modelId to its chatConfig */
|
|
38
|
+
private loadedModelIdToChatConfig;
|
|
39
|
+
/** Maps each loaded model's modelId to its modelType */
|
|
40
|
+
private loadedModelIdToModelType;
|
|
41
|
+
/** Maps each loaded model's modelId to a lock. Ensures
|
|
42
|
+
* each model only processes one request at at time.
|
|
43
|
+
*/
|
|
44
|
+
private loadedModelIdToLock;
|
|
45
|
+
private logger;
|
|
46
|
+
private logitProcessorRegistry?;
|
|
47
|
+
private initProgressCallback?;
|
|
48
|
+
private appConfig;
|
|
49
|
+
private interruptSignal;
|
|
50
|
+
private deviceLostIsError;
|
|
51
|
+
private reloadController;
|
|
52
|
+
constructor(engineConfig?: MLCEngineConfig);
|
|
53
|
+
setAppConfig(appConfig: AppConfig): void;
|
|
54
|
+
setInitProgressCallback(initProgressCallback?: InitProgressCallback): void;
|
|
55
|
+
getInitProgressCallback(): InitProgressCallback | undefined;
|
|
56
|
+
setLogitProcessorRegistry(logitProcessorRegistry?: Map<string, LogitProcessor>): void;
|
|
57
|
+
/**
|
|
58
|
+
* Set MLCEngine logging output level
|
|
59
|
+
*
|
|
60
|
+
* @param logLevel The new log level
|
|
61
|
+
*/
|
|
62
|
+
setLogLevel(logLevel: LogLevel): void;
|
|
63
|
+
reload(modelId: string | string[], chatOpts?: ChatOptions | ChatOptions[]): Promise<void>;
|
|
64
|
+
private reloadInternal;
|
|
65
|
+
unload(): Promise<void>;
|
|
66
|
+
private _generate;
|
|
67
|
+
/**
|
|
68
|
+
* Similar to `_generate()`; but instead of using callback, we use an async iterable.
|
|
69
|
+
*/
|
|
70
|
+
asyncGenerate(request: ChatCompletionRequestStreaming, model: string, pipeline: LLMChatPipeline, chatConfig: ChatConfig, genConfig: GenerationConfig, timeReceived: number): AsyncGenerator<ChatCompletionChunk, void, void>;
|
|
71
|
+
asyncGenerate(request: CompletionCreateParamsStreaming, model: string, pipeline: LLMChatPipeline, chatConfig: ChatConfig, genConfig: GenerationConfig, timeReceived: number): AsyncGenerator<Completion, void, void>;
|
|
72
|
+
interruptGenerate(): Promise<void>;
|
|
73
|
+
/**
|
|
74
|
+
* Completes a single ChatCompletionRequest.
|
|
75
|
+
*
|
|
76
|
+
* @param request A OpenAI-style ChatCompletion request.
|
|
77
|
+
*
|
|
78
|
+
* @note For each choice (i.e. `n`), a request is defined by a single `prefill()` and multiple
|
|
79
|
+
* `decode()`. This is important as it determines the behavior of various fields including `seed`.
|
|
80
|
+
*/
|
|
81
|
+
chatCompletion(request: ChatCompletionRequestNonStreaming): Promise<ChatCompletion>;
|
|
82
|
+
chatCompletion(request: ChatCompletionRequestStreaming): Promise<AsyncIterable<ChatCompletionChunk>>;
|
|
83
|
+
chatCompletion(request: ChatCompletionRequestBase): Promise<AsyncIterable<ChatCompletionChunk> | ChatCompletion>;
|
|
84
|
+
/**
|
|
85
|
+
* Completes a single CompletionCreateParams, a text completion with no chat template.
|
|
86
|
+
*
|
|
87
|
+
* @param request A OpenAI-style Completion request.
|
|
88
|
+
*
|
|
89
|
+
* @note For each choice (i.e. `n`), a request is defined by a single `prefill()` and multiple
|
|
90
|
+
* `decode()`. This is important as it determines the behavior of various fields including `seed`.
|
|
91
|
+
*/
|
|
92
|
+
completion(request: CompletionCreateParamsNonStreaming): Promise<Completion>;
|
|
93
|
+
completion(request: CompletionCreateParamsStreaming): Promise<AsyncIterable<Completion>>;
|
|
94
|
+
completion(request: CompletionCreateParamsBase): Promise<AsyncIterable<Completion> | Completion>;
|
|
95
|
+
embedding(request: EmbeddingCreateParams): Promise<CreateEmbeddingResponse>;
|
|
96
|
+
getMaxStorageBufferBindingSize(): Promise<number>;
|
|
97
|
+
getGPUVendor(): Promise<string>;
|
|
98
|
+
private getLLMStates;
|
|
99
|
+
private getEmbeddingStates;
|
|
100
|
+
/**
|
|
101
|
+
* Return the model, its LLMChatPipeline, and ChatConfig to use. Throws error when unclear which
|
|
102
|
+
* model to load. Ensure all loadedModelIdToXXX maps contain entry for the selected modelId.
|
|
103
|
+
* @param requestName The type of request or API to load the model for. Needed for error throwing.
|
|
104
|
+
* @param modelType The typ of model, determining what type of pipeline to expect.
|
|
105
|
+
* @param modelId Model the user specified to load via the request. Required when multiple
|
|
106
|
+
* models are loaded
|
|
107
|
+
*/
|
|
108
|
+
private getModelStates;
|
|
109
|
+
forwardTokensAndSample(inputIds: Array<number>, isPrefill: boolean, modelId?: string): Promise<number>;
|
|
110
|
+
/**
|
|
111
|
+
* Get the current generated response.
|
|
112
|
+
*
|
|
113
|
+
* @returns The current output message.
|
|
114
|
+
*/
|
|
115
|
+
getMessage(modelId?: string): Promise<string>;
|
|
116
|
+
runtimeStatsText(modelId?: string): Promise<string>;
|
|
117
|
+
resetChat(keepStats?: boolean, modelId?: string): Promise<void>;
|
|
118
|
+
/**
|
|
119
|
+
* Run a prefill step with a given input.
|
|
120
|
+
*
|
|
121
|
+
* If `input` is a chatCompletionRequest, we treat `input.messages[-1]` as the usual user input.
|
|
122
|
+
* We then convert `input.messages[:-1]` to a `Conversation` object, representing a conversation
|
|
123
|
+
* history.
|
|
124
|
+
*
|
|
125
|
+
* If the new `Conversation` object matches the current one loaded, it means we are
|
|
126
|
+
* performing multi-round chatting, so we do not reset, hence reusing KV cache. Otherwise, we
|
|
127
|
+
* reset every thing, treating the request as something completely new.
|
|
128
|
+
*
|
|
129
|
+
* @param input The OpenAI-style prompt to prefill.
|
|
130
|
+
* @param pipeline The loaded pipeline, hence model, to carry out this prefill.
|
|
131
|
+
* @param chatConfig The chat config to use for this model.
|
|
132
|
+
* @param genConfig Generation config.
|
|
133
|
+
*/
|
|
134
|
+
prefill(input: ChatCompletionRequest | CompletionCreateParams, pipeline: LLMChatPipeline, chatConfig: ChatConfig, genConfig: GenerationConfig): Promise<void>;
|
|
135
|
+
/**
|
|
136
|
+
* Run a decode step to decode the next token.
|
|
137
|
+
*/
|
|
138
|
+
decode(pipeline: LLMChatPipeline, genConfig?: GenerationConfig): Promise<void>;
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=engine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../src/engine.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,UAAU,EACV,WAAW,EACX,SAAS,EAGT,gBAAgB,EAGhB,eAAe,EAGhB,MAAM,UAAU,CAAC;AAClB,OAAO,EAA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