@exulu/backend 5.5.1 → 5.7.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/dist/{chunk-ZWFL6YUH.js → chunk-TAXHJJ5R.js} +176 -11
- package/dist/{convert-exulu-tools-to-ai-sdk-tools-C5LYP4UN.js → convert-exulu-tools-to-ai-sdk-tools-BPZSN22N.js} +1 -1
- package/dist/index.cjs +2071 -587
- package/dist/index.d.cts +12 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +1679 -390
- package/ee/queues/import-queue.ts +27 -0
- package/ee/queues/prune-job-results.test.ts +105 -1
- package/ee/queues/prune-job-results.ts +85 -9
- package/ee/queues/queues.ts +1 -0
- package/ee/tokenizer.test.ts +178 -0
- package/ee/tokenizer.ts +80 -6
- package/ee/workers.ts +173 -2
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1500,7 +1500,19 @@ type TokenizerModelName = keyof typeof models;
|
|
|
1500
1500
|
declare class ExuluTokenizer {
|
|
1501
1501
|
constructor();
|
|
1502
1502
|
encoder: Tiktoken | null;
|
|
1503
|
+
/** Remembered so `ensure()` can rebuild an encoder that `free()` released. */
|
|
1504
|
+
private modelName;
|
|
1503
1505
|
create(modelName: TokenizerModelName): Promise<Tiktoken>;
|
|
1506
|
+
/**
|
|
1507
|
+
* The encoder, rebuilt if a previous `chunk()` freed it.
|
|
1508
|
+
*
|
|
1509
|
+
* Both chunkers free their tokenizer at the end of every `chunk()`, so an
|
|
1510
|
+
* instance that is used twice — directly, or via `chunkBatch`, which calls
|
|
1511
|
+
* `chunk()` once per text — needs its encoder back. Rebuilding is cheap:
|
|
1512
|
+
* the ranks are already cached process-wide, so this costs a `Tiktoken`
|
|
1513
|
+
* construction and no network.
|
|
1514
|
+
*/
|
|
1515
|
+
ensure(): Promise<Tiktoken>;
|
|
1504
1516
|
decode(tokens: Uint32Array): Promise<string>;
|
|
1505
1517
|
decodeBatch(tokenSequences: Uint32Array[]): Promise<string[]>;
|
|
1506
1518
|
encode(text: string): Uint32Array;
|
package/dist/index.d.ts
CHANGED
|
@@ -1500,7 +1500,19 @@ type TokenizerModelName = keyof typeof models;
|
|
|
1500
1500
|
declare class ExuluTokenizer {
|
|
1501
1501
|
constructor();
|
|
1502
1502
|
encoder: Tiktoken | null;
|
|
1503
|
+
/** Remembered so `ensure()` can rebuild an encoder that `free()` released. */
|
|
1504
|
+
private modelName;
|
|
1503
1505
|
create(modelName: TokenizerModelName): Promise<Tiktoken>;
|
|
1506
|
+
/**
|
|
1507
|
+
* The encoder, rebuilt if a previous `chunk()` freed it.
|
|
1508
|
+
*
|
|
1509
|
+
* Both chunkers free their tokenizer at the end of every `chunk()`, so an
|
|
1510
|
+
* instance that is used twice — directly, or via `chunkBatch`, which calls
|
|
1511
|
+
* `chunk()` once per text — needs its encoder back. Rebuilding is cheap:
|
|
1512
|
+
* the ranks are already cached process-wide, so this costs a `Tiktoken`
|
|
1513
|
+
* construction and no network.
|
|
1514
|
+
*/
|
|
1515
|
+
ensure(): Promise<Tiktoken>;
|
|
1504
1516
|
decode(tokens: Uint32Array): Promise<string>;
|
|
1505
1517
|
decodeBatch(tokenSequences: Uint32Array[]): Promise<string[]>;
|
|
1506
1518
|
encode(text: string): Uint32Array;
|