@trymirai/uzu 0.1.20 → 0.1.22
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 +103 -136
- package/bridging/classificationFeature.d.mts +9 -0
- package/bridging/classificationFeature.d.mts.map +1 -0
- package/bridging/classificationFeature.d.ts +9 -0
- package/bridging/classificationFeature.d.ts.map +1 -0
- package/bridging/classificationFeature.js +18 -0
- package/bridging/classificationFeature.js.map +1 -0
- package/bridging/classificationFeature.mjs +14 -0
- package/bridging/classificationFeature.mjs.map +1 -0
- package/bridging/config.d.mts +20 -0
- package/bridging/config.d.mts.map +1 -0
- package/bridging/config.d.ts +20 -0
- package/bridging/config.d.ts.map +1 -0
- package/bridging/config.js +41 -0
- package/bridging/config.js.map +1 -0
- package/bridging/config.mjs +37 -0
- package/bridging/config.mjs.map +1 -0
- package/bridging/contextLength.d.mts +11 -0
- package/bridging/contextLength.d.mts.map +1 -0
- package/bridging/contextLength.d.ts +11 -0
- package/bridging/contextLength.d.ts.map +1 -0
- package/bridging/contextLength.js +25 -0
- package/bridging/contextLength.js.map +1 -0
- package/bridging/contextLength.mjs +21 -0
- package/bridging/contextLength.mjs.map +1 -0
- package/bridging/downloadHandle.d.mts +14 -0
- package/bridging/downloadHandle.d.mts.map +1 -0
- package/bridging/downloadHandle.d.ts +14 -0
- package/bridging/downloadHandle.d.ts.map +1 -0
- package/bridging/downloadHandle.js +36 -0
- package/bridging/downloadHandle.js.map +1 -0
- package/bridging/downloadHandle.mjs +32 -0
- package/bridging/downloadHandle.mjs.map +1 -0
- package/bridging/downloadProgressUpdate.d.mts +9 -0
- package/bridging/downloadProgressUpdate.d.mts.map +1 -0
- package/bridging/downloadProgressUpdate.d.ts +9 -0
- package/bridging/downloadProgressUpdate.d.ts.map +1 -0
- package/bridging/downloadProgressUpdate.js +15 -0
- package/bridging/downloadProgressUpdate.js.map +1 -0
- package/bridging/downloadProgressUpdate.mjs +11 -0
- package/bridging/downloadProgressUpdate.mjs.map +1 -0
- package/bridging/downloadState.d.mts +18 -0
- package/bridging/downloadState.d.mts.map +1 -0
- package/bridging/downloadState.d.ts +18 -0
- package/bridging/downloadState.d.ts.map +1 -0
- package/bridging/downloadState.js +42 -0
- package/bridging/downloadState.js.map +1 -0
- package/bridging/downloadState.mjs +38 -0
- package/bridging/downloadState.mjs.map +1 -0
- package/bridging/engine.d.mts +17 -0
- package/bridging/engine.d.mts.map +1 -0
- package/bridging/engine.d.ts +17 -0
- package/bridging/engine.d.ts.map +1 -0
- package/bridging/engine.js +84 -0
- package/bridging/engine.js.map +1 -0
- package/bridging/engine.mjs +80 -0
- package/bridging/engine.mjs.map +1 -0
- package/bridging/finishReason.d.mts +7 -0
- package/bridging/finishReason.d.mts.map +1 -0
- package/bridging/finishReason.d.ts +7 -0
- package/bridging/finishReason.d.ts.map +1 -0
- package/bridging/finishReason.js +11 -0
- package/bridging/finishReason.js.map +1 -0
- package/bridging/finishReason.mjs +8 -0
- package/bridging/finishReason.mjs.map +1 -0
- package/bridging/input.d.mts +11 -0
- package/bridging/input.d.mts.map +1 -0
- package/bridging/input.d.ts +11 -0
- package/bridging/input.d.ts.map +1 -0
- package/bridging/input.js +25 -0
- package/bridging/input.js.map +1 -0
- package/bridging/input.mjs +21 -0
- package/bridging/input.mjs.map +1 -0
- package/bridging/licenseStatus.d.mts +14 -0
- package/bridging/licenseStatus.d.mts.map +1 -0
- package/bridging/licenseStatus.d.ts +14 -0
- package/bridging/licenseStatus.d.ts.map +1 -0
- package/bridging/licenseStatus.js +42 -0
- package/bridging/licenseStatus.js.map +1 -0
- package/bridging/licenseStatus.mjs +38 -0
- package/bridging/licenseStatus.mjs.map +1 -0
- package/bridging/message.d.mts +15 -0
- package/bridging/message.d.mts.map +1 -0
- package/bridging/message.d.ts +15 -0
- package/bridging/message.d.ts.map +1 -0
- package/bridging/message.js +43 -0
- package/bridging/message.js.map +1 -0
- package/bridging/message.mjs +39 -0
- package/bridging/message.mjs.map +1 -0
- package/bridging/model.d.mts +18 -0
- package/bridging/model.d.mts.map +1 -0
- package/bridging/model.d.ts +18 -0
- package/bridging/model.d.ts.map +1 -0
- package/bridging/model.js +28 -0
- package/bridging/model.js.map +1 -0
- package/bridging/model.mjs +24 -0
- package/bridging/model.mjs.map +1 -0
- package/bridging/napi.d.mts +4 -0
- package/bridging/napi.d.mts.map +1 -0
- package/bridging/napi.d.ts +4 -0
- package/bridging/napi.d.ts.map +1 -0
- package/bridging/napi.js +3 -0
- package/bridging/napi.js.map +1 -0
- package/bridging/napi.mjs +2 -0
- package/bridging/napi.mjs.map +1 -0
- package/bridging/output.d.mts +13 -0
- package/bridging/output.d.mts.map +1 -0
- package/bridging/output.d.ts +13 -0
- package/bridging/output.d.ts.map +1 -0
- package/bridging/output.js +36 -0
- package/bridging/output.js.map +1 -0
- package/bridging/output.mjs +32 -0
- package/bridging/output.mjs.map +1 -0
- package/bridging/parsedText.d.mts +8 -0
- package/bridging/parsedText.d.mts.map +1 -0
- package/bridging/parsedText.d.ts +8 -0
- package/bridging/parsedText.d.ts.map +1 -0
- package/bridging/parsedText.js +16 -0
- package/bridging/parsedText.js.map +1 -0
- package/bridging/parsedText.mjs +12 -0
- package/bridging/parsedText.mjs.map +1 -0
- package/bridging/prefillStepSize.d.mts +11 -0
- package/bridging/prefillStepSize.d.mts.map +1 -0
- package/bridging/prefillStepSize.d.ts +11 -0
- package/bridging/prefillStepSize.d.ts.map +1 -0
- package/bridging/prefillStepSize.js +28 -0
- package/bridging/prefillStepSize.js.map +1 -0
- package/bridging/prefillStepSize.mjs +24 -0
- package/bridging/prefillStepSize.mjs.map +1 -0
- package/bridging/preset.d.mts +12 -0
- package/bridging/preset.d.mts.map +1 -0
- package/bridging/preset.d.ts +12 -0
- package/bridging/preset.d.ts.map +1 -0
- package/bridging/preset.js +29 -0
- package/bridging/preset.js.map +1 -0
- package/bridging/preset.mjs +25 -0
- package/bridging/preset.mjs.map +1 -0
- package/bridging/role.d.mts +6 -0
- package/bridging/role.d.mts.map +1 -0
- package/bridging/role.d.ts +6 -0
- package/bridging/role.d.ts.map +1 -0
- package/bridging/role.js +10 -0
- package/bridging/role.js.map +1 -0
- package/bridging/role.mjs +7 -0
- package/bridging/role.mjs.map +1 -0
- package/bridging/runConfig.d.mts +15 -0
- package/bridging/runConfig.d.mts.map +1 -0
- package/bridging/runConfig.d.ts +15 -0
- package/bridging/runConfig.d.ts.map +1 -0
- package/bridging/runConfig.js +34 -0
- package/bridging/runConfig.js.map +1 -0
- package/bridging/runConfig.mjs +30 -0
- package/bridging/runConfig.mjs.map +1 -0
- package/bridging/runStats.d.mts +8 -0
- package/bridging/runStats.d.mts.map +1 -0
- package/bridging/runStats.d.ts +8 -0
- package/bridging/runStats.d.ts.map +1 -0
- package/bridging/runStats.js +16 -0
- package/bridging/runStats.js.map +1 -0
- package/bridging/runStats.mjs +12 -0
- package/bridging/runStats.mjs.map +1 -0
- package/bridging/samplingMethod.d.mts +11 -0
- package/bridging/samplingMethod.d.mts.map +1 -0
- package/bridging/samplingMethod.d.ts +11 -0
- package/bridging/samplingMethod.d.ts.map +1 -0
- package/bridging/samplingMethod.js +28 -0
- package/bridging/samplingMethod.js.map +1 -0
- package/bridging/samplingMethod.mjs +24 -0
- package/bridging/samplingMethod.mjs.map +1 -0
- package/bridging/samplingPolicy.d.mts +11 -0
- package/bridging/samplingPolicy.d.mts.map +1 -0
- package/bridging/samplingPolicy.d.ts +11 -0
- package/bridging/samplingPolicy.d.ts.map +1 -0
- package/bridging/samplingPolicy.js +25 -0
- package/bridging/samplingPolicy.js.map +1 -0
- package/bridging/samplingPolicy.mjs +21 -0
- package/bridging/samplingPolicy.mjs.map +1 -0
- package/bridging/samplingSeed.d.mts +10 -0
- package/bridging/samplingSeed.d.mts.map +1 -0
- package/bridging/samplingSeed.d.ts +10 -0
- package/bridging/samplingSeed.d.ts.map +1 -0
- package/bridging/samplingSeed.js +21 -0
- package/bridging/samplingSeed.js.map +1 -0
- package/bridging/samplingSeed.mjs +17 -0
- package/bridging/samplingSeed.mjs.map +1 -0
- package/bridging/session.d.mts +10 -0
- package/bridging/session.d.mts.map +1 -0
- package/bridging/session.d.ts +10 -0
- package/bridging/session.d.ts.map +1 -0
- package/bridging/session.js +19 -0
- package/bridging/session.js.map +1 -0
- package/bridging/session.mjs +15 -0
- package/bridging/session.mjs.map +1 -0
- package/bridging/stats.d.mts +11 -0
- package/bridging/stats.d.mts.map +1 -0
- package/bridging/stats.d.ts +11 -0
- package/bridging/stats.d.ts.map +1 -0
- package/bridging/stats.js +20 -0
- package/bridging/stats.js.map +1 -0
- package/bridging/stats.mjs +16 -0
- package/bridging/stats.mjs.map +1 -0
- package/bridging/stepStats.d.mts +13 -0
- package/bridging/stepStats.d.mts.map +1 -0
- package/bridging/stepStats.d.ts +13 -0
- package/bridging/stepStats.d.ts.map +1 -0
- package/bridging/stepStats.js +25 -0
- package/bridging/stepStats.js.map +1 -0
- package/bridging/stepStats.mjs +21 -0
- package/bridging/stepStats.mjs.map +1 -0
- package/bridging/text.d.mts +9 -0
- package/bridging/text.d.mts.map +1 -0
- package/bridging/text.d.ts +9 -0
- package/bridging/text.d.ts.map +1 -0
- package/bridging/text.js +17 -0
- package/bridging/text.js.map +1 -0
- package/bridging/text.mjs +13 -0
- package/bridging/text.mjs.map +1 -0
- package/bridging/totalStats.d.mts +9 -0
- package/bridging/totalStats.d.mts.map +1 -0
- package/bridging/totalStats.d.ts +9 -0
- package/bridging/totalStats.d.ts.map +1 -0
- package/bridging/totalStats.js +18 -0
- package/bridging/totalStats.js.map +1 -0
- package/bridging/totalStats.mjs +14 -0
- package/bridging/totalStats.mjs.map +1 -0
- package/error.d.mts +16 -0
- package/error.d.mts.map +1 -0
- package/error.d.ts +16 -0
- package/error.d.ts.map +1 -0
- package/error.js +42 -0
- package/error.js.map +1 -0
- package/error.mjs +37 -0
- package/error.mjs.map +1 -0
- package/index.d.mts +33 -0
- package/index.d.mts.map +1 -0
- package/index.d.ts +33 -0
- package/index.d.ts.map +1 -0
- package/index.js +74 -0
- package/index.js.map +1 -0
- package/index.mjs +33 -0
- package/index.mjs.map +1 -0
- package/interactors/downloadInteractor.d.mts +16 -0
- package/interactors/downloadInteractor.d.mts.map +1 -0
- package/interactors/downloadInteractor.d.ts +16 -0
- package/interactors/downloadInteractor.d.ts.map +1 -0
- package/interactors/downloadInteractor.js +38 -0
- package/interactors/downloadInteractor.js.map +1 -0
- package/interactors/downloadInteractor.mjs +34 -0
- package/interactors/downloadInteractor.mjs.map +1 -0
- package/interactors/engineInteractor.d.mts +17 -0
- package/interactors/engineInteractor.d.mts.map +1 -0
- package/interactors/engineInteractor.d.ts +17 -0
- package/interactors/engineInteractor.d.ts.map +1 -0
- package/interactors/engineInteractor.js +34 -0
- package/interactors/engineInteractor.js.map +1 -0
- package/interactors/engineInteractor.mjs +30 -0
- package/interactors/engineInteractor.mjs.map +1 -0
- package/interactors/interactor.d.mts +6 -0
- package/interactors/interactor.d.mts.map +1 -0
- package/interactors/interactor.d.ts +6 -0
- package/interactors/interactor.d.ts.map +1 -0
- package/interactors/interactor.js +3 -0
- package/interactors/interactor.js.map +1 -0
- package/interactors/interactor.mjs +2 -0
- package/interactors/interactor.mjs.map +1 -0
- package/interactors/modelInteractor.d.mts +30 -0
- package/interactors/modelInteractor.d.mts.map +1 -0
- package/interactors/modelInteractor.d.ts +30 -0
- package/interactors/modelInteractor.d.ts.map +1 -0
- package/interactors/modelInteractor.js +85 -0
- package/interactors/modelInteractor.js.map +1 -0
- package/interactors/modelInteractor.mjs +81 -0
- package/interactors/modelInteractor.mjs.map +1 -0
- package/interactors/modelsInteractor.d.mts +12 -0
- package/interactors/modelsInteractor.d.mts.map +1 -0
- package/interactors/modelsInteractor.d.ts +12 -0
- package/interactors/modelsInteractor.d.ts.map +1 -0
- package/interactors/modelsInteractor.js +25 -0
- package/interactors/modelsInteractor.js.map +1 -0
- package/interactors/modelsInteractor.mjs +21 -0
- package/interactors/modelsInteractor.mjs.map +1 -0
- package/interactors/sessionInteractor.d.mts +24 -0
- package/interactors/sessionInteractor.d.mts.map +1 -0
- package/interactors/sessionInteractor.d.ts +24 -0
- package/interactors/sessionInteractor.d.ts.map +1 -0
- package/interactors/sessionInteractor.js +50 -0
- package/interactors/sessionInteractor.js.map +1 -0
- package/interactors/sessionInteractor.mjs +46 -0
- package/interactors/sessionInteractor.mjs.map +1 -0
- package/internal/tslib.js +2 -0
- package/internal/tslib.mjs +1 -0
- package/{uzu.d.ts → napi/uzu.d.ts} +38 -37
- package/napi/uzu.js +95 -0
- package/napi/uzu.mjs +61 -0
- package/{uzu.node → napi/uzu.node} +0 -0
- package/package.json +96 -35
- package/src/bridging/classificationFeature.ts +20 -0
- package/src/bridging/config.ts +60 -0
- package/src/bridging/contextLength.ts +29 -0
- package/src/bridging/downloadHandle.ts +41 -0
- package/src/bridging/downloadProgressUpdate.ts +21 -0
- package/src/bridging/downloadState.ts +59 -0
- package/src/bridging/engine.ts +97 -0
- package/src/bridging/finishReason.ts +6 -0
- package/src/bridging/input.ts +29 -0
- package/src/bridging/licenseStatus.ts +39 -0
- package/src/bridging/message.ts +50 -0
- package/src/bridging/model.ts +32 -0
- package/src/bridging/napi.ts +3 -0
- package/src/bridging/output.ts +40 -0
- package/src/bridging/parsedText.ts +17 -0
- package/src/bridging/prefillStepSize.ts +32 -0
- package/src/bridging/preset.ts +34 -0
- package/src/bridging/role.ts +5 -0
- package/src/bridging/runConfig.ts +41 -0
- package/src/bridging/runStats.ts +17 -0
- package/src/bridging/samplingMethod.ts +32 -0
- package/src/bridging/samplingPolicy.ts +29 -0
- package/src/bridging/samplingSeed.ts +24 -0
- package/src/bridging/session.ts +24 -0
- package/src/bridging/stats.ts +22 -0
- package/src/bridging/stepStats.ts +37 -0
- package/src/bridging/text.ts +18 -0
- package/src/bridging/totalStats.ts +20 -0
- package/src/error.ts +38 -0
- package/src/index.ts +32 -0
- package/src/interactors/downloadInteractor.ts +47 -0
- package/src/interactors/engineInteractor.ts +48 -0
- package/src/interactors/interactor.ts +7 -0
- package/src/interactors/modelInteractor.ts +113 -0
- package/src/interactors/modelsInteractor.ts +29 -0
- package/src/interactors/sessionInteractor.ts +70 -0
- package/src/napi/uzu.d.ts +230 -0
- package/src/napi/uzu.js +95 -0
- package/src/napi/uzu.mjs +61 -0
- package/src/napi/uzu.node +0 -0
- package/src/tsconfig.json +11 -0
- package/src/utilities/env.ts +9 -0
- package/src/version.ts +1 -0
- package/utilities/env.d.mts +2 -0
- package/utilities/env.d.mts.map +1 -0
- package/utilities/env.d.ts +2 -0
- package/utilities/env.d.ts.map +1 -0
- package/utilities/env.js +14 -0
- package/utilities/env.js.map +1 -0
- package/utilities/env.mjs +10 -0
- package/utilities/env.mjs.map +1 -0
- package/version.d.mts +2 -0
- package/version.d.mts.map +1 -0
- package/version.d.ts +2 -0
- package/version.d.ts.map +1 -0
- package/version.js +5 -0
- package/version.js.map +1 -0
- package/version.mjs +2 -0
- package/version.mjs.map +1 -0
- package/README.orig.md +0 -213
- package/README.src.md +0 -124
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../src/utilities/env.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,GAAI,KAAK,MAAM,KAAG,MAAM,GAAG,SAQ9C,CAAC"}
|
package/utilities/env.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.readEnv = void 0;
|
|
4
|
+
const readEnv = (env) => {
|
|
5
|
+
if (typeof globalThis.process !== 'undefined') {
|
|
6
|
+
return globalThis.process.env?.[env]?.trim() ?? undefined;
|
|
7
|
+
}
|
|
8
|
+
if (typeof globalThis.Deno !== 'undefined') {
|
|
9
|
+
return globalThis.Deno.env?.get?.(env)?.trim();
|
|
10
|
+
}
|
|
11
|
+
return undefined;
|
|
12
|
+
};
|
|
13
|
+
exports.readEnv = readEnv;
|
|
14
|
+
//# sourceMappingURL=env.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.js","sourceRoot":"","sources":["../src/utilities/env.ts"],"names":[],"mappings":";;;AAAO,MAAM,OAAO,GAAG,CAAC,GAAW,EAAsB,EAAE;IACvD,IAAI,OAAQ,UAAkB,CAAC,OAAO,KAAK,WAAW,EAAE,CAAC;QACrD,OAAQ,UAAkB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,SAAS,CAAC;IACvE,CAAC;IACD,IAAI,OAAQ,UAAkB,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;QAClD,OAAQ,UAAkB,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC;IAC5D,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC,CAAC;AARW,QAAA,OAAO,WAQlB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const readEnv = (env) => {
|
|
2
|
+
if (typeof globalThis.process !== 'undefined') {
|
|
3
|
+
return globalThis.process.env?.[env]?.trim() ?? undefined;
|
|
4
|
+
}
|
|
5
|
+
if (typeof globalThis.Deno !== 'undefined') {
|
|
6
|
+
return globalThis.Deno.env?.get?.(env)?.trim();
|
|
7
|
+
}
|
|
8
|
+
return undefined;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=env.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.mjs","sourceRoot":"","sources":["../src/utilities/env.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,GAAW,EAAsB,EAAE;IACvD,IAAI,OAAQ,UAAkB,CAAC,OAAO,KAAK,WAAW,EAAE,CAAC;QACrD,OAAQ,UAAkB,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,SAAS,CAAC;IACvE,CAAC;IACD,IAAI,OAAQ,UAAkB,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;QAClD,OAAQ,UAAkB,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC;IAC5D,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC,CAAC"}
|
package/version.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.mts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,WAAW,CAAC"}
|
package/version.d.ts
ADDED
package/version.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,WAAW,CAAC"}
|
package/version.js
ADDED
package/version.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,QAAQ,CAAC"}
|
package/version.mjs
ADDED
package/version.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC"}
|
package/README.orig.md
DELETED
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<picture>
|
|
3
|
-
<img alt="Mirai" src="https://artifacts.trymirai.com/social/github/uzu-typescript.jpg" style="max-width: 100%;">
|
|
4
|
-
</picture>
|
|
5
|
-
</p>
|
|
6
|
-
|
|
7
|
-
<a href="https://artifacts.trymirai.com/social/about_us.mp3"><img src="https://img.shields.io/badge/Listen-Podcast-red" alt="Listen to our podcast"></a>
|
|
8
|
-
<a href="https://docsend.com/v/76bpr/mirai2025"><img src="https://img.shields.io/badge/View-Deck-red" alt="View our deck"></a>
|
|
9
|
-
<a href="mailto:alexey@getmirai.co,dima@getmirai.co,aleksei@getmirai.co?subject=Interested%20in%20Mirai"><img src="https://img.shields.io/badge/Send-Email-green" alt="Contact us"></a>
|
|
10
|
-
<a href="https://docs.trymirai.com/app-integration/overview"><img src="https://img.shields.io/badge/Read-Docs-blue" alt="Read docs"></a>
|
|
11
|
-
[](https://www.npmjs.com/package/@trymirai/uzu)
|
|
12
|
-
[](LICENSE)
|
|
13
|
-
|
|
14
|
-
# uzu-ts
|
|
15
|
-
|
|
16
|
-
Node package for [uzu](https://github.com/trymirai/uzu), a **high-performance** inference engine for AI models on Apple Silicon. It allows you to deploy AI directly in your app with **zero latency**, **full data privacy**, and **no inference costs**. You don’t need an ML team or weeks of setup - one developer can handle everything in minutes. Key features:
|
|
17
|
-
|
|
18
|
-
- Simple, high-level API
|
|
19
|
-
- Specialized configurations with significant performance boosts for common use cases like classification and summarization
|
|
20
|
-
- [Broad model support](https://trymirai.com/models)
|
|
21
|
-
- Observable model manager
|
|
22
|
-
|
|
23
|
-
## Examples
|
|
24
|
-
|
|
25
|
-
Set up your project via [Platform](https://platform.trymirai.com), obtain an `MIRAI_API_KEY`.
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
# Set your API key in `examples/common.ts`, then run the examples
|
|
29
|
-
pnpm run chat
|
|
30
|
-
pnpm run summarisation
|
|
31
|
-
pnpm run classification
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Setup
|
|
35
|
-
|
|
36
|
-
Add the `uzu` dependency to your project's `package.json`:
|
|
37
|
-
|
|
38
|
-
```json
|
|
39
|
-
"dependencies": {
|
|
40
|
-
"@trymirai/uzu": "0.1.20"
|
|
41
|
-
}
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
Create and activate engine:
|
|
45
|
-
|
|
46
|
-
```ts
|
|
47
|
-
const engine = new Engine()
|
|
48
|
-
const licenseStatus: LicenseStatus = await engine.activate(apiKey)
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### Refresh models registry / list cloud models:
|
|
52
|
-
|
|
53
|
-
```ts
|
|
54
|
-
const localModels: LocalModel[] = await engine.updateRegistry()
|
|
55
|
-
const localModelId = 'Meta-Llama-3.2-1B-Instruct'
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
### Download with progress handle
|
|
59
|
-
|
|
60
|
-
```ts
|
|
61
|
-
const donwloadHandle = engine.downloadHandle(localModelId)
|
|
62
|
-
donwloadHandle.start()
|
|
63
|
-
|
|
64
|
-
for await (const donwloadProgress of donwloadHandle.progress()) {
|
|
65
|
-
// Implement a custom download progress handler
|
|
66
|
-
handleProgress(donwloadProgress)
|
|
67
|
-
}
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
Alternatively, you may use engine to control and observe model download:
|
|
71
|
-
|
|
72
|
-
```ts
|
|
73
|
-
const modelState: ModelDownloadState = engine.getState(localModelId)
|
|
74
|
-
|
|
75
|
-
// engine.download(localModelId)
|
|
76
|
-
// engine.pause(localModelId)
|
|
77
|
-
// engine.resume(localModelId)
|
|
78
|
-
// engine.stop(localModelId)
|
|
79
|
-
// engine.delete(localModelId)
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
### Session
|
|
83
|
-
|
|
84
|
-
`Session` is the core entity used to communicate with the model:
|
|
85
|
-
|
|
86
|
-
```ts
|
|
87
|
-
const modelId: ModelID = { type: 'Local', id: localModelId }
|
|
88
|
-
const config: Config = {
|
|
89
|
-
preset: { type: 'General' },
|
|
90
|
-
prefillStepSize: { type: 'Default' },
|
|
91
|
-
contextLength: { type: 'Default' },
|
|
92
|
-
samplingSeed: { type: 'Default' },
|
|
93
|
-
}
|
|
94
|
-
const session: Session = engine.createSession(modelId, config)
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
### Chat
|
|
98
|
-
|
|
99
|
-
After creating it, you can run the `Session` with a specific prompt or a list of messages:
|
|
100
|
-
|
|
101
|
-
```ts
|
|
102
|
-
const input: Input = {
|
|
103
|
-
type: 'Messages',
|
|
104
|
-
messages: [
|
|
105
|
-
{
|
|
106
|
-
role: Role.System,
|
|
107
|
-
content: 'You are a helpful assistant.'
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
role: Role.User,
|
|
111
|
-
content: 'Tell me a short, funny story about a robot.'
|
|
112
|
-
},
|
|
113
|
-
],
|
|
114
|
-
}
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
```ts
|
|
118
|
-
const runConfig: RunConfig = {
|
|
119
|
-
tokensLimit: 128,
|
|
120
|
-
enableThinking: true,
|
|
121
|
-
samplingPolicy: { type: 'Default' },
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
const output = session.run(input, runConfig, (partialOutput) => {
|
|
125
|
-
// Implement a custom partial output handler
|
|
126
|
-
return handlePartialOutput(partialOutput)
|
|
127
|
-
})
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
### Summarization
|
|
131
|
-
|
|
132
|
-
In this example, we will extract a summary of the input text:
|
|
133
|
-
|
|
134
|
-
```ts
|
|
135
|
-
const modelId: ModelID = { type: 'Local', id: localModelId }
|
|
136
|
-
const config: Config = {
|
|
137
|
-
preset: { type: 'Summarization' },
|
|
138
|
-
prefillStepSize: { type: 'Default' },
|
|
139
|
-
contextLength: { type: 'Default' },
|
|
140
|
-
samplingSeed: { type: 'Default' },
|
|
141
|
-
}
|
|
142
|
-
const session = engine.createSession(modelId, config)
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
```ts
|
|
146
|
-
const textToSummarize =
|
|
147
|
-
'A Large Language Model (LLM) is a type of AI that processes and generates text using transformer-based architectures trained on vast datasets. They power chatbots, translation, code assistants, and more.'
|
|
148
|
-
const input: Input = {
|
|
149
|
-
type: 'Text',
|
|
150
|
-
text: `Text is: "${textToSummarize}". Write only summary itself.`,
|
|
151
|
-
}
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
```ts
|
|
155
|
-
const runConfig: RunConfig = {
|
|
156
|
-
tokensLimit: 256,
|
|
157
|
-
enableThinking: true,
|
|
158
|
-
samplingPolicy: { type: 'Custom', value: { type: 'Greedy' } },
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
const output = session.run(input, runConfig, (partialOutput) => {
|
|
162
|
-
// Implement a custom partial output handler
|
|
163
|
-
return handlePartialOutput(partialOutput)
|
|
164
|
-
})
|
|
165
|
-
```
|
|
166
|
-
|
|
167
|
-
### Classification
|
|
168
|
-
|
|
169
|
-
Let’s look at a case where you need to classify input text based on a specific feature, such as `sentiment`:
|
|
170
|
-
|
|
171
|
-
```ts
|
|
172
|
-
const feature: ClassificationFeature = {
|
|
173
|
-
name: 'sentiment',
|
|
174
|
-
values: ['Happy', 'Sad', 'Angry', 'Fearful', 'Surprised', 'Disgusted'],
|
|
175
|
-
}
|
|
176
|
-
const config: Config = {
|
|
177
|
-
preset: { type: 'Classification', feature },
|
|
178
|
-
prefillStepSize: { type: 'Default' },
|
|
179
|
-
contextLength: { type: 'Default' },
|
|
180
|
-
samplingSeed: { type: 'Default' },
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
const modelId: ModelID = { type: 'Local', id: localModelId }
|
|
184
|
-
const session = engine.createSession(modelId, config)
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
```ts
|
|
188
|
-
const textToDetectFeature =
|
|
189
|
-
"Today's been awesome! Everything just feels right, and I can't stop smiling."
|
|
190
|
-
const classificationPrompt =
|
|
191
|
-
`Text is: "${textToDetectFeature}". Choose ${feature.name} from the list: ${feature.values.join(', ')}. ` +
|
|
192
|
-
"Answer with one word. Don't add a dot at the end."
|
|
193
|
-
const input: Input = { type: 'Text', text: classificationPrompt }
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
```ts
|
|
197
|
-
const runConfig: RunConfig = {
|
|
198
|
-
tokensLimit: 32,
|
|
199
|
-
enableThinking: true,
|
|
200
|
-
samplingPolicy: { type: 'Custom', value: { type: 'Greedy' } },
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
const output = session.run(input, runConfig, (partialOutput) => {
|
|
204
|
-
// Implement a custom partial output handler
|
|
205
|
-
return handlePartialOutput(partialOutput)
|
|
206
|
-
})
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
In this example, you will get the answer `Happy` immediately after the prefill step, and the actual generation won't even start.
|
|
210
|
-
|
|
211
|
-
## License
|
|
212
|
-
|
|
213
|
-
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
|
package/README.src.md
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<picture>
|
|
3
|
-
<img alt="Mirai" src="https://artifacts.trymirai.com/social/github/uzu-typescript.jpg" style="max-width: 100%;">
|
|
4
|
-
</picture>
|
|
5
|
-
</p>
|
|
6
|
-
|
|
7
|
-
<a href="https://artifacts.trymirai.com/social/about_us.mp3"><img src="https://img.shields.io/badge/Listen-Podcast-red" alt="Listen to our podcast"></a>
|
|
8
|
-
<a href="https://docsend.com/v/76bpr/mirai2025"><img src="https://img.shields.io/badge/View-Deck-red" alt="View our deck"></a>
|
|
9
|
-
<a href="mailto:alexey@getmirai.co,dima@getmirai.co,aleksei@getmirai.co?subject=Interested%20in%20Mirai"><img src="https://img.shields.io/badge/Send-Email-green" alt="Contact us"></a>
|
|
10
|
-
<a href="https://docs.trymirai.com/app-integration/overview"><img src="https://img.shields.io/badge/Read-Docs-blue" alt="Read docs"></a>
|
|
11
|
-
[](https://www.npmjs.com/package/@trymirai/uzu)
|
|
12
|
-
[](LICENSE)
|
|
13
|
-
|
|
14
|
-
# uzu-ts
|
|
15
|
-
|
|
16
|
-
Node package for [uzu](https://github.com/trymirai/uzu), a **high-performance** inference engine for AI models on Apple Silicon. It allows you to deploy AI directly in your app with **zero latency**, **full data privacy**, and **no inference costs**. You don’t need an ML team or weeks of setup - one developer can handle everything in minutes. Key features:
|
|
17
|
-
|
|
18
|
-
- Simple, high-level API
|
|
19
|
-
- Specialized configurations with significant performance boosts for common use cases like classification and summarization
|
|
20
|
-
- [Broad model support](https://trymirai.com/models)
|
|
21
|
-
- Observable model manager
|
|
22
|
-
|
|
23
|
-
## Examples
|
|
24
|
-
|
|
25
|
-
Set up your project via [Platform](https://platform.trymirai.com), obtain an `MIRAI_API_KEY`.
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
# Set your API key in `examples/common.ts`, then run the examples
|
|
29
|
-
pnpm run chat
|
|
30
|
-
pnpm run summarisation
|
|
31
|
-
pnpm run classification
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Setup
|
|
35
|
-
|
|
36
|
-
Add the `uzu` dependency to your project's `package.json`:
|
|
37
|
-
|
|
38
|
-
```json
|
|
39
|
-
"dependencies": {
|
|
40
|
-
"@trymirai/uzu": "0.1.4"
|
|
41
|
-
}
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
Create and activate engine:
|
|
45
|
-
|
|
46
|
-
```ts
|
|
47
|
-
// include:examples/chat.ts#activation lang=ts
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
### Refresh models registry / list cloud models:
|
|
51
|
-
|
|
52
|
-
```ts
|
|
53
|
-
// include:examples/chat.ts#registry lang=ts
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
### Download with progress handle
|
|
57
|
-
|
|
58
|
-
```ts
|
|
59
|
-
// include:examples/chat.ts#download-handle lang=ts
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
Alternatively, you may use engine to control and observe model download:
|
|
63
|
-
|
|
64
|
-
```ts
|
|
65
|
-
// include:examples/chat.ts#storage-methods lang=ts
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
### Session
|
|
69
|
-
|
|
70
|
-
`Session` is the core entity used to communicate with the model:
|
|
71
|
-
|
|
72
|
-
```ts
|
|
73
|
-
// include:examples/chat.ts#session-create-general lang=ts
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
### Chat
|
|
77
|
-
|
|
78
|
-
After creating it, you can run the `Session` with a specific prompt or a list of messages:
|
|
79
|
-
|
|
80
|
-
```ts
|
|
81
|
-
// include:examples/chat.ts#session-input-general lang=ts
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
```ts
|
|
85
|
-
// include:examples/chat.ts#session-run-general lang=ts
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
### Summarization
|
|
89
|
-
|
|
90
|
-
In this example, we will extract a summary of the input text:
|
|
91
|
-
|
|
92
|
-
```ts
|
|
93
|
-
// include:examples/summarisation.ts#session-create-summarization lang=ts
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
```ts
|
|
97
|
-
// include:examples/summarisation.ts#session-input-summarization lang=ts
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
```ts
|
|
101
|
-
// include:examples/summarisation.ts#session-run-summarization lang=ts
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
### Classification
|
|
105
|
-
|
|
106
|
-
Let’s look at a case where you need to classify input text based on a specific feature, such as `sentiment`:
|
|
107
|
-
|
|
108
|
-
```ts
|
|
109
|
-
// include:examples/classification.ts#session-create-classification lang=ts
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
```ts
|
|
113
|
-
// include:examples/classification.ts#session-input-classification lang=ts
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
```ts
|
|
117
|
-
// include:examples/classification.ts#session-run-classification lang=ts
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
In this example, you will get the answer `Happy` immediately after the prefill step, and the actual generation won't even start.
|
|
121
|
-
|
|
122
|
-
## License
|
|
123
|
-
|
|
124
|
-
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
|