@ruvector/edge-full 0.1.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/LICENSE +21 -0
- package/README.md +390 -0
- package/dag/ruvector_dag_wasm.d.ts +105 -0
- package/dag/ruvector_dag_wasm.js +466 -0
- package/dag/ruvector_dag_wasm_bg.wasm +0 -0
- package/dag/ruvector_dag_wasm_bg.wasm.d.ts +20 -0
- package/edge/ruvector_edge.d.ts +351 -0
- package/edge/ruvector_edge.js +1452 -0
- package/edge/ruvector_edge_bg.wasm +0 -0
- package/edge/ruvector_edge_bg.wasm.d.ts +71 -0
- package/generator.html +2009 -0
- package/graph/ruvector_graph_wasm.d.ts +380 -0
- package/graph/ruvector_graph_wasm.js +1787 -0
- package/graph/ruvector_graph_wasm_bg.wasm +0 -0
- package/graph/ruvector_graph_wasm_bg.wasm.d.ts +80 -0
- package/index.d.ts +64 -0
- package/index.js +182 -0
- package/onnx/ruvector_onnx_embeddings_wasm.d.ts +112 -0
- package/onnx/ruvector_onnx_embeddings_wasm.js +635 -0
- package/onnx/ruvector_onnx_embeddings_wasm_bg.js +629 -0
- package/onnx/ruvector_onnx_embeddings_wasm_bg.wasm +0 -0
- package/onnx/ruvector_onnx_embeddings_wasm_bg.wasm.d.ts +29 -0
- package/package.json +86 -0
- package/rvlite/rvlite.d.ts +556 -0
- package/rvlite/rvlite.js +2366 -0
- package/rvlite/rvlite_bg.wasm +0 -0
- package/rvlite/rvlite_bg.wasm.d.ts +128 -0
- package/sona/ruvector_sona.d.ts +513 -0
- package/sona/ruvector_sona.js +1290 -0
- package/sona/ruvector_sona_bg.wasm +0 -0
- package/sona/ruvector_sona_bg.wasm.d.ts +53 -0
package/package.json
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ruvector/edge-full",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Complete WASM toolkit for edge AI: vector search, graph DB, neural networks, DAG workflows, SQL/SPARQL/Cypher, and ONNX inference - all running in browser",
|
|
6
|
+
"main": "index.js",
|
|
7
|
+
"module": "index.js",
|
|
8
|
+
"types": "index.d.ts",
|
|
9
|
+
"keywords": [
|
|
10
|
+
"wasm",
|
|
11
|
+
"rust",
|
|
12
|
+
"ai",
|
|
13
|
+
"edge",
|
|
14
|
+
"browser",
|
|
15
|
+
"vector-search",
|
|
16
|
+
"hnsw",
|
|
17
|
+
"graph-database",
|
|
18
|
+
"cypher",
|
|
19
|
+
"sparql",
|
|
20
|
+
"sql",
|
|
21
|
+
"neural-network",
|
|
22
|
+
"onnx",
|
|
23
|
+
"embeddings",
|
|
24
|
+
"dag",
|
|
25
|
+
"workflow",
|
|
26
|
+
"post-quantum",
|
|
27
|
+
"cryptography",
|
|
28
|
+
"consensus",
|
|
29
|
+
"raft",
|
|
30
|
+
"p2p",
|
|
31
|
+
"swarm"
|
|
32
|
+
],
|
|
33
|
+
"author": "RuVector Team",
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "https://github.com/ruvnet/ruvector"
|
|
38
|
+
},
|
|
39
|
+
"homepage": "https://github.com/ruvnet/ruvector/tree/main/examples/edge-full",
|
|
40
|
+
"bugs": {
|
|
41
|
+
"url": "https://github.com/ruvnet/ruvector/issues"
|
|
42
|
+
},
|
|
43
|
+
"files": [
|
|
44
|
+
"index.js",
|
|
45
|
+
"index.d.ts",
|
|
46
|
+
"edge/",
|
|
47
|
+
"graph/",
|
|
48
|
+
"rvlite/",
|
|
49
|
+
"sona/",
|
|
50
|
+
"dag/",
|
|
51
|
+
"onnx/",
|
|
52
|
+
"generator.html",
|
|
53
|
+
"LICENSE"
|
|
54
|
+
],
|
|
55
|
+
"exports": {
|
|
56
|
+
".": {
|
|
57
|
+
"import": "./index.js",
|
|
58
|
+
"types": "./index.d.ts"
|
|
59
|
+
},
|
|
60
|
+
"./edge": {
|
|
61
|
+
"import": "./edge/ruvector_edge.js",
|
|
62
|
+
"types": "./edge/ruvector_edge.d.ts"
|
|
63
|
+
},
|
|
64
|
+
"./graph": {
|
|
65
|
+
"import": "./graph/ruvector_graph_wasm.js",
|
|
66
|
+
"types": "./graph/ruvector_graph_wasm.d.ts"
|
|
67
|
+
},
|
|
68
|
+
"./rvlite": {
|
|
69
|
+
"import": "./rvlite/rvlite.js",
|
|
70
|
+
"types": "./rvlite/rvlite.d.ts"
|
|
71
|
+
},
|
|
72
|
+
"./sona": {
|
|
73
|
+
"import": "./sona/ruvector_sona.js",
|
|
74
|
+
"types": "./sona/ruvector_sona.d.ts"
|
|
75
|
+
},
|
|
76
|
+
"./dag": {
|
|
77
|
+
"import": "./dag/ruvector_dag_wasm.js",
|
|
78
|
+
"types": "./dag/ruvector_dag_wasm.d.ts"
|
|
79
|
+
},
|
|
80
|
+
"./onnx": {
|
|
81
|
+
"import": "./onnx/ruvector_onnx_embeddings_wasm.js",
|
|
82
|
+
"types": "./onnx/ruvector_onnx_embeddings_wasm.d.ts"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"sideEffects": false
|
|
86
|
+
}
|
|
@@ -0,0 +1,556 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
export class BaseLoRA {
|
|
5
|
+
free(): void;
|
|
6
|
+
[Symbol.dispose](): void;
|
|
7
|
+
distillFrom(micro: MicroLoRA, blend_factor: number): void;
|
|
8
|
+
applyGradients(): void;
|
|
9
|
+
constructor(config: LoraConfig);
|
|
10
|
+
stats(): any;
|
|
11
|
+
forward(input: Float32Array): Float32Array;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export class Embedder {
|
|
15
|
+
free(): void;
|
|
16
|
+
[Symbol.dispose](): void;
|
|
17
|
+
/**
|
|
18
|
+
* Get embedding dimensions
|
|
19
|
+
*/
|
|
20
|
+
dimensions(): number;
|
|
21
|
+
/**
|
|
22
|
+
* Compute similarity between two texts
|
|
23
|
+
*/
|
|
24
|
+
similarity(text_a: string, text_b: string): number;
|
|
25
|
+
/**
|
|
26
|
+
* Batch embed multiple texts
|
|
27
|
+
* Takes JsValue array of strings, returns JsValue array of Float32Arrays
|
|
28
|
+
*/
|
|
29
|
+
embed_batch(texts: any): any;
|
|
30
|
+
/**
|
|
31
|
+
* Create embedder with custom config
|
|
32
|
+
*/
|
|
33
|
+
static with_config(config: EmbeddingConfig): Embedder;
|
|
34
|
+
/**
|
|
35
|
+
* Compute cosine similarity between two embeddings (JS arrays)
|
|
36
|
+
*/
|
|
37
|
+
static cosine_similarity(a: Float32Array, b: Float32Array): number;
|
|
38
|
+
/**
|
|
39
|
+
* Create a new embedder with default config
|
|
40
|
+
*/
|
|
41
|
+
constructor();
|
|
42
|
+
/**
|
|
43
|
+
* Generate embeddings for a single text
|
|
44
|
+
* Uses hash-based projection for lightweight WASM operation
|
|
45
|
+
* Returns Float32Array for direct JS consumption
|
|
46
|
+
*/
|
|
47
|
+
embed(text: string): Float32Array;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export class EmbeddingConfig {
|
|
51
|
+
free(): void;
|
|
52
|
+
[Symbol.dispose](): void;
|
|
53
|
+
/**
|
|
54
|
+
* Create config for larger models
|
|
55
|
+
*/
|
|
56
|
+
static with_dimensions(dimensions: number): EmbeddingConfig;
|
|
57
|
+
constructor();
|
|
58
|
+
/**
|
|
59
|
+
* Create config for all-MiniLM-L6-v2 (default)
|
|
60
|
+
*/
|
|
61
|
+
static minilm(): EmbeddingConfig;
|
|
62
|
+
/**
|
|
63
|
+
* Model dimensions (384 for all-MiniLM-L6-v2)
|
|
64
|
+
*/
|
|
65
|
+
dimensions: number;
|
|
66
|
+
/**
|
|
67
|
+
* Normalize output vectors
|
|
68
|
+
*/
|
|
69
|
+
normalize: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Max sequence length
|
|
72
|
+
*/
|
|
73
|
+
max_length: number;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export class LoraConfig {
|
|
77
|
+
free(): void;
|
|
78
|
+
[Symbol.dispose](): void;
|
|
79
|
+
/**
|
|
80
|
+
* Create custom LoRA configuration
|
|
81
|
+
*/
|
|
82
|
+
constructor(hidden_dim: number, rank: number, alpha: number, learning_rate: number);
|
|
83
|
+
/**
|
|
84
|
+
* Create BaseLoRA configuration (background training)
|
|
85
|
+
*/
|
|
86
|
+
static base(hidden_dim: number): LoraConfig;
|
|
87
|
+
/**
|
|
88
|
+
* Create MicroLoRA configuration (per-request, <100μs)
|
|
89
|
+
*/
|
|
90
|
+
static micro(hidden_dim: number): LoraConfig;
|
|
91
|
+
/**
|
|
92
|
+
* Export as JSON
|
|
93
|
+
*/
|
|
94
|
+
toJSON(): any;
|
|
95
|
+
/**
|
|
96
|
+
* Validate configuration
|
|
97
|
+
*/
|
|
98
|
+
validate(): void;
|
|
99
|
+
/**
|
|
100
|
+
* LoRA rank (1-2 for micro, 4-16 for base)
|
|
101
|
+
*/
|
|
102
|
+
readonly rank: number;
|
|
103
|
+
/**
|
|
104
|
+
* Alpha scaling factor
|
|
105
|
+
*/
|
|
106
|
+
readonly alpha: number;
|
|
107
|
+
/**
|
|
108
|
+
* Learning rate for adaptation
|
|
109
|
+
*/
|
|
110
|
+
readonly learning_rate: number;
|
|
111
|
+
/**
|
|
112
|
+
* Hidden dimension
|
|
113
|
+
*/
|
|
114
|
+
readonly hidden_dim: number;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export class MicroLoRA {
|
|
118
|
+
free(): void;
|
|
119
|
+
[Symbol.dispose](): void;
|
|
120
|
+
exportWeights(): any;
|
|
121
|
+
applyGradients(): void;
|
|
122
|
+
accumulateGradient(input: Float32Array, feedback: number): void;
|
|
123
|
+
constructor(config: LoraConfig);
|
|
124
|
+
reset(): void;
|
|
125
|
+
stats(): any;
|
|
126
|
+
forward(input: Float32Array): Float32Array;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export class RvLite {
|
|
130
|
+
free(): void;
|
|
131
|
+
[Symbol.dispose](): void;
|
|
132
|
+
/**
|
|
133
|
+
* Get configuration
|
|
134
|
+
*/
|
|
135
|
+
get_config(): any;
|
|
136
|
+
/**
|
|
137
|
+
* Get version string
|
|
138
|
+
*/
|
|
139
|
+
get_version(): string;
|
|
140
|
+
/**
|
|
141
|
+
* Get enabled features
|
|
142
|
+
*/
|
|
143
|
+
get_features(): any;
|
|
144
|
+
/**
|
|
145
|
+
* Insert a vector with a specific ID
|
|
146
|
+
*/
|
|
147
|
+
insert_with_id(id: string, vector: Float32Array, metadata?: any | null): void;
|
|
148
|
+
/**
|
|
149
|
+
* Search with metadata filter
|
|
150
|
+
*/
|
|
151
|
+
search_with_filter(query_vector: Float32Array, k: number, filter: any): any;
|
|
152
|
+
/**
|
|
153
|
+
* Get a vector by ID
|
|
154
|
+
*/
|
|
155
|
+
get(id: string): any;
|
|
156
|
+
/**
|
|
157
|
+
* Get the number of vectors in the database
|
|
158
|
+
*/
|
|
159
|
+
len(): number;
|
|
160
|
+
/**
|
|
161
|
+
* Create a new RvLite database
|
|
162
|
+
*/
|
|
163
|
+
constructor(config: RvLiteConfig);
|
|
164
|
+
/**
|
|
165
|
+
* Execute SQL query (not yet implemented)
|
|
166
|
+
*/
|
|
167
|
+
sql(_query: string): Promise<any>;
|
|
168
|
+
/**
|
|
169
|
+
* Execute Cypher query (not yet implemented)
|
|
170
|
+
*/
|
|
171
|
+
cypher(_query: string): Promise<any>;
|
|
172
|
+
/**
|
|
173
|
+
* Delete a vector by ID
|
|
174
|
+
*/
|
|
175
|
+
delete(id: string): boolean;
|
|
176
|
+
/**
|
|
177
|
+
* Insert a vector with optional metadata
|
|
178
|
+
* Returns the vector ID
|
|
179
|
+
*/
|
|
180
|
+
insert(vector: Float32Array, metadata?: any | null): string;
|
|
181
|
+
/**
|
|
182
|
+
* Search for similar vectors
|
|
183
|
+
* Returns a JavaScript array of search results
|
|
184
|
+
*/
|
|
185
|
+
search(query_vector: Float32Array, k: number): any;
|
|
186
|
+
/**
|
|
187
|
+
* Execute SPARQL query (not yet implemented)
|
|
188
|
+
*/
|
|
189
|
+
sparql(_query: string): Promise<any>;
|
|
190
|
+
/**
|
|
191
|
+
* Create with default configuration (384 dimensions, cosine similarity)
|
|
192
|
+
*/
|
|
193
|
+
static default(): RvLite;
|
|
194
|
+
/**
|
|
195
|
+
* Check if database is empty
|
|
196
|
+
*/
|
|
197
|
+
is_empty(): boolean;
|
|
198
|
+
/**
|
|
199
|
+
* Check if database is ready
|
|
200
|
+
*/
|
|
201
|
+
is_ready(): boolean;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export class RvLiteConfig {
|
|
205
|
+
free(): void;
|
|
206
|
+
[Symbol.dispose](): void;
|
|
207
|
+
/**
|
|
208
|
+
* Set distance metric (euclidean, cosine, dotproduct, manhattan)
|
|
209
|
+
*/
|
|
210
|
+
with_distance_metric(metric: string): RvLiteConfig;
|
|
211
|
+
constructor(dimensions: number);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
export class TrmConfig {
|
|
215
|
+
free(): void;
|
|
216
|
+
[Symbol.dispose](): void;
|
|
217
|
+
/**
|
|
218
|
+
* Enable/disable attention variant
|
|
219
|
+
*/
|
|
220
|
+
withAttention(use_attention: boolean): TrmConfig;
|
|
221
|
+
/**
|
|
222
|
+
* Set default K iterations
|
|
223
|
+
*/
|
|
224
|
+
withDefaultK(k: number): TrmConfig;
|
|
225
|
+
/**
|
|
226
|
+
* Enable/disable early stopping
|
|
227
|
+
*/
|
|
228
|
+
withEarlyStopping(enabled: boolean): TrmConfig;
|
|
229
|
+
/**
|
|
230
|
+
* Set latent iterations per K step
|
|
231
|
+
*/
|
|
232
|
+
withLatentIterations(n: number): TrmConfig;
|
|
233
|
+
/**
|
|
234
|
+
* Set confidence threshold
|
|
235
|
+
*/
|
|
236
|
+
withConfidenceThreshold(threshold: number): TrmConfig;
|
|
237
|
+
/**
|
|
238
|
+
* Create a new TRM configuration
|
|
239
|
+
*/
|
|
240
|
+
constructor(embedding_dim: number, hidden_dim: number, max_k: number);
|
|
241
|
+
/**
|
|
242
|
+
* Create configuration optimized for speed
|
|
243
|
+
*/
|
|
244
|
+
static fast(embedding_dim: number): TrmConfig;
|
|
245
|
+
/**
|
|
246
|
+
* Create configuration optimized for quality
|
|
247
|
+
*/
|
|
248
|
+
static quality(embedding_dim: number): TrmConfig;
|
|
249
|
+
/**
|
|
250
|
+
* Export configuration as JSON
|
|
251
|
+
*/
|
|
252
|
+
toJSON(): any;
|
|
253
|
+
/**
|
|
254
|
+
* Create balanced configuration (recommended)
|
|
255
|
+
*/
|
|
256
|
+
static balanced(embedding_dim: number): TrmConfig;
|
|
257
|
+
/**
|
|
258
|
+
* Validate configuration
|
|
259
|
+
*/
|
|
260
|
+
validate(): void;
|
|
261
|
+
/**
|
|
262
|
+
* Import configuration from JSON
|
|
263
|
+
*/
|
|
264
|
+
static fromJSON(value: any): TrmConfig;
|
|
265
|
+
/**
|
|
266
|
+
* Embedding dimension (input/output size)
|
|
267
|
+
*/
|
|
268
|
+
readonly embedding_dim: number;
|
|
269
|
+
/**
|
|
270
|
+
* Hidden dimension for latent state
|
|
271
|
+
*/
|
|
272
|
+
readonly hidden_dim: number;
|
|
273
|
+
/**
|
|
274
|
+
* Maximum K iterations
|
|
275
|
+
*/
|
|
276
|
+
readonly max_k: number;
|
|
277
|
+
/**
|
|
278
|
+
* Default K iterations
|
|
279
|
+
*/
|
|
280
|
+
readonly default_k: number;
|
|
281
|
+
/**
|
|
282
|
+
* Latent updates per K iteration
|
|
283
|
+
*/
|
|
284
|
+
readonly latent_iterations: number;
|
|
285
|
+
/**
|
|
286
|
+
* Use attention variant (more expressive, slower)
|
|
287
|
+
*/
|
|
288
|
+
readonly use_attention: boolean;
|
|
289
|
+
/**
|
|
290
|
+
* Number of attention heads
|
|
291
|
+
*/
|
|
292
|
+
readonly num_heads: number;
|
|
293
|
+
/**
|
|
294
|
+
* Confidence threshold for early stopping
|
|
295
|
+
*/
|
|
296
|
+
readonly confidence_threshold: number;
|
|
297
|
+
/**
|
|
298
|
+
* Enable early stopping
|
|
299
|
+
*/
|
|
300
|
+
readonly early_stopping: boolean;
|
|
301
|
+
/**
|
|
302
|
+
* Minimum iterations before early stopping
|
|
303
|
+
*/
|
|
304
|
+
readonly min_iterations: number;
|
|
305
|
+
/**
|
|
306
|
+
* Convergence threshold for plateau detection
|
|
307
|
+
*/
|
|
308
|
+
readonly convergence_threshold: number;
|
|
309
|
+
/**
|
|
310
|
+
* Residual scale for answer refinement
|
|
311
|
+
*/
|
|
312
|
+
readonly residual_scale: number;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
export class TrmEngine {
|
|
316
|
+
free(): void;
|
|
317
|
+
[Symbol.dispose](): void;
|
|
318
|
+
getConfig(): any;
|
|
319
|
+
reasonWithK(question: Float32Array, answer: Float32Array, k: number): TrmResult;
|
|
320
|
+
constructor(config: TrmConfig);
|
|
321
|
+
reset(): void;
|
|
322
|
+
stats(): any;
|
|
323
|
+
reason(question: Float32Array, answer: Float32Array): TrmResult;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
export class TrmResult {
|
|
327
|
+
private constructor();
|
|
328
|
+
free(): void;
|
|
329
|
+
[Symbol.dispose](): void;
|
|
330
|
+
getAnswer(): Float32Array;
|
|
331
|
+
toJSON(): any;
|
|
332
|
+
readonly confidence: number;
|
|
333
|
+
readonly iterations_used: number;
|
|
334
|
+
readonly early_stopped: boolean;
|
|
335
|
+
readonly latency_ms: number;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Quick benchmark for embeddings
|
|
340
|
+
*/
|
|
341
|
+
export function benchmark_embeddings(iterations: number): any;
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* Quick benchmark function
|
|
345
|
+
*/
|
|
346
|
+
export function benchmark_trm(iterations: number, hidden_dim: number): any;
|
|
347
|
+
|
|
348
|
+
/**
|
|
349
|
+
* Compute cosine similarity
|
|
350
|
+
*/
|
|
351
|
+
export function cosineSimilarity(a: Float32Array, b: Float32Array): number;
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Dot product
|
|
355
|
+
*/
|
|
356
|
+
export function dotProduct(a: Float32Array, b: Float32Array): number;
|
|
357
|
+
|
|
358
|
+
/**
|
|
359
|
+
* Get feature info
|
|
360
|
+
*/
|
|
361
|
+
export function features(): any;
|
|
362
|
+
|
|
363
|
+
export function init(): void;
|
|
364
|
+
|
|
365
|
+
/**
|
|
366
|
+
* Compute L2 distance
|
|
367
|
+
*/
|
|
368
|
+
export function l2Distance(a: Float32Array, b: Float32Array): number;
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Linear interpolation
|
|
372
|
+
*/
|
|
373
|
+
export function lerp(a: Float32Array, b: Float32Array, t: number): Float32Array;
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Mean pooling for token embeddings
|
|
377
|
+
*/
|
|
378
|
+
export function meanPooling(embeddings: any, attention_mask?: Float32Array | null): Float32Array;
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* Normalize a vector to unit length
|
|
382
|
+
*/
|
|
383
|
+
export function normalizeVector(vec: Float32Array): Float32Array;
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* Create a random vector
|
|
387
|
+
*/
|
|
388
|
+
export function randomVector(dim: number, seed?: number | null): Float32Array;
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Softmax function
|
|
392
|
+
*/
|
|
393
|
+
export function softmax(vec: Float32Array): Float32Array;
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Get version string
|
|
397
|
+
*/
|
|
398
|
+
export function version(): string;
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* Create a zero vector
|
|
402
|
+
*/
|
|
403
|
+
export function zeros(dim: number): Float32Array;
|
|
404
|
+
|
|
405
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
406
|
+
|
|
407
|
+
export interface InitOutput {
|
|
408
|
+
readonly memory: WebAssembly.Memory;
|
|
409
|
+
readonly __wbg_baselora_free: (a: number, b: number) => void;
|
|
410
|
+
readonly __wbg_embedder_free: (a: number, b: number) => void;
|
|
411
|
+
readonly __wbg_embeddingconfig_free: (a: number, b: number) => void;
|
|
412
|
+
readonly __wbg_get_embeddingconfig_dimensions: (a: number) => number;
|
|
413
|
+
readonly __wbg_get_embeddingconfig_max_length: (a: number) => number;
|
|
414
|
+
readonly __wbg_get_embeddingconfig_normalize: (a: number) => number;
|
|
415
|
+
readonly __wbg_get_loraconfig_alpha: (a: number) => number;
|
|
416
|
+
readonly __wbg_get_loraconfig_hidden_dim: (a: number) => number;
|
|
417
|
+
readonly __wbg_get_loraconfig_learning_rate: (a: number) => number;
|
|
418
|
+
readonly __wbg_get_trmconfig_confidence_threshold: (a: number) => number;
|
|
419
|
+
readonly __wbg_get_trmconfig_convergence_threshold: (a: number) => number;
|
|
420
|
+
readonly __wbg_get_trmconfig_early_stopping: (a: number) => number;
|
|
421
|
+
readonly __wbg_get_trmconfig_latent_iterations: (a: number) => number;
|
|
422
|
+
readonly __wbg_get_trmconfig_max_k: (a: number) => number;
|
|
423
|
+
readonly __wbg_get_trmconfig_min_iterations: (a: number) => number;
|
|
424
|
+
readonly __wbg_get_trmconfig_num_heads: (a: number) => number;
|
|
425
|
+
readonly __wbg_get_trmconfig_residual_scale: (a: number) => number;
|
|
426
|
+
readonly __wbg_get_trmconfig_use_attention: (a: number) => number;
|
|
427
|
+
readonly __wbg_get_trmresult_confidence: (a: number) => number;
|
|
428
|
+
readonly __wbg_get_trmresult_early_stopped: (a: number) => number;
|
|
429
|
+
readonly __wbg_get_trmresult_iterations_used: (a: number) => number;
|
|
430
|
+
readonly __wbg_get_trmresult_latency_ms: (a: number) => number;
|
|
431
|
+
readonly __wbg_loraconfig_free: (a: number, b: number) => void;
|
|
432
|
+
readonly __wbg_microlora_free: (a: number, b: number) => void;
|
|
433
|
+
readonly __wbg_rvlite_free: (a: number, b: number) => void;
|
|
434
|
+
readonly __wbg_rvliteconfig_free: (a: number, b: number) => void;
|
|
435
|
+
readonly __wbg_set_embeddingconfig_dimensions: (a: number, b: number) => void;
|
|
436
|
+
readonly __wbg_set_embeddingconfig_max_length: (a: number, b: number) => void;
|
|
437
|
+
readonly __wbg_set_embeddingconfig_normalize: (a: number, b: number) => void;
|
|
438
|
+
readonly __wbg_trmconfig_free: (a: number, b: number) => void;
|
|
439
|
+
readonly __wbg_trmengine_free: (a: number, b: number) => void;
|
|
440
|
+
readonly __wbg_trmresult_free: (a: number, b: number) => void;
|
|
441
|
+
readonly baselora_applyGradients: (a: number) => void;
|
|
442
|
+
readonly baselora_distillFrom: (a: number, b: number, c: number, d: number) => void;
|
|
443
|
+
readonly baselora_forward: (a: number, b: number, c: number, d: number) => void;
|
|
444
|
+
readonly baselora_new: (a: number, b: number) => void;
|
|
445
|
+
readonly baselora_stats: (a: number) => number;
|
|
446
|
+
readonly benchmark_embeddings: (a: number) => number;
|
|
447
|
+
readonly benchmark_trm: (a: number, b: number) => number;
|
|
448
|
+
readonly cosineSimilarity: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
449
|
+
readonly dotProduct: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
450
|
+
readonly embedder_cosine_similarity: (a: number, b: number) => number;
|
|
451
|
+
readonly embedder_dimensions: (a: number) => number;
|
|
452
|
+
readonly embedder_embed: (a: number, b: number, c: number) => number;
|
|
453
|
+
readonly embedder_embed_batch: (a: number, b: number, c: number) => void;
|
|
454
|
+
readonly embedder_new: () => number;
|
|
455
|
+
readonly embedder_similarity: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
456
|
+
readonly embedder_with_config: (a: number) => number;
|
|
457
|
+
readonly embeddingconfig_minilm: () => number;
|
|
458
|
+
readonly embeddingconfig_with_dimensions: (a: number) => number;
|
|
459
|
+
readonly features: () => number;
|
|
460
|
+
readonly init: () => void;
|
|
461
|
+
readonly l2Distance: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
462
|
+
readonly lerp: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
463
|
+
readonly loraconfig_base: (a: number) => number;
|
|
464
|
+
readonly loraconfig_micro: (a: number) => number;
|
|
465
|
+
readonly loraconfig_new: (a: number, b: number, c: number, d: number) => number;
|
|
466
|
+
readonly loraconfig_toJSON: (a: number) => number;
|
|
467
|
+
readonly loraconfig_validate: (a: number, b: number) => void;
|
|
468
|
+
readonly meanPooling: (a: number, b: number, c: number, d: number) => void;
|
|
469
|
+
readonly microlora_accumulateGradient: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
470
|
+
readonly microlora_applyGradients: (a: number) => void;
|
|
471
|
+
readonly microlora_exportWeights: (a: number) => number;
|
|
472
|
+
readonly microlora_forward: (a: number, b: number, c: number, d: number) => void;
|
|
473
|
+
readonly microlora_new: (a: number, b: number) => void;
|
|
474
|
+
readonly microlora_reset: (a: number) => void;
|
|
475
|
+
readonly microlora_stats: (a: number) => number;
|
|
476
|
+
readonly normalizeVector: (a: number, b: number, c: number) => void;
|
|
477
|
+
readonly randomVector: (a: number, b: number, c: number) => void;
|
|
478
|
+
readonly rvlite_cypher: (a: number, b: number, c: number) => number;
|
|
479
|
+
readonly rvlite_default: (a: number) => void;
|
|
480
|
+
readonly rvlite_delete: (a: number, b: number, c: number, d: number) => void;
|
|
481
|
+
readonly rvlite_get: (a: number, b: number, c: number, d: number) => void;
|
|
482
|
+
readonly rvlite_get_config: (a: number, b: number) => void;
|
|
483
|
+
readonly rvlite_get_features: (a: number, b: number) => void;
|
|
484
|
+
readonly rvlite_get_version: (a: number, b: number) => void;
|
|
485
|
+
readonly rvlite_insert: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
486
|
+
readonly rvlite_insert_with_id: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
487
|
+
readonly rvlite_is_empty: (a: number, b: number) => void;
|
|
488
|
+
readonly rvlite_is_ready: (a: number) => number;
|
|
489
|
+
readonly rvlite_len: (a: number, b: number) => void;
|
|
490
|
+
readonly rvlite_new: (a: number, b: number) => void;
|
|
491
|
+
readonly rvlite_search: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
492
|
+
readonly rvlite_search_with_filter: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
493
|
+
readonly rvlite_sparql: (a: number, b: number, c: number) => number;
|
|
494
|
+
readonly rvlite_sql: (a: number, b: number, c: number) => number;
|
|
495
|
+
readonly rvliteconfig_new: (a: number) => number;
|
|
496
|
+
readonly rvliteconfig_with_distance_metric: (a: number, b: number, c: number) => number;
|
|
497
|
+
readonly softmax: (a: number, b: number, c: number) => void;
|
|
498
|
+
readonly trmconfig_balanced: (a: number) => number;
|
|
499
|
+
readonly trmconfig_fast: (a: number) => number;
|
|
500
|
+
readonly trmconfig_fromJSON: (a: number, b: number) => void;
|
|
501
|
+
readonly trmconfig_new: (a: number, b: number, c: number) => number;
|
|
502
|
+
readonly trmconfig_quality: (a: number) => number;
|
|
503
|
+
readonly trmconfig_toJSON: (a: number) => number;
|
|
504
|
+
readonly trmconfig_validate: (a: number, b: number) => void;
|
|
505
|
+
readonly trmconfig_withAttention: (a: number, b: number) => number;
|
|
506
|
+
readonly trmconfig_withConfidenceThreshold: (a: number, b: number) => number;
|
|
507
|
+
readonly trmconfig_withDefaultK: (a: number, b: number) => number;
|
|
508
|
+
readonly trmconfig_withEarlyStopping: (a: number, b: number) => number;
|
|
509
|
+
readonly trmconfig_withLatentIterations: (a: number, b: number) => number;
|
|
510
|
+
readonly trmengine_getConfig: (a: number) => number;
|
|
511
|
+
readonly trmengine_new: (a: number, b: number) => void;
|
|
512
|
+
readonly trmengine_reason: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
513
|
+
readonly trmengine_reasonWithK: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
514
|
+
readonly trmengine_reset: (a: number) => void;
|
|
515
|
+
readonly trmengine_stats: (a: number) => number;
|
|
516
|
+
readonly trmresult_getAnswer: (a: number, b: number) => void;
|
|
517
|
+
readonly trmresult_toJSON: (a: number) => number;
|
|
518
|
+
readonly version: (a: number) => void;
|
|
519
|
+
readonly zeros: (a: number, b: number) => void;
|
|
520
|
+
readonly embeddingconfig_new: () => number;
|
|
521
|
+
readonly __wbg_get_trmconfig_embedding_dim: (a: number) => number;
|
|
522
|
+
readonly __wbg_get_loraconfig_rank: (a: number) => number;
|
|
523
|
+
readonly __wbg_get_trmconfig_hidden_dim: (a: number) => number;
|
|
524
|
+
readonly __wbg_get_trmconfig_default_k: (a: number) => number;
|
|
525
|
+
readonly __wasm_bindgen_func_elem_690: (a: number, b: number, c: number) => void;
|
|
526
|
+
readonly __wasm_bindgen_func_elem_684: (a: number, b: number) => void;
|
|
527
|
+
readonly __wasm_bindgen_func_elem_1412: (a: number, b: number, c: number, d: number) => void;
|
|
528
|
+
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
529
|
+
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
530
|
+
readonly __wbindgen_export3: (a: number) => void;
|
|
531
|
+
readonly __wbindgen_export4: (a: number, b: number, c: number) => void;
|
|
532
|
+
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
533
|
+
readonly __wbindgen_start: () => void;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
537
|
+
|
|
538
|
+
/**
|
|
539
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
540
|
+
* a precompiled `WebAssembly.Module`.
|
|
541
|
+
*
|
|
542
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
543
|
+
*
|
|
544
|
+
* @returns {InitOutput}
|
|
545
|
+
*/
|
|
546
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
550
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
551
|
+
*
|
|
552
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
553
|
+
*
|
|
554
|
+
* @returns {Promise<InitOutput>}
|
|
555
|
+
*/
|
|
556
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|