@kreuzberg/liter-llm-node 1.4.0-rc.47 → 1.4.0-rc.50
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/README.md +7 -8
- package/index.d.ts +19 -16
- package/index.js +16 -45
- package/liter-llm-node.darwin-arm64.node +0 -0
- package/liter-llm-node.linux-arm64-gnu.node +0 -0
- package/liter-llm-node.linux-x64-gnu.node +0 -0
- package/liter-llm-node.win32-x64-msvc.node +0 -0
- package/package.json +17 -27
package/README.md
CHANGED
|
@@ -46,14 +46,13 @@
|
|
|
46
46
|
<img src="https://img.shields.io/badge/C-FFI-007ec6" alt="C FFI" />
|
|
47
47
|
</a>
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
49
|
+
<!-- Project Info -->
|
|
50
|
+
<a href="https://github.com/kreuzberg-dev/liter-llm/blob/main/LICENSE">
|
|
51
|
+
<img src="https://img.shields.io/badge/License-MIT-007ec6" alt="License" />
|
|
52
|
+
</a>
|
|
53
|
+
<a href="https://docs.liter-llm.kreuzberg.dev">
|
|
54
|
+
<img src="https://img.shields.io/badge/Docs-liter--llm-007ec6" alt="Docs" />
|
|
55
|
+
</a>
|
|
57
56
|
</div>
|
|
58
57
|
<div align="center" style="margin: 24px 0 0">
|
|
59
58
|
<a href="https://kreuzberg.dev">
|
package/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// This file is auto-generated by alef — DO NOT EDIT.
|
|
2
|
-
// alef:hash:
|
|
2
|
+
// alef:hash:6c204bbbede614a1caa53da02f18ba8ca12b2d6aa377eca70192e6a81cdb7999
|
|
3
3
|
// To regenerate: alef generate
|
|
4
4
|
// To verify freshness: alef verify --exit-code
|
|
5
|
-
// Issues & docs: https://github.com/
|
|
5
|
+
// Issues & docs: https://github.com/kreuzberg-dev/alef
|
|
6
6
|
/* eslint-disable */
|
|
7
7
|
|
|
8
8
|
export type JsonValue =
|
|
@@ -78,7 +78,10 @@ export declare function complexProviderNames(): Array<string>;
|
|
|
78
78
|
* @throws Returns [`LiterLlmError::BadRequest`] if the tokenizer cannot be loaded or
|
|
79
79
|
* if tokenization fails for any message.
|
|
80
80
|
*/
|
|
81
|
-
export declare function countRequestTokens(
|
|
81
|
+
export declare function countRequestTokens(
|
|
82
|
+
model: string,
|
|
83
|
+
req?: ChatCompletionRequest | undefined | null,
|
|
84
|
+
): number;
|
|
82
85
|
|
|
83
86
|
/**
|
|
84
87
|
* Count tokens in a text string using the tokenizer for the given model.
|
|
@@ -546,29 +549,29 @@ export interface CustomProviderConfig {
|
|
|
546
549
|
* headers are cached at construction to avoid redundant encoding on every request.
|
|
547
550
|
*/
|
|
548
551
|
export declare class DefaultClient {
|
|
549
|
-
chat(req
|
|
552
|
+
chat(req?: ChatCompletionRequest | undefined | null): Promise<ChatCompletionResponse>;
|
|
550
553
|
chatStream(
|
|
551
|
-
req
|
|
554
|
+
req?: ChatCompletionRequest | undefined | null,
|
|
552
555
|
): Promise<AsyncGenerator<ChatCompletionChunk, void, undefined>>;
|
|
553
|
-
embed(req
|
|
556
|
+
embed(req?: EmbeddingRequest | undefined | null): Promise<EmbeddingResponse>;
|
|
554
557
|
listModels(): Promise<ModelsListResponse>;
|
|
555
|
-
imageGenerate(req
|
|
556
|
-
speech(req
|
|
557
|
-
transcribe(req
|
|
558
|
-
moderate(req
|
|
559
|
-
rerank(req
|
|
560
|
-
search(req
|
|
561
|
-
ocr(req
|
|
562
|
-
createFile(req
|
|
558
|
+
imageGenerate(req?: CreateImageRequest | undefined | null): Promise<ImagesResponse>;
|
|
559
|
+
speech(req?: CreateSpeechRequest | undefined | null): Promise<Uint8Array>;
|
|
560
|
+
transcribe(req?: CreateTranscriptionRequest | undefined | null): Promise<TranscriptionResponse>;
|
|
561
|
+
moderate(req?: ModerationRequest | undefined | null): Promise<ModerationResponse>;
|
|
562
|
+
rerank(req?: RerankRequest | undefined | null): Promise<RerankResponse>;
|
|
563
|
+
search(req?: SearchRequest | undefined | null): Promise<SearchResponse>;
|
|
564
|
+
ocr(req?: OcrRequest | undefined | null): Promise<OcrResponse>;
|
|
565
|
+
createFile(req?: CreateFileRequest | undefined | null): Promise<FileObject>;
|
|
563
566
|
retrieveFile(fileId: string): Promise<FileObject>;
|
|
564
567
|
deleteFile(fileId: string): Promise<DeleteResponse>;
|
|
565
568
|
listFiles(query?: FileListQuery | undefined | null): Promise<FileListResponse>;
|
|
566
569
|
fileContent(fileId: string): Promise<Uint8Array>;
|
|
567
|
-
createBatch(req
|
|
570
|
+
createBatch(req?: CreateBatchRequest | undefined | null): Promise<BatchObject>;
|
|
568
571
|
retrieveBatch(batchId: string): Promise<BatchObject>;
|
|
569
572
|
listBatches(query?: BatchListQuery | undefined | null): Promise<BatchListResponse>;
|
|
570
573
|
cancelBatch(batchId: string): Promise<BatchObject>;
|
|
571
|
-
createResponse(req
|
|
574
|
+
createResponse(req?: CreateResponseRequest | undefined | null): Promise<ResponseObject>;
|
|
572
575
|
retrieveResponse(responseId: string): Promise<ResponseObject>;
|
|
573
576
|
cancelResponse(responseId: string): Promise<ResponseObject>;
|
|
574
577
|
}
|
package/index.js
CHANGED
|
@@ -10,9 +10,16 @@ const isMusl = () => {
|
|
|
10
10
|
// "is musl" positive. Fall through to the filesystem heuristic instead: on
|
|
11
11
|
// glibc systems `/lib64/ld-musl-x86_64.so.1` does not exist; on musl systems
|
|
12
12
|
// it always does. statSync errors → not musl.
|
|
13
|
-
if (
|
|
13
|
+
if (
|
|
14
|
+
typeof process.report === "object" &&
|
|
15
|
+
typeof process.report.getReport === "function"
|
|
16
|
+
) {
|
|
14
17
|
const report = process.report.getReport();
|
|
15
|
-
if (
|
|
18
|
+
if (
|
|
19
|
+
report &&
|
|
20
|
+
report.header &&
|
|
21
|
+
typeof report.header.glibcVersion === "string"
|
|
22
|
+
) {
|
|
16
23
|
return false;
|
|
17
24
|
}
|
|
18
25
|
}
|
|
@@ -41,48 +48,12 @@ const tryLoadBinding = () => {
|
|
|
41
48
|
// Optional-dep packages are named after `napi.packageName` (npm subpackage names),
|
|
42
49
|
// which inherits any scope prefix from the parent package.
|
|
43
50
|
const targets = [
|
|
44
|
-
[
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
],
|
|
51
|
-
[
|
|
52
|
-
"linux",
|
|
53
|
-
"arm64",
|
|
54
|
-
"gnu",
|
|
55
|
-
"./liter-llm-node.linux-arm64-gnu.node",
|
|
56
|
-
"@kreuzberg/liter-llm-node-linux-arm64-gnu",
|
|
57
|
-
],
|
|
58
|
-
[
|
|
59
|
-
"darwin",
|
|
60
|
-
"x64",
|
|
61
|
-
null,
|
|
62
|
-
"./liter-llm-node.darwin-x64.node",
|
|
63
|
-
"@kreuzberg/liter-llm-node-darwin-x64",
|
|
64
|
-
],
|
|
65
|
-
[
|
|
66
|
-
"darwin",
|
|
67
|
-
"arm64",
|
|
68
|
-
null,
|
|
69
|
-
"./liter-llm-node.darwin-arm64.node",
|
|
70
|
-
"@kreuzberg/liter-llm-node-darwin-arm64",
|
|
71
|
-
],
|
|
72
|
-
[
|
|
73
|
-
"win32",
|
|
74
|
-
"x64",
|
|
75
|
-
null,
|
|
76
|
-
"./liter-llm-node.win32-x64-msvc.node",
|
|
77
|
-
"@kreuzberg/liter-llm-node-win32-x64-msvc",
|
|
78
|
-
],
|
|
79
|
-
[
|
|
80
|
-
"win32",
|
|
81
|
-
"arm64",
|
|
82
|
-
null,
|
|
83
|
-
"./liter-llm-node.win32-arm64-msvc.node",
|
|
84
|
-
"@kreuzberg/liter-llm-node-win32-arm64-msvc",
|
|
85
|
-
],
|
|
51
|
+
["linux", "x64", "gnu", "./liter-llm-node.linux-x64-gnu.node", "@kreuzberg/liter-llm-node-linux-x64-gnu"],
|
|
52
|
+
["linux", "arm64", "gnu", "./liter-llm-node.linux-arm64-gnu.node", "@kreuzberg/liter-llm-node-linux-arm64-gnu"],
|
|
53
|
+
["darwin", "x64", null, "./liter-llm-node.darwin-x64.node", "@kreuzberg/liter-llm-node-darwin-x64"],
|
|
54
|
+
["darwin", "arm64", null, "./liter-llm-node.darwin-arm64.node", "@kreuzberg/liter-llm-node-darwin-arm64"],
|
|
55
|
+
["win32", "x64", null, "./liter-llm-node.win32-x64-msvc.node", "@kreuzberg/liter-llm-node-win32-x64-msvc"],
|
|
56
|
+
["win32", "arm64", null, "./liter-llm-node.win32-arm64-msvc.node", "@kreuzberg/liter-llm-node-win32-arm64-msvc"],
|
|
86
57
|
];
|
|
87
58
|
|
|
88
59
|
for (const [plat, a, abi, localPath, optionalDep] of targets) {
|
|
@@ -122,7 +93,7 @@ tryLoadBinding();
|
|
|
122
93
|
|
|
123
94
|
if (!nativeBinding) {
|
|
124
95
|
throw new Error(
|
|
125
|
-
`Failed to load native binding for ${platform}-${arch}. Errors: ${loadErrors.join(", ")}
|
|
96
|
+
`Failed to load native binding for ${platform}-${arch}. Errors: ${loadErrors.join(", ")}`
|
|
126
97
|
);
|
|
127
98
|
}
|
|
128
99
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kreuzberg/liter-llm-node",
|
|
3
|
-
"version": "1.4.0-rc.
|
|
3
|
+
"version": "1.4.0-rc.50",
|
|
4
4
|
"description": "Universal LLM API client with Rust-powered polyglot bindings.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/kreuzberg-dev/liter-llm.git"
|
|
9
9
|
},
|
|
10
|
-
"files": [
|
|
11
|
-
"index.js",
|
|
12
|
-
"index.d.ts",
|
|
13
|
-
"*.node"
|
|
14
|
-
],
|
|
15
10
|
"main": "index.js",
|
|
16
11
|
"types": "index.d.ts",
|
|
17
12
|
"exports": {
|
|
@@ -21,28 +16,18 @@
|
|
|
21
16
|
"default": "./index.js"
|
|
22
17
|
}
|
|
23
18
|
},
|
|
24
|
-
"
|
|
25
|
-
"access": "public"
|
|
26
|
-
},
|
|
27
|
-
"scripts": {
|
|
28
|
-
"build": "napi build --platform --release",
|
|
29
|
-
"artifacts": "napi artifacts",
|
|
30
|
-
"prepublishOnly": "napi prepublish -t npm --skip-optional-publish"
|
|
31
|
-
},
|
|
32
|
-
"devDependencies": {
|
|
33
|
-
"@napi-rs/cli": "^3.6.2"
|
|
34
|
-
},
|
|
19
|
+
"files": ["index.js", "index.d.ts", "*.node"],
|
|
35
20
|
"optionalDependencies": {
|
|
36
|
-
"@kreuzberg/liter-llm-node-
|
|
37
|
-
"@kreuzberg/liter-llm-node-
|
|
38
|
-
"@kreuzberg/liter-llm-node-
|
|
39
|
-
"@kreuzberg/liter-llm-node-
|
|
40
|
-
"@kreuzberg/liter-llm-node-win32-
|
|
41
|
-
"@kreuzberg/liter-llm-node-win32-
|
|
21
|
+
"@kreuzberg/liter-llm-node-linux-x64-gnu": "1.4.0-rc.50",
|
|
22
|
+
"@kreuzberg/liter-llm-node-linux-arm64-gnu": "1.4.0-rc.50",
|
|
23
|
+
"@kreuzberg/liter-llm-node-darwin-x64": "1.4.0-rc.50",
|
|
24
|
+
"@kreuzberg/liter-llm-node-darwin-arm64": "1.4.0-rc.50",
|
|
25
|
+
"@kreuzberg/liter-llm-node-win32-x64-msvc": "1.4.0-rc.50",
|
|
26
|
+
"@kreuzberg/liter-llm-node-win32-arm64-msvc": "1.4.0-rc.50"
|
|
42
27
|
},
|
|
43
28
|
"napi": {
|
|
44
|
-
"binaryName": "liter-llm-node",
|
|
45
29
|
"packageName": "@kreuzberg/liter-llm-node",
|
|
30
|
+
"binaryName": "liter-llm-node",
|
|
46
31
|
"targets": [
|
|
47
32
|
"x86_64-unknown-linux-gnu",
|
|
48
33
|
"aarch64-unknown-linux-gnu",
|
|
@@ -52,7 +37,12 @@
|
|
|
52
37
|
"aarch64-pc-windows-msvc"
|
|
53
38
|
]
|
|
54
39
|
},
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
|
|
40
|
+
"scripts": {
|
|
41
|
+
"build": "napi build --platform --release",
|
|
42
|
+
"artifacts": "napi artifacts",
|
|
43
|
+
"prepublishOnly": "napi prepublish -t npm --skip-optional-publish"
|
|
44
|
+
},
|
|
45
|
+
"engines": { "node": ">= 18" },
|
|
46
|
+
"publishConfig": { "access": "public" },
|
|
47
|
+
"devDependencies": { "@napi-rs/cli": "^3.6.2" }
|
|
58
48
|
}
|