@agorapete/wllama 3.5.1-q2.0
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/.gitmodules +3 -0
- package/.prettierignore +38 -0
- package/AGENTS.md +1 -0
- package/CMakeLists.txt +131 -0
- package/LICENCE +21 -0
- package/README-dev.md +178 -0
- package/README.md +225 -0
- package/README_banner.png +0 -0
- package/assets/screenshot_0.png +0 -0
- package/cpp/generate_glue_prototype.js +115 -0
- package/cpp/glue.hpp +664 -0
- package/cpp/test_glue.cpp +80 -0
- package/cpp/wllama-context.h +1172 -0
- package/cpp/wllama-fs.h +148 -0
- package/cpp/wllama.cpp +187 -0
- package/cpp/wllama.h +6 -0
- package/esm/cache-manager.d.ts +130 -0
- package/esm/debug.d.ts +28 -0
- package/esm/glue/glue.d.ts +22 -0
- package/esm/glue/messages.d.ts +146 -0
- package/esm/huggingface.d.ts +31 -0
- package/esm/index.cjs +3406 -0
- package/esm/index.d.ts +8 -0
- package/esm/index.js +3387 -0
- package/esm/index.min.js +1 -0
- package/esm/index.min.js.map +1 -0
- package/esm/model-manager.d.ts +136 -0
- package/esm/storage/cos.d.ts +36 -0
- package/esm/storage/index.d.ts +33 -0
- package/esm/storage/opfs.d.ts +12 -0
- package/esm/types/oai-compat.d.ts +278 -0
- package/esm/types/types.d.ts +112 -0
- package/esm/utils.d.ts +119 -0
- package/esm/wasm/source-map.d.ts +1 -0
- package/esm/wasm/wllama.wasm +0 -0
- package/esm/wasm-from-cdn.d.ts +8 -0
- package/esm/wllama.d.ts +397 -0
- package/esm/worker.d.ts +92 -0
- package/esm/workers-code/generated.d.ts +4 -0
- package/guides/intro-v2.md +132 -0
- package/guides/intro-v3.1.md +40 -0
- package/guides/intro-v3.md +230 -0
- package/index.ts +1 -0
- package/package.json +71 -0
- package/scripts/bisect_test.sh +33 -0
- package/scripts/build_hf_space.sh +26 -0
- package/scripts/build_source_map.js +269 -0
- package/scripts/build_wasm.sh +19 -0
- package/scripts/build_worker.sh +38 -0
- package/scripts/check_debug_build.js +30 -0
- package/scripts/check_package_size.js +25 -0
- package/scripts/docker-compose.yml +76 -0
- package/scripts/generate_wasm_from_cdn.js +24 -0
- package/scripts/http_server.js +44 -0
- package/scripts/post_build.sh +32 -0
- package/src/cache-manager.ts +358 -0
- package/src/debug.ts +111 -0
- package/src/glue/glue.ts +291 -0
- package/src/glue/messages.ts +773 -0
- package/src/huggingface.ts +151 -0
- package/src/index.ts +8 -0
- package/src/mjs.test.ts +44 -0
- package/src/model-manager.test.ts +200 -0
- package/src/model-manager.ts +359 -0
- package/src/storage/cos.test.ts +83 -0
- package/src/storage/cos.ts +171 -0
- package/src/storage/index.ts +40 -0
- package/src/storage/opfs.ts +119 -0
- package/src/types/oai-compat.ts +342 -0
- package/src/types/types.ts +133 -0
- package/src/utils.test.ts +231 -0
- package/src/utils.ts +403 -0
- package/src/wasm/source-map.ts +7 -0
- package/src/wasm/wllama.js +1 -0
- package/src/wasm/wllama.wasm +0 -0
- package/src/wasm-from-cdn.ts +13 -0
- package/src/wllama.test.ts +392 -0
- package/src/wllama.ts +1138 -0
- package/src/wllama.wgpu.test.ts +62 -0
- package/src/worker.ts +443 -0
- package/src/workers-code/generated.ts +11 -0
- package/src/workers-code/llama-cpp.js +511 -0
- package/src/workers-code/opfs-utils.js +150 -0
- package/tsconfig.build.json +34 -0
- package/tsup.config.ts +23 -0
- package/vitest.config.ts +61 -0
|
@@ -0,0 +1,773 @@
|
|
|
1
|
+
// This file is generated by cpp/generate_glue_prototype.js
|
|
2
|
+
// Do not edit this file directly
|
|
3
|
+
|
|
4
|
+
import type { GlueMessageProto } from './glue';
|
|
5
|
+
|
|
6
|
+
export const GLUE_VERSION = 1;
|
|
7
|
+
|
|
8
|
+
export const GLUE_MESSAGE_PROTOTYPES: { [name: string]: GlueMessageProto } = {
|
|
9
|
+
"erro_evt": {
|
|
10
|
+
"name": "erro_evt",
|
|
11
|
+
"structName": "glue_msg_error",
|
|
12
|
+
"className": "GlueMsgError",
|
|
13
|
+
"fields": [
|
|
14
|
+
{
|
|
15
|
+
"type": "str",
|
|
16
|
+
"name": "message",
|
|
17
|
+
"isNullable": false
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
"load_req": {
|
|
22
|
+
"name": "load_req",
|
|
23
|
+
"structName": "glue_msg_load_req",
|
|
24
|
+
"className": "GlueMsgLoadReq",
|
|
25
|
+
"fields": [
|
|
26
|
+
{
|
|
27
|
+
"type": "arr_str",
|
|
28
|
+
"name": "model_paths",
|
|
29
|
+
"isNullable": false
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"type": "str",
|
|
33
|
+
"name": "mmproj_path",
|
|
34
|
+
"isNullable": true
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"type": "bool",
|
|
38
|
+
"name": "n_ctx_auto",
|
|
39
|
+
"isNullable": false
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"type": "bool",
|
|
43
|
+
"name": "use_mmap",
|
|
44
|
+
"isNullable": false
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"type": "bool",
|
|
48
|
+
"name": "use_mlock",
|
|
49
|
+
"isNullable": false
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"type": "int",
|
|
53
|
+
"name": "n_gpu_layers",
|
|
54
|
+
"isNullable": false
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"type": "int",
|
|
58
|
+
"name": "n_ctx",
|
|
59
|
+
"isNullable": false
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"type": "int",
|
|
63
|
+
"name": "n_threads",
|
|
64
|
+
"isNullable": false
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"type": "str",
|
|
68
|
+
"name": "model_alias",
|
|
69
|
+
"isNullable": true
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"type": "int",
|
|
73
|
+
"name": "log_level",
|
|
74
|
+
"isNullable": true
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"type": "bool",
|
|
78
|
+
"name": "embeddings",
|
|
79
|
+
"isNullable": true
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"type": "bool",
|
|
83
|
+
"name": "offload_kqv",
|
|
84
|
+
"isNullable": true
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"type": "int",
|
|
88
|
+
"name": "n_batch",
|
|
89
|
+
"isNullable": true
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"type": "int",
|
|
93
|
+
"name": "n_ubatch",
|
|
94
|
+
"isNullable": true
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"type": "int",
|
|
98
|
+
"name": "n_parallel",
|
|
99
|
+
"isNullable": true
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"type": "str",
|
|
103
|
+
"name": "pooling_type",
|
|
104
|
+
"isNullable": true
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"type": "str",
|
|
108
|
+
"name": "rope_scaling_type",
|
|
109
|
+
"isNullable": true
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"type": "float",
|
|
113
|
+
"name": "rope_freq_base",
|
|
114
|
+
"isNullable": true
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"type": "float",
|
|
118
|
+
"name": "rope_freq_scale",
|
|
119
|
+
"isNullable": true
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"type": "float",
|
|
123
|
+
"name": "yarn_ext_factor",
|
|
124
|
+
"isNullable": true
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"type": "float",
|
|
128
|
+
"name": "yarn_attn_factor",
|
|
129
|
+
"isNullable": true
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"type": "float",
|
|
133
|
+
"name": "yarn_beta_fast",
|
|
134
|
+
"isNullable": true
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
"type": "float",
|
|
138
|
+
"name": "yarn_beta_slow",
|
|
139
|
+
"isNullable": true
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"type": "int",
|
|
143
|
+
"name": "yarn_orig_ctx",
|
|
144
|
+
"isNullable": true
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"type": "str",
|
|
148
|
+
"name": "cache_type_k",
|
|
149
|
+
"isNullable": true
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"type": "str",
|
|
153
|
+
"name": "cache_type_v",
|
|
154
|
+
"isNullable": true
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"type": "bool",
|
|
158
|
+
"name": "kv_unified",
|
|
159
|
+
"isNullable": true
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"type": "bool",
|
|
163
|
+
"name": "flash_attn",
|
|
164
|
+
"isNullable": true
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
"type": "bool",
|
|
168
|
+
"name": "swa_full",
|
|
169
|
+
"isNullable": true
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"type": "int",
|
|
173
|
+
"name": "n_ctx_checkpoints",
|
|
174
|
+
"isNullable": true
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"type": "int",
|
|
178
|
+
"name": "checkpoint_min_step",
|
|
179
|
+
"isNullable": true
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"type": "str",
|
|
183
|
+
"name": "chat_template",
|
|
184
|
+
"isNullable": true
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"type": "bool",
|
|
188
|
+
"name": "jinja",
|
|
189
|
+
"isNullable": true
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"type": "arr_str",
|
|
193
|
+
"name": "default_template_kwargs_keys",
|
|
194
|
+
"isNullable": true
|
|
195
|
+
},
|
|
196
|
+
{
|
|
197
|
+
"type": "arr_str",
|
|
198
|
+
"name": "default_template_kwargs_vals",
|
|
199
|
+
"isNullable": true
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"type": "bool",
|
|
203
|
+
"name": "reasoning",
|
|
204
|
+
"isNullable": true
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"type": "int",
|
|
208
|
+
"name": "image_min_tokens",
|
|
209
|
+
"isNullable": true
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"type": "int",
|
|
213
|
+
"name": "image_max_tokens",
|
|
214
|
+
"isNullable": true
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"type": "bool",
|
|
218
|
+
"name": "warmup",
|
|
219
|
+
"isNullable": true
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"type": "bool",
|
|
223
|
+
"name": "no_kv_offload",
|
|
224
|
+
"isNullable": true
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"type": "bool",
|
|
228
|
+
"name": "mmproj_offload",
|
|
229
|
+
"isNullable": true
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
"type": "bool",
|
|
233
|
+
"name": "cont_batching",
|
|
234
|
+
"isNullable": true
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
"type": "int",
|
|
238
|
+
"name": "n_keep",
|
|
239
|
+
"isNullable": true
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"type": "bool",
|
|
243
|
+
"name": "ctx_shift",
|
|
244
|
+
"isNullable": true
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
"type": "bool",
|
|
248
|
+
"name": "cache_idle_slots",
|
|
249
|
+
"isNullable": true
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"type": "int",
|
|
253
|
+
"name": "n_cache_reuse",
|
|
254
|
+
"isNullable": true
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"type": "arr_str",
|
|
258
|
+
"name": "lora_paths",
|
|
259
|
+
"isNullable": true
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
"type": "arr_float",
|
|
263
|
+
"name": "lora_scales",
|
|
264
|
+
"isNullable": true
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"type": "bool",
|
|
268
|
+
"name": "lora_init_without_apply",
|
|
269
|
+
"isNullable": true
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"type": "str",
|
|
273
|
+
"name": "spec_draft_model",
|
|
274
|
+
"isNullable": true
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
"type": "int",
|
|
278
|
+
"name": "spec_draft_ngl",
|
|
279
|
+
"isNullable": true
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
"type": "int",
|
|
283
|
+
"name": "spec_draft_n_max",
|
|
284
|
+
"isNullable": true
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"type": "int",
|
|
288
|
+
"name": "spec_draft_n_min",
|
|
289
|
+
"isNullable": true
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
"type": "float",
|
|
293
|
+
"name": "spec_draft_p_min",
|
|
294
|
+
"isNullable": true
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
"type": "int",
|
|
298
|
+
"name": "spec_draft_threads",
|
|
299
|
+
"isNullable": true
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"type": "int",
|
|
303
|
+
"name": "spec_draft_threads_batch",
|
|
304
|
+
"isNullable": true
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"type": "arr_str",
|
|
308
|
+
"name": "kv_overrides_keys",
|
|
309
|
+
"isNullable": true
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
"type": "arr_str",
|
|
313
|
+
"name": "kv_overrides_vals",
|
|
314
|
+
"isNullable": true
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"type": "int",
|
|
318
|
+
"name": "reasoning_budget_tokens",
|
|
319
|
+
"isNullable": true
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
"type": "str",
|
|
323
|
+
"name": "reasoning_budget_message",
|
|
324
|
+
"isNullable": true
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
"type": "str",
|
|
328
|
+
"name": "reasoning_format",
|
|
329
|
+
"isNullable": true
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"type": "bool",
|
|
333
|
+
"name": "skip_chat_parsing",
|
|
334
|
+
"isNullable": true
|
|
335
|
+
},
|
|
336
|
+
{
|
|
337
|
+
"type": "bool",
|
|
338
|
+
"name": "prefill_assistant",
|
|
339
|
+
"isNullable": true
|
|
340
|
+
}
|
|
341
|
+
]
|
|
342
|
+
},
|
|
343
|
+
"load_res": {
|
|
344
|
+
"name": "load_res",
|
|
345
|
+
"structName": "glue_msg_load_res",
|
|
346
|
+
"className": "GlueMsgLoadRes",
|
|
347
|
+
"fields": [
|
|
348
|
+
{
|
|
349
|
+
"type": "bool",
|
|
350
|
+
"name": "success",
|
|
351
|
+
"isNullable": false
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
"type": "int",
|
|
355
|
+
"name": "n_ctx",
|
|
356
|
+
"isNullable": false
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
"type": "int",
|
|
360
|
+
"name": "n_batch",
|
|
361
|
+
"isNullable": false
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
"type": "int",
|
|
365
|
+
"name": "n_ubatch",
|
|
366
|
+
"isNullable": false
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"type": "int",
|
|
370
|
+
"name": "n_vocab",
|
|
371
|
+
"isNullable": false
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
"type": "int",
|
|
375
|
+
"name": "n_ctx_train",
|
|
376
|
+
"isNullable": false
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
"type": "int",
|
|
380
|
+
"name": "n_embd",
|
|
381
|
+
"isNullable": false
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
"type": "int",
|
|
385
|
+
"name": "n_layer",
|
|
386
|
+
"isNullable": false
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
"type": "arr_str",
|
|
390
|
+
"name": "metadata_key",
|
|
391
|
+
"isNullable": false
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
"type": "arr_str",
|
|
395
|
+
"name": "metadata_val",
|
|
396
|
+
"isNullable": false
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
"type": "int",
|
|
400
|
+
"name": "token_bos",
|
|
401
|
+
"isNullable": false
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
"type": "int",
|
|
405
|
+
"name": "token_eos",
|
|
406
|
+
"isNullable": false
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
"type": "int",
|
|
410
|
+
"name": "token_eot",
|
|
411
|
+
"isNullable": false
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
"type": "arr_int",
|
|
415
|
+
"name": "list_tokens_eog",
|
|
416
|
+
"isNullable": false
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
"type": "bool",
|
|
420
|
+
"name": "add_bos_token",
|
|
421
|
+
"isNullable": false
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
"type": "bool",
|
|
425
|
+
"name": "add_eos_token",
|
|
426
|
+
"isNullable": false
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
"type": "bool",
|
|
430
|
+
"name": "has_encoder",
|
|
431
|
+
"isNullable": false
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
"type": "int",
|
|
435
|
+
"name": "token_decoder_start",
|
|
436
|
+
"isNullable": false
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
"type": "str",
|
|
440
|
+
"name": "media_marker",
|
|
441
|
+
"isNullable": false
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
"type": "bool",
|
|
445
|
+
"name": "has_image_input",
|
|
446
|
+
"isNullable": false
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
"type": "bool",
|
|
450
|
+
"name": "has_audio_input",
|
|
451
|
+
"isNullable": false
|
|
452
|
+
}
|
|
453
|
+
]
|
|
454
|
+
},
|
|
455
|
+
"cmpl_req": {
|
|
456
|
+
"name": "cmpl_req",
|
|
457
|
+
"structName": "glue_msg_completion_req",
|
|
458
|
+
"className": "GlueMsgCompletionReq",
|
|
459
|
+
"fields": [
|
|
460
|
+
{
|
|
461
|
+
"type": "bool",
|
|
462
|
+
"name": "is_chat",
|
|
463
|
+
"isNullable": false
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
"type": "str",
|
|
467
|
+
"name": "data_json",
|
|
468
|
+
"isNullable": false
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
"type": "arr_raw",
|
|
472
|
+
"name": "files",
|
|
473
|
+
"isNullable": false
|
|
474
|
+
}
|
|
475
|
+
]
|
|
476
|
+
},
|
|
477
|
+
"cmpl_res": {
|
|
478
|
+
"name": "cmpl_res",
|
|
479
|
+
"structName": "glue_msg_completion_res",
|
|
480
|
+
"className": "GlueMsgCompletionRes",
|
|
481
|
+
"fields": [
|
|
482
|
+
{
|
|
483
|
+
"type": "bool",
|
|
484
|
+
"name": "success",
|
|
485
|
+
"isNullable": false
|
|
486
|
+
}
|
|
487
|
+
]
|
|
488
|
+
},
|
|
489
|
+
"embd_req": {
|
|
490
|
+
"name": "embd_req",
|
|
491
|
+
"structName": "glue_msg_embedding_req",
|
|
492
|
+
"className": "GlueMsgEmbeddingReq",
|
|
493
|
+
"fields": [
|
|
494
|
+
{
|
|
495
|
+
"type": "str",
|
|
496
|
+
"name": "data_json",
|
|
497
|
+
"isNullable": false
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
"type": "arr_raw",
|
|
501
|
+
"name": "files",
|
|
502
|
+
"isNullable": false
|
|
503
|
+
}
|
|
504
|
+
]
|
|
505
|
+
},
|
|
506
|
+
"embd_res": {
|
|
507
|
+
"name": "embd_res",
|
|
508
|
+
"structName": "glue_msg_embedding_res",
|
|
509
|
+
"className": "GlueMsgEmbeddingRes",
|
|
510
|
+
"fields": [
|
|
511
|
+
{
|
|
512
|
+
"type": "bool",
|
|
513
|
+
"name": "success",
|
|
514
|
+
"isNullable": false
|
|
515
|
+
}
|
|
516
|
+
]
|
|
517
|
+
},
|
|
518
|
+
"rrnk_req": {
|
|
519
|
+
"name": "rrnk_req",
|
|
520
|
+
"structName": "glue_msg_rerank_req",
|
|
521
|
+
"className": "GlueMsgRerankReq",
|
|
522
|
+
"fields": [
|
|
523
|
+
{
|
|
524
|
+
"type": "str",
|
|
525
|
+
"name": "data_json",
|
|
526
|
+
"isNullable": false
|
|
527
|
+
}
|
|
528
|
+
]
|
|
529
|
+
},
|
|
530
|
+
"rrnk_res": {
|
|
531
|
+
"name": "rrnk_res",
|
|
532
|
+
"structName": "glue_msg_rerank_res",
|
|
533
|
+
"className": "GlueMsgRerankRes",
|
|
534
|
+
"fields": [
|
|
535
|
+
{
|
|
536
|
+
"type": "bool",
|
|
537
|
+
"name": "success",
|
|
538
|
+
"isNullable": false
|
|
539
|
+
}
|
|
540
|
+
]
|
|
541
|
+
},
|
|
542
|
+
"gres_req": {
|
|
543
|
+
"name": "gres_req",
|
|
544
|
+
"structName": "glue_msg_get_result_req",
|
|
545
|
+
"className": "GlueMsgGetResultReq",
|
|
546
|
+
"fields": []
|
|
547
|
+
},
|
|
548
|
+
"gres_res": {
|
|
549
|
+
"name": "gres_res",
|
|
550
|
+
"structName": "glue_msg_get_result_res",
|
|
551
|
+
"className": "GlueMsgGetResultRes",
|
|
552
|
+
"fields": [
|
|
553
|
+
{
|
|
554
|
+
"type": "bool",
|
|
555
|
+
"name": "success",
|
|
556
|
+
"isNullable": false
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
"type": "bool",
|
|
560
|
+
"name": "has_more",
|
|
561
|
+
"isNullable": false
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
"type": "bool",
|
|
565
|
+
"name": "is_error",
|
|
566
|
+
"isNullable": false
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
"type": "str",
|
|
570
|
+
"name": "data_json",
|
|
571
|
+
"isNullable": false
|
|
572
|
+
}
|
|
573
|
+
]
|
|
574
|
+
},
|
|
575
|
+
"tbop_req": {
|
|
576
|
+
"name": "tbop_req",
|
|
577
|
+
"structName": "glue_msg_test_backend_ops_req",
|
|
578
|
+
"className": "GlueMsgTestBackendOpsReq",
|
|
579
|
+
"fields": [
|
|
580
|
+
{
|
|
581
|
+
"type": "arr_str",
|
|
582
|
+
"name": "args",
|
|
583
|
+
"isNullable": false
|
|
584
|
+
}
|
|
585
|
+
]
|
|
586
|
+
},
|
|
587
|
+
"tbop_res": {
|
|
588
|
+
"name": "tbop_res",
|
|
589
|
+
"structName": "glue_msg_test_backend_ops_res",
|
|
590
|
+
"className": "GlueMsgTestBackendOpsRes",
|
|
591
|
+
"fields": [
|
|
592
|
+
{
|
|
593
|
+
"type": "int",
|
|
594
|
+
"name": "retcode",
|
|
595
|
+
"isNullable": false
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
"type": "bool",
|
|
599
|
+
"name": "success",
|
|
600
|
+
"isNullable": false
|
|
601
|
+
}
|
|
602
|
+
]
|
|
603
|
+
}
|
|
604
|
+
};
|
|
605
|
+
|
|
606
|
+
// struct glue_msg_error
|
|
607
|
+
export interface GlueMsgError {
|
|
608
|
+
_name: "erro_evt";
|
|
609
|
+
message: string;
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
// struct glue_msg_load_req
|
|
613
|
+
export interface GlueMsgLoadReq {
|
|
614
|
+
_name: "load_req";
|
|
615
|
+
model_paths: string[];
|
|
616
|
+
mmproj_path?: string | undefined;
|
|
617
|
+
n_ctx_auto: boolean;
|
|
618
|
+
use_mmap: boolean;
|
|
619
|
+
use_mlock: boolean;
|
|
620
|
+
n_gpu_layers: number;
|
|
621
|
+
n_ctx: number;
|
|
622
|
+
n_threads: number;
|
|
623
|
+
model_alias?: string | undefined;
|
|
624
|
+
log_level?: number | undefined;
|
|
625
|
+
embeddings?: boolean | undefined;
|
|
626
|
+
offload_kqv?: boolean | undefined;
|
|
627
|
+
n_batch?: number | undefined;
|
|
628
|
+
n_ubatch?: number | undefined;
|
|
629
|
+
n_parallel?: number | undefined;
|
|
630
|
+
pooling_type?: string | undefined;
|
|
631
|
+
rope_scaling_type?: string | undefined;
|
|
632
|
+
rope_freq_base?: number | undefined;
|
|
633
|
+
rope_freq_scale?: number | undefined;
|
|
634
|
+
yarn_ext_factor?: number | undefined;
|
|
635
|
+
yarn_attn_factor?: number | undefined;
|
|
636
|
+
yarn_beta_fast?: number | undefined;
|
|
637
|
+
yarn_beta_slow?: number | undefined;
|
|
638
|
+
yarn_orig_ctx?: number | undefined;
|
|
639
|
+
cache_type_k?: string | undefined;
|
|
640
|
+
cache_type_v?: string | undefined;
|
|
641
|
+
kv_unified?: boolean | undefined;
|
|
642
|
+
flash_attn?: boolean | undefined;
|
|
643
|
+
swa_full?: boolean | undefined;
|
|
644
|
+
n_ctx_checkpoints?: number | undefined;
|
|
645
|
+
checkpoint_min_step?: number | undefined;
|
|
646
|
+
chat_template?: string | undefined;
|
|
647
|
+
jinja?: boolean | undefined;
|
|
648
|
+
default_template_kwargs_keys?: string[] | undefined;
|
|
649
|
+
default_template_kwargs_vals?: string[] | undefined;
|
|
650
|
+
reasoning?: boolean | undefined;
|
|
651
|
+
image_min_tokens?: number | undefined;
|
|
652
|
+
image_max_tokens?: number | undefined;
|
|
653
|
+
warmup?: boolean | undefined;
|
|
654
|
+
no_kv_offload?: boolean | undefined;
|
|
655
|
+
mmproj_offload?: boolean | undefined;
|
|
656
|
+
cont_batching?: boolean | undefined;
|
|
657
|
+
n_keep?: number | undefined;
|
|
658
|
+
ctx_shift?: boolean | undefined;
|
|
659
|
+
cache_idle_slots?: boolean | undefined;
|
|
660
|
+
n_cache_reuse?: number | undefined;
|
|
661
|
+
lora_paths?: string[] | undefined;
|
|
662
|
+
lora_scales?: number[] | undefined;
|
|
663
|
+
lora_init_without_apply?: boolean | undefined;
|
|
664
|
+
spec_draft_model?: string | undefined;
|
|
665
|
+
spec_draft_ngl?: number | undefined;
|
|
666
|
+
spec_draft_n_max?: number | undefined;
|
|
667
|
+
spec_draft_n_min?: number | undefined;
|
|
668
|
+
spec_draft_p_min?: number | undefined;
|
|
669
|
+
spec_draft_threads?: number | undefined;
|
|
670
|
+
spec_draft_threads_batch?: number | undefined;
|
|
671
|
+
kv_overrides_keys?: string[] | undefined;
|
|
672
|
+
kv_overrides_vals?: string[] | undefined;
|
|
673
|
+
reasoning_budget_tokens?: number | undefined;
|
|
674
|
+
reasoning_budget_message?: string | undefined;
|
|
675
|
+
reasoning_format?: string | undefined;
|
|
676
|
+
skip_chat_parsing?: boolean | undefined;
|
|
677
|
+
prefill_assistant?: boolean | undefined;
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
// struct glue_msg_load_res
|
|
681
|
+
export interface GlueMsgLoadRes {
|
|
682
|
+
_name: "load_res";
|
|
683
|
+
success: boolean;
|
|
684
|
+
n_ctx: number;
|
|
685
|
+
n_batch: number;
|
|
686
|
+
n_ubatch: number;
|
|
687
|
+
n_vocab: number;
|
|
688
|
+
n_ctx_train: number;
|
|
689
|
+
n_embd: number;
|
|
690
|
+
n_layer: number;
|
|
691
|
+
metadata_key: string[];
|
|
692
|
+
metadata_val: string[];
|
|
693
|
+
token_bos: number;
|
|
694
|
+
token_eos: number;
|
|
695
|
+
token_eot: number;
|
|
696
|
+
list_tokens_eog: number[];
|
|
697
|
+
add_bos_token: boolean;
|
|
698
|
+
add_eos_token: boolean;
|
|
699
|
+
has_encoder: boolean;
|
|
700
|
+
token_decoder_start: number;
|
|
701
|
+
media_marker: string;
|
|
702
|
+
has_image_input: boolean;
|
|
703
|
+
has_audio_input: boolean;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
// struct glue_msg_completion_req
|
|
707
|
+
export interface GlueMsgCompletionReq {
|
|
708
|
+
_name: "cmpl_req";
|
|
709
|
+
is_chat: boolean;
|
|
710
|
+
data_json: string;
|
|
711
|
+
files: Uint8Array[];
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
// struct glue_msg_completion_res
|
|
715
|
+
export interface GlueMsgCompletionRes {
|
|
716
|
+
_name: "cmpl_res";
|
|
717
|
+
success: boolean;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
// struct glue_msg_embedding_req
|
|
721
|
+
export interface GlueMsgEmbeddingReq {
|
|
722
|
+
_name: "embd_req";
|
|
723
|
+
data_json: string;
|
|
724
|
+
files: Uint8Array[];
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
// struct glue_msg_embedding_res
|
|
728
|
+
export interface GlueMsgEmbeddingRes {
|
|
729
|
+
_name: "embd_res";
|
|
730
|
+
success: boolean;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
// struct glue_msg_rerank_req
|
|
734
|
+
export interface GlueMsgRerankReq {
|
|
735
|
+
_name: "rrnk_req";
|
|
736
|
+
data_json: string;
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
// struct glue_msg_rerank_res
|
|
740
|
+
export interface GlueMsgRerankRes {
|
|
741
|
+
_name: "rrnk_res";
|
|
742
|
+
success: boolean;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
// struct glue_msg_get_result_req
|
|
746
|
+
export interface GlueMsgGetResultReq {
|
|
747
|
+
_name: "gres_req";
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
// struct glue_msg_get_result_res
|
|
751
|
+
export interface GlueMsgGetResultRes {
|
|
752
|
+
_name: "gres_res";
|
|
753
|
+
success: boolean;
|
|
754
|
+
has_more: boolean;
|
|
755
|
+
is_error: boolean;
|
|
756
|
+
data_json: string;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
// struct glue_msg_test_backend_ops_req
|
|
760
|
+
export interface GlueMsgTestBackendOpsReq {
|
|
761
|
+
_name: "tbop_req";
|
|
762
|
+
args: string[];
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
// struct glue_msg_test_backend_ops_res
|
|
766
|
+
export interface GlueMsgTestBackendOpsRes {
|
|
767
|
+
_name: "tbop_res";
|
|
768
|
+
retcode: number;
|
|
769
|
+
success: boolean;
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
|
|
773
|
+
export type GlueMsg = GlueMsgError | GlueMsgLoadReq | GlueMsgLoadRes | GlueMsgCompletionReq | GlueMsgCompletionRes | GlueMsgEmbeddingReq | GlueMsgEmbeddingRes | GlueMsgRerankReq | GlueMsgRerankRes | GlueMsgGetResultReq | GlueMsgGetResultRes | GlueMsgTestBackendOpsReq | GlueMsgTestBackendOpsRes;
|