@trymirai/uzu 0.2.1 → 0.2.6

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 CHANGED
@@ -26,7 +26,7 @@ Add the `uzu` dependency to your project's `package.json`:
26
26
 
27
27
  ```json
28
28
  "dependencies": {
29
- "@trymirai/uzu": "0.2.1"
29
+ "@trymirai/uzu": "0.2.6"
30
30
  }
31
31
  ```
32
32
 
package/napi/uzu.d.ts CHANGED
@@ -10,6 +10,7 @@ export declare class Engine {
10
10
  getChatModels(types: Array<ModelType>): Promise<Array<ChatModel>>
11
11
  getModelDownloadState(repoId: string): ModelDownloadState
12
12
  createModelDownloadHandle(repoId: string): ModelDownloadHandle
13
+ benchmark(task: BenchmarksTask): Promise<Array<BenchmarksResult>>
13
14
  constructor()
14
15
  createChatSession(model: ChatModel, config: Config): ChatSession
15
16
  registerLicenseStatusHandler(callback?: ((arg: LicenseStatus) => void) | undefined | null): void
@@ -43,6 +44,36 @@ export type AsyncBatchSize =
43
44
  | { type: 'Default' }
44
45
  | { type: 'Custom', size: number }
45
46
 
47
+ export interface BenchmarksDevice {
48
+ osName?: string
49
+ cpuName?: string
50
+ memoryTotal: number
51
+ }
52
+
53
+ export interface BenchmarksResult {
54
+ task: BenchmarksTask
55
+ device: BenchmarksDevice
56
+ engineVersion: string
57
+ timestamp: number
58
+ precision?: DataType
59
+ memoryUsed?: number
60
+ tokensCountInput: number
61
+ tokensCountOutput: number
62
+ timeToFirstToken: number
63
+ promptTokensPerSecond: number
64
+ generateTokensPerSecond?: number
65
+ text: string
66
+ }
67
+
68
+ export interface BenchmarksTask {
69
+ identifier: string
70
+ repoId: string
71
+ numberOfRuns: number
72
+ tokensLimit: number
73
+ messages: Array<Message>
74
+ greedy: boolean
75
+ }
76
+
46
77
  export interface ChatModel {
47
78
  readonly repoId: string
48
79
  readonly type: ModelType
@@ -76,6 +107,14 @@ export type ContextMode =
76
107
  | { type: 'Static', input: Input }
77
108
  | { type: 'Dynamic' }
78
109
 
110
+ export declare const enum DataType {
111
+ BFloat16 = 0,
112
+ Float16 = 1,
113
+ Float32 = 2,
114
+ Int4 = 3,
115
+ Int8 = 4
116
+ }
117
+
79
118
  export declare const enum FinishReason {
80
119
  Stop = 0,
81
120
  Length = 1,
package/napi/uzu.js CHANGED
@@ -26,11 +26,15 @@ const {
26
26
  ModelDownloadHandle,
27
27
  ProgressStream,
28
28
  ProgressUpdate,
29
+ DataType,
29
30
  FinishReason,
30
31
  ModelDownloadPhase,
31
32
  ModelType,
32
33
  Role,
33
34
  version,
35
+ BenchmarksDevice,
36
+ BenchmarksResult,
37
+ BenchmarksTask,
34
38
  ChatModel,
35
39
  ClassificationFeature,
36
40
  Config,
@@ -65,11 +69,15 @@ module.exports = {
65
69
  ModelDownloadHandle,
66
70
  ProgressStream,
67
71
  ProgressUpdate,
72
+ DataType,
68
73
  FinishReason,
69
74
  ModelDownloadPhase,
70
75
  ModelType,
71
76
  Role,
72
77
  version,
78
+ BenchmarksDevice,
79
+ BenchmarksResult,
80
+ BenchmarksTask,
73
81
  ChatModel,
74
82
  ClassificationFeature,
75
83
  Config,
package/napi/uzu.mjs CHANGED
@@ -26,11 +26,15 @@ export const {
26
26
  ModelDownloadHandle,
27
27
  ProgressStream,
28
28
  ProgressUpdate,
29
+ DataType,
29
30
  FinishReason,
30
31
  ModelDownloadPhase,
31
32
  ModelType,
32
33
  Role,
33
34
  version,
35
+ BenchmarksDevice,
36
+ BenchmarksResult,
37
+ BenchmarksTask,
34
38
  ChatModel,
35
39
  ClassificationFeature,
36
40
  Config,
package/napi/uzu.node CHANGED
Binary file
package/package.json CHANGED
@@ -101,5 +101,5 @@
101
101
  },
102
102
  "type": "commonjs",
103
103
  "types": "./index.d.ts",
104
- "version": "0.2.1"
104
+ "version": "0.2.6"
105
105
  }
package/src/napi/uzu.d.ts CHANGED
@@ -10,6 +10,7 @@ export declare class Engine {
10
10
  getChatModels(types: Array<ModelType>): Promise<Array<ChatModel>>
11
11
  getModelDownloadState(repoId: string): ModelDownloadState
12
12
  createModelDownloadHandle(repoId: string): ModelDownloadHandle
13
+ benchmark(task: BenchmarksTask): Promise<Array<BenchmarksResult>>
13
14
  constructor()
14
15
  createChatSession(model: ChatModel, config: Config): ChatSession
15
16
  registerLicenseStatusHandler(callback?: ((arg: LicenseStatus) => void) | undefined | null): void
@@ -43,6 +44,36 @@ export type AsyncBatchSize =
43
44
  | { type: 'Default' }
44
45
  | { type: 'Custom', size: number }
45
46
 
47
+ export interface BenchmarksDevice {
48
+ osName?: string
49
+ cpuName?: string
50
+ memoryTotal: number
51
+ }
52
+
53
+ export interface BenchmarksResult {
54
+ task: BenchmarksTask
55
+ device: BenchmarksDevice
56
+ engineVersion: string
57
+ timestamp: number
58
+ precision?: DataType
59
+ memoryUsed?: number
60
+ tokensCountInput: number
61
+ tokensCountOutput: number
62
+ timeToFirstToken: number
63
+ promptTokensPerSecond: number
64
+ generateTokensPerSecond?: number
65
+ text: string
66
+ }
67
+
68
+ export interface BenchmarksTask {
69
+ identifier: string
70
+ repoId: string
71
+ numberOfRuns: number
72
+ tokensLimit: number
73
+ messages: Array<Message>
74
+ greedy: boolean
75
+ }
76
+
46
77
  export interface ChatModel {
47
78
  readonly repoId: string
48
79
  readonly type: ModelType
@@ -76,6 +107,14 @@ export type ContextMode =
76
107
  | { type: 'Static', input: Input }
77
108
  | { type: 'Dynamic' }
78
109
 
110
+ export declare const enum DataType {
111
+ BFloat16 = 0,
112
+ Float16 = 1,
113
+ Float32 = 2,
114
+ Int4 = 3,
115
+ Int8 = 4
116
+ }
117
+
79
118
  export declare const enum FinishReason {
80
119
  Stop = 0,
81
120
  Length = 1,
package/src/napi/uzu.js CHANGED
@@ -26,11 +26,15 @@ const {
26
26
  ModelDownloadHandle,
27
27
  ProgressStream,
28
28
  ProgressUpdate,
29
+ DataType,
29
30
  FinishReason,
30
31
  ModelDownloadPhase,
31
32
  ModelType,
32
33
  Role,
33
34
  version,
35
+ BenchmarksDevice,
36
+ BenchmarksResult,
37
+ BenchmarksTask,
34
38
  ChatModel,
35
39
  ClassificationFeature,
36
40
  Config,
@@ -65,11 +69,15 @@ module.exports = {
65
69
  ModelDownloadHandle,
66
70
  ProgressStream,
67
71
  ProgressUpdate,
72
+ DataType,
68
73
  FinishReason,
69
74
  ModelDownloadPhase,
70
75
  ModelType,
71
76
  Role,
72
77
  version,
78
+ BenchmarksDevice,
79
+ BenchmarksResult,
80
+ BenchmarksTask,
73
81
  ChatModel,
74
82
  ClassificationFeature,
75
83
  Config,
package/src/napi/uzu.mjs CHANGED
@@ -26,11 +26,15 @@ export const {
26
26
  ModelDownloadHandle,
27
27
  ProgressStream,
28
28
  ProgressUpdate,
29
+ DataType,
29
30
  FinishReason,
30
31
  ModelDownloadPhase,
31
32
  ModelType,
32
33
  Role,
33
34
  version,
35
+ BenchmarksDevice,
36
+ BenchmarksResult,
37
+ BenchmarksTask,
34
38
  ChatModel,
35
39
  ClassificationFeature,
36
40
  Config,
package/src/napi/uzu.node CHANGED
Binary file
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.2.1';
1
+ export const VERSION = '0.2.6';
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.2.1";
1
+ export declare const VERSION = "0.2.6";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.2.1";
1
+ export declare const VERSION = "0.2.6";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.2.1';
4
+ exports.VERSION = '0.2.6';
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.2.1';
1
+ export const VERSION = '0.2.6';
2
2
  //# sourceMappingURL=version.mjs.map