@qvac/sdk 0.22.0 → 0.24.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/NOTICE +194 -97
- package/README.md +29 -470
- package/dist/examples/asr/parakeet-sortformer.js +24 -14
- package/dist/examples/asr/parakeet-transcribepsy-filesystem.d.ts +2 -0
- package/dist/examples/asr/parakeet-transcribepsy-filesystem.js +105 -0
- package/dist/examples/asr/parakeet-unified-coreml.js +14 -9
- package/dist/examples/asr/whispercpp-prompt.js +9 -5
- package/dist/examples/assess-model-fit.d.ts +7 -9
- package/dist/examples/assess-model-fit.js +22 -43
- package/dist/examples/calc-tokens.d.ts +2 -0
- package/dist/examples/calc-tokens.js +21 -0
- package/dist/examples/classification/classify-image.js +11 -5
- package/dist/examples/completion-stop-reason.d.ts +3 -3
- package/dist/examples/completion-stop-reason.js +4 -4
- package/dist/examples/diffusion-flux3-klein.d.ts +2 -0
- package/dist/examples/diffusion-flux3-klein.js +102 -0
- package/dist/examples/diffusion-img2vid-ltx.js +7 -14
- package/dist/examples/diffusion-moss-image.d.ts +2 -0
- package/dist/examples/diffusion-moss-image.js +126 -0
- package/dist/examples/diffusion-qwen-image-21.d.ts +2 -0
- package/dist/examples/diffusion-qwen-image-21.js +115 -0
- package/dist/examples/diffusion-txt2vid-ltx.js +7 -14
- package/dist/examples/embed-multimodal.d.ts +2 -0
- package/dist/examples/embed-multimodal.js +80 -0
- package/dist/examples/embed-p2p.js +2 -2
- package/dist/examples/finetune/llamacpp-finetune.js +9 -4
- package/dist/examples/image/megaloc.d.ts +2 -0
- package/dist/examples/image/megaloc.js +37 -0
- package/dist/examples/llamacpp-multimodal.js +21 -1
- package/dist/examples/mcp-websearch.js +1 -1
- package/dist/examples/plugins.js +1 -1
- package/dist/examples/rag/rag-hyperdb/pipeline.js +2 -2
- package/dist/examples/rag/rag-turbovec.js +2 -2
- package/dist/examples/rerank.d.ts +2 -0
- package/dist/examples/rerank.js +33 -0
- package/dist/examples/sessions.d.ts +17 -0
- package/dist/examples/sessions.js +63 -0
- package/dist/examples/tools/llamacpp-deferred-tools.js +12 -8
- package/dist/examples/tools/llamacpp-tools-auto-dialect.js +4 -3
- package/dist/examples/tools/llamacpp-tools-gemma4.js +3 -3
- package/dist/examples/tools/llamacpp-tools-qwen35.js +4 -3
- package/dist/scripts/check-resource-collectors-packaging.js +7 -6
- package/dist/scripts/contract/build-contract.d.ts +2 -1
- package/dist/scripts/contract/build-contract.js +13 -1
- package/dist/scripts/contract/constants-registry.d.ts +19 -0
- package/dist/scripts/contract/constants-registry.js +9 -2
- package/dist/scripts/contract/method-shapes.d.ts +5 -0
- package/dist/scripts/contract/method-shapes.js +5 -0
- package/dist/scripts/enforce-inference-versions.d.ts +1 -1
- package/dist/scripts/enforce-inference-versions.js +28 -18
- package/dist/scripts/generate-bare-kit-runtimes.js +101 -69
- package/dist/src/client/api/assess-model-fit.d.ts +17 -17
- package/dist/src/client/api/assess-model-fit.js +19 -32
- package/dist/src/client/api/audio-edit.d.ts +5 -3
- package/dist/src/client/api/audio-edit.js +7 -5
- package/dist/src/client/api/audio-gen-result.js +136 -47
- package/dist/src/client/api/audio-gen.d.ts +40 -3
- package/dist/src/client/api/audio-gen.js +42 -5
- package/dist/src/client/api/audio-understand.d.ts +2 -2
- package/dist/src/client/api/audio-understand.js +4 -4
- package/dist/src/client/api/batch-completion.js +4 -3
- package/dist/src/client/api/bci-transcribe.js +3 -3
- package/dist/src/client/api/calc-tokens.d.ts +33 -0
- package/dist/src/client/api/calc-tokens.js +44 -0
- package/dist/src/client/api/cancel.d.ts +2 -2
- package/dist/src/client/api/cancel.js +3 -3
- package/dist/src/client/api/classify.d.ts +12 -5
- package/dist/src/client/api/classify.js +18 -6
- package/dist/src/client/api/client-request-id.d.ts +0 -15
- package/dist/src/client/api/client-request-id.js +15 -12
- package/dist/src/client/api/completion-stream.d.ts +9 -1
- package/dist/src/client/api/completion-stream.js +14 -3
- package/dist/src/client/api/decide.d.ts +1 -1
- package/dist/src/client/api/decide.js +3 -3
- package/dist/src/client/api/delete-cache.d.ts +9 -2
- package/dist/src/client/api/delete-cache.js +14 -4
- package/dist/src/client/api/diffusion.d.ts +38 -5
- package/dist/src/client/api/diffusion.js +42 -7
- package/dist/src/client/api/download-asset.js +3 -3
- package/dist/src/client/api/embed.d.ts +82 -29
- package/dist/src/client/api/embed.js +66 -21
- package/dist/src/client/api/finetune.js +3 -3
- package/dist/src/client/api/get-loaded-model-info.js +1 -1
- package/dist/src/client/api/get-model-info.d.ts +2 -2
- package/dist/src/client/api/get-model-info.js +3 -3
- package/dist/src/client/api/get-system-resources.d.ts +2 -2
- package/dist/src/client/api/get-system-resources.js +3 -3
- package/dist/src/client/api/heartbeat.d.ts +3 -2
- package/dist/src/client/api/heartbeat.js +4 -3
- package/dist/src/client/api/index.d.ts +8 -6
- package/dist/src/client/api/index.js +6 -4
- package/dist/src/client/api/invoke-plugin.d.ts +8 -2
- package/dist/src/client/api/invoke-plugin.js +18 -3
- package/dist/src/client/api/load-model.js +9 -6
- package/dist/src/client/api/logging-stream.d.ts +11 -2
- package/dist/src/client/api/logging-stream.js +12 -3
- package/dist/src/client/api/ocr.d.ts +5 -3
- package/dist/src/client/api/ocr.js +45 -22
- package/dist/src/client/api/rag.d.ts +1 -1
- package/dist/src/client/api/rag.js +3 -3
- package/dist/src/client/api/registry.d.ts +19 -8
- package/dist/src/client/api/registry.js +43 -17
- package/dist/src/client/api/rerank.d.ts +22 -0
- package/dist/src/client/api/rerank.js +39 -0
- package/dist/src/client/api/resume.d.ts +2 -1
- package/dist/src/client/api/resume.js +3 -3
- package/dist/src/client/api/rpc-server.d.ts +4 -4
- package/dist/src/client/api/rpc-server.js +12 -12
- package/dist/src/client/api/state.d.ts +2 -2
- package/dist/src/client/api/state.js +3 -3
- package/dist/src/client/api/subscribe-logs.d.ts +2 -2
- package/dist/src/client/api/subscribe-logs.js +4 -3
- package/dist/src/client/api/suspend.d.ts +4 -2
- package/dist/src/client/api/suspend.js +5 -4
- package/dist/src/client/api/text-to-speech.d.ts +14 -5
- package/dist/src/client/api/text-to-speech.js +86 -32
- package/dist/src/client/api/transcribe.d.ts +7 -3
- package/dist/src/client/api/transcribe.js +9 -3
- package/dist/src/client/api/translate.js +2 -2
- package/dist/src/client/api/unload-model.d.ts +19 -7
- package/dist/src/client/api/unload-model.js +31 -13
- package/dist/src/client/api/upscale.d.ts +6 -3
- package/dist/src/client/api/upscale.js +10 -5
- package/dist/src/client/api/vector-index.d.ts +51 -17
- package/dist/src/client/api/vector-index.js +101 -49
- package/dist/src/client/api/video-request.d.ts +5 -5
- package/dist/src/client/api/video.d.ts +3 -2
- package/dist/src/client/api/video.js +6 -5
- package/dist/src/client/api/vla.d.ts +9 -5
- package/dist/src/client/api/vla.js +17 -8
- package/dist/src/client/api/world-result.js +2 -2
- package/dist/src/client/api/world.d.ts +6 -6
- package/dist/src/client/api/world.js +6 -6
- package/dist/src/client/init-hooks.d.ts +6 -4
- package/dist/src/client/init-hooks.js +12 -15
- package/dist/src/client/logging-stream-registry.d.ts +6 -3
- package/dist/src/client/logging-stream-registry.js +36 -14
- package/dist/src/client/plugins-factory.d.ts +1 -1
- package/dist/src/client/plugins-factory.js +1 -1
- package/dist/src/client/rpc/bundle-stamp.d.ts +29 -0
- package/dist/src/client/rpc/bundle-stamp.js +75 -0
- package/dist/src/client/rpc/expo-home-dir.d.ts +2 -0
- package/dist/src/client/rpc/expo-home-dir.js +4 -0
- package/dist/src/client/rpc/expo-rpc-client.js +192 -138
- package/dist/src/client/rpc/node-rpc-client.js +324 -426
- package/dist/src/client/rpc/pear-runtime.d.ts +12 -0
- package/dist/src/client/rpc/pear-runtime.js +12 -0
- package/dist/src/client/rpc/rpc-client.d.ts +6 -4
- package/dist/src/client/rpc/rpc-client.js +168 -31
- package/dist/src/client/rpc/rpc-error.js +24 -2
- package/dist/src/client/rpc/unbundled-harness.d.ts +16 -0
- package/dist/src/client/rpc/unbundled-harness.js +27 -0
- package/dist/src/client/rpc/worker-failure.d.ts +27 -0
- package/dist/src/client/rpc/worker-failure.js +61 -0
- package/dist/src/client/session-registry.d.ts +75 -0
- package/dist/src/client/session-registry.js +149 -0
- package/dist/src/client/session.d.ts +125 -0
- package/dist/src/client/session.js +148 -0
- package/dist/src/commands/bundle/addons.d.ts +14 -0
- package/dist/src/commands/bundle/addons.js +65 -0
- package/dist/src/commands/bundle/constants.js +2 -0
- package/dist/src/commands/bundle/entry-gen.d.ts +1 -5
- package/dist/src/commands/bundle/entry-gen.js +18 -51
- package/dist/src/commands/bundle/index.d.ts +60 -14
- package/dist/src/commands/bundle/index.js +350 -126
- package/dist/src/commands/bundle/link.d.ts +58 -0
- package/dist/src/commands/bundle/link.js +135 -0
- package/dist/src/commands/bundle/node-support.d.ts +13 -0
- package/dist/src/commands/bundle/node-support.js +23 -0
- package/dist/src/commands/bundle/plugins.js +1 -1
- package/dist/src/commands/bundle/read-bundle.d.ts +9 -0
- package/dist/src/commands/bundle/read-bundle.js +27 -0
- package/dist/src/commands/bundle/resolve-sdk-import.d.ts +6 -0
- package/dist/src/commands/bundle/resolve-sdk-import.js +24 -28
- package/dist/src/commands/bundle/scratch.d.ts +35 -0
- package/dist/src/commands/bundle/scratch.js +178 -0
- package/dist/src/commands/bundle/targets.d.ts +14 -0
- package/dist/src/commands/bundle/targets.js +37 -0
- package/dist/src/commands/host-prebuilds/index.d.ts +8 -7
- package/dist/src/commands/host-prebuilds/index.js +13 -11
- package/dist/src/commands/index.d.ts +13 -12
- package/dist/src/commands/index.js +7 -7
- package/dist/src/commands/verify/abi.d.ts +21 -15
- package/dist/src/commands/verify/abi.js +12 -80
- package/dist/src/commands/verify/bare-kit-runtime.d.ts +20 -22
- package/dist/src/commands/verify/bare-kit-runtime.js +102 -150
- package/dist/src/commands/verify/bare-kit-runtimes.d.ts +10 -9
- package/dist/src/commands/verify/bare-kit-runtimes.js +21 -21
- package/dist/src/commands/verify/bundle-source.d.ts +1 -1
- package/dist/src/commands/verify/bundle-source.js +27 -23
- package/dist/src/commands/verify/engines-advice.d.ts +6 -12
- package/dist/src/commands/verify/engines-advice.js +9 -56
- package/dist/src/commands/verify/index.d.ts +34 -33
- package/dist/src/commands/verify/index.js +96 -204
- package/dist/src/commands/verify/node-modules-source.d.ts +1 -1
- package/dist/src/commands/verify/node-modules-source.js +1 -1
- package/dist/src/commands/verify/prebuilds.d.ts +4 -6
- package/dist/src/commands/verify/prebuilds.js +3 -4
- package/dist/src/commands/verify/resource-collectors.d.ts +0 -6
- package/dist/src/commands/verify/resource-collectors.js +3 -52
- package/dist/src/commands/verify/sidecar-runtime.d.ts +6 -0
- package/dist/src/commands/verify/sidecar-runtime.js +51 -0
- package/dist/src/expo/plugins/get-project-root.d.ts +1 -1
- package/dist/src/expo/plugins/withAndroidArchitecture.d.ts +1 -1
- package/dist/src/expo/plugins/withAndroidNdkVersion.d.ts +1 -1
- package/dist/src/expo/plugins/withAndroidNdkVersion.js +16 -10
- package/dist/src/expo/plugins/withBareKit.d.ts +59 -0
- package/dist/src/expo/plugins/withBareKit.js +204 -0
- package/dist/src/expo/plugins/withDeviceInfo.d.ts +1 -1
- package/dist/src/expo/plugins/withDeviceInfo.js +19 -5
- package/dist/src/expo/plugins/withMobileBundle.d.ts +5 -12
- package/dist/src/expo/plugins/withMobileBundle.js +38 -59
- package/dist/src/expo/plugins/withOpenCL.d.ts +1 -1
- package/dist/src/expo/plugins/withQvacSDK.d.ts +2 -1
- package/dist/src/expo/plugins/withQvacSDK.js +3 -0
- package/dist/src/index.d.ts +6 -5
- package/dist/src/index.js +10 -14
- package/dist/src/logging/addon.d.ts +1 -1
- package/dist/src/logging/base-logger.js +1 -1
- package/dist/src/logging/utils.js +11 -3
- package/dist/src/plugin-ids.d.ts +3 -1
- package/dist/src/plugin-ids.js +4 -0
- package/dist/src/schemas/public.d.ts +1 -1
- package/dist/src/schemas/public.js +1 -1
- package/dist/src/schemas/sdk-errors-client.d.ts +5 -6
- package/dist/src/schemas/sdk-errors-client.js +30 -36
- package/dist/src/schemas/sdk-errors-server.d.ts +12 -1
- package/dist/src/schemas/sdk-errors-server.js +65 -2
- package/dist/src/server/rpc/rpc-utils.d.ts +26 -0
- package/dist/src/server/rpc/rpc-utils.js +41 -0
- package/dist/src/utils/aggregate-events.d.ts +1 -1
- package/dist/src/utils/aggregate-events.js +2 -2
- package/dist/src/utils/errors-client.d.ts +37 -29
- package/dist/src/utils/errors-client.js +50 -41
- package/dist/src/utils/errors-server.d.ts +65 -1
- package/dist/src/utils/errors-server.js +122 -1
- package/dist/src/utils/mcp-adapter.d.ts +1 -1
- package/dist/src/utils/mcp-adapter.js +1 -1
- package/dist/src/utils/tool-helpers.js +1 -1
- package/dist/src/utils/withTimeout.js +34 -17
- package/dist/src/worker/handle-request.js +26 -21
- package/dist/src/worker/handler-utils.d.ts +2 -6
- package/dist/src/worker/handler-utils.js +2 -20
- package/dist/src/worker/index.d.ts +2 -4
- package/dist/src/worker/index.js +24 -34
- package/dist/src/worker/plugins/ggml-image-embedding.d.ts +2 -0
- package/dist/src/worker/plugins/ggml-image-embedding.js +1 -0
- package/dist/src/worker/plugins/llamacpp-rerank.d.ts +2 -0
- package/dist/src/worker/plugins/llamacpp-rerank.js +1 -0
- package/dist/src/worker/shim.d.ts +4 -0
- package/dist/src/worker/shim.js +7 -0
- package/dist/src/worker/start.d.ts +9 -0
- package/dist/src/worker/start.js +16 -0
- package/dist/src/worker/unbundled-shim.d.ts +2 -0
- package/dist/src/worker/unbundled-shim.js +4 -0
- package/docs/system-resources-support-matrix.md +27 -19
- package/package.json +91 -74
- package/src/electron-forge/index.cjs +65 -91
- package/dist/examples/model-fit-ui/server.d.ts +0 -24
- package/dist/examples/model-fit-ui/server.js +0 -221
- package/dist/src/client/rpc/ensure-worker-ready.d.ts +0 -9
- package/dist/src/client/rpc/ensure-worker-ready.js +0 -17
- package/dist/src/client/rpc/init-timeout.d.ts +0 -26
- package/dist/src/client/rpc/init-timeout.js +0 -25
- package/dist/src/client/rpc/worker-startup-error.d.ts +0 -12
- package/dist/src/client/rpc/worker-startup-error.js +0 -13
- package/dist/src/commands/bundle/bare-pack.d.ts +0 -21
- package/dist/src/commands/bundle/bare-pack.js +0 -77
- package/dist/src/commands/bundle/manifest.d.ts +0 -25
- package/dist/src/commands/bundle/manifest.js +0 -192
- package/dist/src/expo/plugins/link-addons.d.ts +0 -18
- package/dist/src/expo/plugins/link-addons.js +0 -65
- package/dist/src/pear/pre.d.ts +0 -21
- package/dist/src/pear/pre.js +0 -448
- package/dist/src/server/env.d.ts +0 -22
- package/dist/src/server/env.js +0 -59
- package/dist/src/server/utils/qvac-paths.d.ts +0 -2
- package/dist/src/server/utils/qvac-paths.js +0 -5
- package/dist/src/server/utils/worker-lock.d.ts +0 -3
- package/dist/src/server/utils/worker-lock.js +0 -67
- package/dist/src/worker/create-server.d.ts +0 -8
- package/dist/src/worker/create-server.js +0 -51
- package/dist/src/worker/lifecycle.d.ts +0 -23
- package/dist/src/worker/lifecycle.js +0 -149
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { send } from '
|
|
1
|
+
import { send } from '../../client/rpc/rpc-client.js';
|
|
2
2
|
import { InvalidDeleteCacheParamsError, DeleteCacheFailedError } from '../../utils/errors-client.js';
|
|
3
3
|
/**
|
|
4
|
-
* Deletes KV cache files.
|
|
4
|
+
* Deletes KV cache files, or a registry model's cached download.
|
|
5
5
|
*
|
|
6
6
|
* @param params - The delete cache parameters
|
|
7
7
|
* @param params.all - If true, deletes all cache files, including caller-owned named caches
|
|
8
8
|
* @param params.auto - If true, reclaims only automatic caches (`completion({ kvCache: true })`) that no request is using. Named caches are untouched. Covers the whole cache directory, which is shared by every QVAC process using the same home directory
|
|
9
9
|
* @param params.kvCacheKey - The cache key to delete
|
|
10
10
|
* @param params.modelId - Optional: specific model ID to delete within the cache key. If not provided, deletes entire cache key.
|
|
11
|
+
* @param params.modelSrc - A `registry://` model source. Deletes its cached files and the registry blocks a cancelled or failed download kept for resume. Fails while the model is downloading or loaded
|
|
11
12
|
* @returns Promise resolving to success status
|
|
12
13
|
* @throws {QvacErrorBase} When the cache parameters are invalid (`InvalidDeleteCacheParamsError`) or the server reports a delete failure (`DeleteCacheFailedError`).
|
|
13
14
|
* @example
|
|
@@ -23,9 +24,12 @@ import { InvalidDeleteCacheParamsError, DeleteCacheFailedError } from '../../uti
|
|
|
23
24
|
*
|
|
24
25
|
* // Delete only specific model within cache key
|
|
25
26
|
* await deleteCache({ kvCacheKey: "my-session", modelId: "model-abc123" });
|
|
27
|
+
*
|
|
28
|
+
* // Discard a paused registry download, or a cached registry model
|
|
29
|
+
* await deleteCache({ modelSrc: QWEN3_600M_INST_Q4.src });
|
|
26
30
|
* ```
|
|
27
31
|
*/
|
|
28
|
-
export async function deleteCache(params) {
|
|
32
|
+
export async function deleteCache(params, options) {
|
|
29
33
|
let req;
|
|
30
34
|
if ('all' in params && params.all) {
|
|
31
35
|
req = {
|
|
@@ -39,6 +43,12 @@ export async function deleteCache(params) {
|
|
|
39
43
|
auto: true
|
|
40
44
|
};
|
|
41
45
|
}
|
|
46
|
+
else if ('modelSrc' in params) {
|
|
47
|
+
req = {
|
|
48
|
+
type: 'deleteCache',
|
|
49
|
+
modelSrc: params.modelSrc
|
|
50
|
+
};
|
|
51
|
+
}
|
|
42
52
|
else if ('kvCacheKey' in params) {
|
|
43
53
|
req = {
|
|
44
54
|
type: 'deleteCache',
|
|
@@ -49,7 +59,7 @@ export async function deleteCache(params) {
|
|
|
49
59
|
else {
|
|
50
60
|
throw new InvalidDeleteCacheParamsError();
|
|
51
61
|
}
|
|
52
|
-
const response = (await send(req));
|
|
62
|
+
const response = (await send(req, options));
|
|
53
63
|
if (!response.success && response.error) {
|
|
54
64
|
throw new DeleteCacheFailedError(response.error);
|
|
55
65
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { type DiffusionClientParams, type DiffusionStats } from '@qvac/inference/surface';
|
|
1
|
+
import { type DiffusionClientParams, type DiffusionStats, type RPCOptions } from '@qvac/inference/surface';
|
|
2
2
|
export interface DiffusionProgressTick {
|
|
3
3
|
step: number;
|
|
4
4
|
totalSteps: number;
|
|
5
5
|
elapsedMs: number;
|
|
6
6
|
}
|
|
7
7
|
interface DiffusionResult {
|
|
8
|
+
/** Stable id of this generation; pass to `cancel({ requestId })` to stop it. */
|
|
9
|
+
requestId: string;
|
|
8
10
|
progressStream: AsyncGenerator<DiffusionProgressTick>;
|
|
9
11
|
outputs: Promise<Uint8Array[]>;
|
|
10
12
|
stats: Promise<DiffusionStats | undefined>;
|
|
@@ -13,9 +15,13 @@ interface DiffusionResult {
|
|
|
13
15
|
* Generates images using a loaded diffusion model.
|
|
14
16
|
*
|
|
15
17
|
* @param params - Diffusion request parameters (model, prompt, dimensions, sampler, seed, etc.).
|
|
16
|
-
* @
|
|
18
|
+
* @param options - Optional RPC options (timeout, profiling, force new connection).
|
|
19
|
+
* @returns A result object exposing `requestId` (stable identifier for this generation, for `cancel({ requestId })`), `progressStream` (async iterator of `{ step, totalSteps, elapsedMs }`), `outputs` (promise of the generated image buffers), and `stats` (promise of generation statistics).
|
|
20
|
+
* @throws {InferenceCancelledError} The run's promises reject and progress stream throws when an active generation is cancelled.
|
|
21
|
+
* @throws {RequestRejectedByPolicyError} The run rejects when another image or video generation owns the model.
|
|
17
22
|
*
|
|
18
|
-
* Supports
|
|
23
|
+
* Supports txt2img without input images, img2img via `init_image`,
|
|
24
|
+
* and ordered multi-reference editing via `init_images` on supported models.
|
|
19
25
|
*
|
|
20
26
|
* @example
|
|
21
27
|
* ```typescript
|
|
@@ -29,7 +35,7 @@ interface DiffusionResult {
|
|
|
29
35
|
* const { outputs } = diffusion({ modelId, prompt: "oil painting style", init_image: initImage, strength: 0.7 });
|
|
30
36
|
*
|
|
31
37
|
* // img2img (FLUX.2 — in-context conditioning)
|
|
32
|
-
* // IMPORTANT: FLUX img2img requires `prediction: "flux2_flow"` to be set on the
|
|
38
|
+
* // IMPORTANT: FLUX.2 img2img requires `prediction: "flux2_flow"` to be set on the
|
|
33
39
|
* // model config at loadModel time (e.g. `loadModel(src, { modelType: "diffusion",
|
|
34
40
|
* // modelConfig: { prediction: "flux2_flow" } })`).
|
|
35
41
|
* const { outputs } = diffusion({ modelId, prompt: "turn into watercolor", init_image: initImage });
|
|
@@ -49,6 +55,33 @@ interface DiffusionResult {
|
|
|
49
55
|
* height: 768,
|
|
50
56
|
* });
|
|
51
57
|
*
|
|
58
|
+
* // FLUX.3 Image Klein reference editing. Load the Qwen3-VL 4B encoder and the
|
|
59
|
+
* // FLUX.2 VAE; the engine detects FLUX.3 from the weights, so leave `prediction` unset.
|
|
60
|
+
* const { outputs: flux3Edit } = diffusion({
|
|
61
|
+
* modelId,
|
|
62
|
+
* prompt: "Place the subject in a lush garden, preserving its appearance.",
|
|
63
|
+
* init_images: [refA],
|
|
64
|
+
* width: 512,
|
|
65
|
+
* height: 512,
|
|
66
|
+
* steps: 16,
|
|
67
|
+
* cfg_scale: 1,
|
|
68
|
+
* sampling_method: "euler",
|
|
69
|
+
* });
|
|
70
|
+
*
|
|
71
|
+
* // Qwen-Image-2.1 reference editing. Load the matching Qwen3-VL encoder,
|
|
72
|
+
* // vision projector, and 2.1 VAE from your local files first.
|
|
73
|
+
* const { outputs: edited } = diffusion({
|
|
74
|
+
* modelId,
|
|
75
|
+
* prompt: "Place the two referenced people together in one office.",
|
|
76
|
+
* init_images: [refA, refB],
|
|
77
|
+
* width: 512,
|
|
78
|
+
* height: 512,
|
|
79
|
+
* steps: 30,
|
|
80
|
+
* cfg_scale: 6,
|
|
81
|
+
* sampling_method: "euler",
|
|
82
|
+
* seed: 42,
|
|
83
|
+
* });
|
|
84
|
+
*
|
|
52
85
|
* // LoRA adapter for this generation (absolute path required).
|
|
53
86
|
* // Persistence across subsequent diffusion() calls is controlled at
|
|
54
87
|
* // loadModel time via `modelConfig.lora_apply_mode`.
|
|
@@ -88,6 +121,6 @@ interface DiffusionResult {
|
|
|
88
121
|
* const buffers = await outputs;
|
|
89
122
|
* ```
|
|
90
123
|
*/
|
|
91
|
-
export declare function diffusion(params: DiffusionClientParams): DiffusionResult;
|
|
124
|
+
export declare function diffusion(params: DiffusionClientParams, options?: RPCOptions): DiffusionResult;
|
|
92
125
|
export {};
|
|
93
126
|
//# sourceMappingURL=diffusion.d.ts.map
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { diffusionStreamResponseSchema } from '@qvac/inference/surface';
|
|
2
|
-
import { stream as streamRpc } from '
|
|
2
|
+
import { stream as streamRpc } from '../../client/rpc/rpc-client.js';
|
|
3
|
+
import { generateClientRequestId } from '../../client/api/client-request-id.js';
|
|
3
4
|
import { decodeBase64, encodeBase64 } from '../../utils/encoding.js';
|
|
4
5
|
/**
|
|
5
6
|
* Generates images using a loaded diffusion model.
|
|
6
7
|
*
|
|
7
8
|
* @param params - Diffusion request parameters (model, prompt, dimensions, sampler, seed, etc.).
|
|
8
|
-
* @
|
|
9
|
+
* @param options - Optional RPC options (timeout, profiling, force new connection).
|
|
10
|
+
* @returns A result object exposing `requestId` (stable identifier for this generation, for `cancel({ requestId })`), `progressStream` (async iterator of `{ step, totalSteps, elapsedMs }`), `outputs` (promise of the generated image buffers), and `stats` (promise of generation statistics).
|
|
11
|
+
* @throws {InferenceCancelledError} The run's promises reject and progress stream throws when an active generation is cancelled.
|
|
12
|
+
* @throws {RequestRejectedByPolicyError} The run rejects when another image or video generation owns the model.
|
|
9
13
|
*
|
|
10
|
-
* Supports
|
|
14
|
+
* Supports txt2img without input images, img2img via `init_image`,
|
|
15
|
+
* and ordered multi-reference editing via `init_images` on supported models.
|
|
11
16
|
*
|
|
12
17
|
* @example
|
|
13
18
|
* ```typescript
|
|
@@ -21,7 +26,7 @@ import { decodeBase64, encodeBase64 } from '../../utils/encoding.js';
|
|
|
21
26
|
* const { outputs } = diffusion({ modelId, prompt: "oil painting style", init_image: initImage, strength: 0.7 });
|
|
22
27
|
*
|
|
23
28
|
* // img2img (FLUX.2 — in-context conditioning)
|
|
24
|
-
* // IMPORTANT: FLUX img2img requires `prediction: "flux2_flow"` to be set on the
|
|
29
|
+
* // IMPORTANT: FLUX.2 img2img requires `prediction: "flux2_flow"` to be set on the
|
|
25
30
|
* // model config at loadModel time (e.g. `loadModel(src, { modelType: "diffusion",
|
|
26
31
|
* // modelConfig: { prediction: "flux2_flow" } })`).
|
|
27
32
|
* const { outputs } = diffusion({ modelId, prompt: "turn into watercolor", init_image: initImage });
|
|
@@ -41,6 +46,33 @@ import { decodeBase64, encodeBase64 } from '../../utils/encoding.js';
|
|
|
41
46
|
* height: 768,
|
|
42
47
|
* });
|
|
43
48
|
*
|
|
49
|
+
* // FLUX.3 Image Klein reference editing. Load the Qwen3-VL 4B encoder and the
|
|
50
|
+
* // FLUX.2 VAE; the engine detects FLUX.3 from the weights, so leave `prediction` unset.
|
|
51
|
+
* const { outputs: flux3Edit } = diffusion({
|
|
52
|
+
* modelId,
|
|
53
|
+
* prompt: "Place the subject in a lush garden, preserving its appearance.",
|
|
54
|
+
* init_images: [refA],
|
|
55
|
+
* width: 512,
|
|
56
|
+
* height: 512,
|
|
57
|
+
* steps: 16,
|
|
58
|
+
* cfg_scale: 1,
|
|
59
|
+
* sampling_method: "euler",
|
|
60
|
+
* });
|
|
61
|
+
*
|
|
62
|
+
* // Qwen-Image-2.1 reference editing. Load the matching Qwen3-VL encoder,
|
|
63
|
+
* // vision projector, and 2.1 VAE from your local files first.
|
|
64
|
+
* const { outputs: edited } = diffusion({
|
|
65
|
+
* modelId,
|
|
66
|
+
* prompt: "Place the two referenced people together in one office.",
|
|
67
|
+
* init_images: [refA, refB],
|
|
68
|
+
* width: 512,
|
|
69
|
+
* height: 512,
|
|
70
|
+
* steps: 30,
|
|
71
|
+
* cfg_scale: 6,
|
|
72
|
+
* sampling_method: "euler",
|
|
73
|
+
* seed: 42,
|
|
74
|
+
* });
|
|
75
|
+
*
|
|
44
76
|
* // LoRA adapter for this generation (absolute path required).
|
|
45
77
|
* // Persistence across subsequent diffusion() calls is controlled at
|
|
46
78
|
* // loadModel time via `modelConfig.lora_apply_mode`.
|
|
@@ -80,15 +112,17 @@ import { decodeBase64, encodeBase64 } from '../../utils/encoding.js';
|
|
|
80
112
|
* const buffers = await outputs;
|
|
81
113
|
* ```
|
|
82
114
|
*/
|
|
83
|
-
export function diffusion(params) {
|
|
115
|
+
export function diffusion(params, options) {
|
|
84
116
|
const { init_image, init_images, ...rest } = params;
|
|
117
|
+
const requestId = generateClientRequestId();
|
|
85
118
|
const request = {
|
|
86
119
|
...rest,
|
|
87
120
|
...(init_image !== undefined && { init_image: encodeBase64(init_image) }),
|
|
88
121
|
...(init_images !== undefined && {
|
|
89
122
|
init_images: init_images.map(encodeBase64)
|
|
90
123
|
}),
|
|
91
|
-
type: 'diffusionStream'
|
|
124
|
+
type: 'diffusionStream',
|
|
125
|
+
requestId
|
|
92
126
|
};
|
|
93
127
|
let statsResolver = () => { };
|
|
94
128
|
let statsRejecter = () => { };
|
|
@@ -111,7 +145,7 @@ export function diffusion(params) {
|
|
|
111
145
|
outputsPromise.catch(() => { });
|
|
112
146
|
const processResponses = async () => {
|
|
113
147
|
try {
|
|
114
|
-
for await (const response of streamRpc(request)) {
|
|
148
|
+
for await (const response of streamRpc(request, options)) {
|
|
115
149
|
if (response &&
|
|
116
150
|
typeof response === 'object' &&
|
|
117
151
|
'type' in response &&
|
|
@@ -170,6 +204,7 @@ export function diffusion(params) {
|
|
|
170
204
|
}
|
|
171
205
|
})();
|
|
172
206
|
return {
|
|
207
|
+
requestId,
|
|
173
208
|
progressStream,
|
|
174
209
|
outputs: outputsPromise,
|
|
175
210
|
stats: statsPromise
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { send, stream } from '
|
|
1
|
+
import { send, stream } from '../../client/rpc/rpc-client.js';
|
|
2
2
|
import { downloadAssetOptionsToRequestSchema } from '@qvac/inference/surface';
|
|
3
3
|
import { DownloadAssetFailedError, StreamEndedError, InvalidResponseError } from '../../utils/errors-client.js';
|
|
4
4
|
import { decoratePromise } from '../../utils/decorate-promise.js';
|
|
5
|
-
import { parseClientInput } from '
|
|
6
|
-
import { generateClientRequestId } from '
|
|
5
|
+
import { parseClientInput } from '../../client/parse-input.js';
|
|
6
|
+
import { generateClientRequestId } from '../../client/api/client-request-id.js';
|
|
7
7
|
/**
|
|
8
8
|
* Downloads an asset (model file) without loading it into memory.
|
|
9
9
|
*
|
|
@@ -1,42 +1,95 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { send } from '../../client/rpc/rpc-client.js';
|
|
2
|
+
import { type EmbedClientParams, type EmbedBatchClientParams, type EmbedClientInput, type EmbedInput, type EmbedStats, type RPCOptions } from '@qvac/inference/surface';
|
|
3
|
+
type EmbedResult<T> = Promise<{
|
|
4
|
+
embedding: T;
|
|
5
|
+
stats?: EmbedStats;
|
|
6
|
+
}> & {
|
|
7
|
+
requestId: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Embeds one input supported by the loaded model.
|
|
11
|
+
*
|
|
12
|
+
* @overloadLabel "Single input"
|
|
13
|
+
* @param params - Model identifier and text, ordered text/media parts, or image bytes.
|
|
14
|
+
* @param options - Optional RPC options.
|
|
15
|
+
* @returns One vector, optional statistics, and a synchronous requestId for cancellation.
|
|
16
|
+
* @throws {QvacErrorBase} When validation or inference fails.
|
|
17
|
+
*/
|
|
18
|
+
export declare function embed(params: {
|
|
19
|
+
modelId: string;
|
|
20
|
+
input: EmbedClientInput;
|
|
21
|
+
text?: never;
|
|
22
|
+
inputs?: never;
|
|
23
|
+
}, options?: RPCOptions): EmbedResult<number[]>;
|
|
2
24
|
/**
|
|
3
|
-
*
|
|
25
|
+
* Embeds one text string.
|
|
4
26
|
*
|
|
5
27
|
* @overloadLabel "Single text"
|
|
6
|
-
* @param params -
|
|
7
|
-
* @param
|
|
8
|
-
* @
|
|
9
|
-
* @
|
|
10
|
-
* @returns A promise (decorated with `requestId`) resolving to an object with `embedding` (a single `number[]` vector) and optional `stats` performance data.
|
|
11
|
-
* @throws {QvacErrorBase} When the response type is invalid or when the embedding fails
|
|
28
|
+
* @param params - Model identifier and text.
|
|
29
|
+
* @param options - Optional RPC options.
|
|
30
|
+
* @returns One vector with optional statistics and a requestId for cancellation.
|
|
31
|
+
* @throws {QvacErrorBase} When validation or inference fails.
|
|
12
32
|
*/
|
|
13
33
|
export declare function embed(params: {
|
|
14
34
|
modelId: string;
|
|
15
35
|
text: string;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}> & {
|
|
20
|
-
requestId: string;
|
|
21
|
-
};
|
|
36
|
+
inputs?: never;
|
|
37
|
+
input?: never;
|
|
38
|
+
}, options?: RPCOptions): EmbedResult<number[]>;
|
|
22
39
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* @
|
|
29
|
-
* @param
|
|
30
|
-
* @
|
|
31
|
-
* @
|
|
40
|
+
* @deprecated Use `embedBatch({ modelId, inputs })` instead. This overload will be
|
|
41
|
+
* removed in the next major version.
|
|
42
|
+
*
|
|
43
|
+
* Embeds each string in a text array.
|
|
44
|
+
*
|
|
45
|
+
* @overloadLabel "Legacy text batch (deprecated)"
|
|
46
|
+
* @param params - Model identifier and text strings.
|
|
47
|
+
* @param options - Optional RPC options.
|
|
48
|
+
* @returns One vector per string, optional statistics, and a requestId.
|
|
49
|
+
* @throws {QvacErrorBase} When validation or inference fails.
|
|
32
50
|
*/
|
|
33
51
|
export declare function embed(params: {
|
|
34
52
|
modelId: string;
|
|
35
53
|
text: string[];
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
54
|
+
inputs?: never;
|
|
55
|
+
input?: never;
|
|
56
|
+
}, options?: RPCOptions): EmbedResult<number[][]>;
|
|
57
|
+
/**
|
|
58
|
+
* @deprecated Use `embedBatch({ modelId, inputs })` instead. This overload will be
|
|
59
|
+
* removed in the next major version.
|
|
60
|
+
*
|
|
61
|
+
* Embeds each text or ordered text/media input.
|
|
62
|
+
*
|
|
63
|
+
* @overloadLabel "Legacy inputs batch (deprecated)"
|
|
64
|
+
* @param params - Model identifier and text or ordered text/media inputs. Images go through embedBatch.
|
|
65
|
+
* @param options - Optional RPC options.
|
|
66
|
+
* @returns One vector per input, optional statistics, and a requestId.
|
|
67
|
+
* @throws {QvacErrorBase} When validation or inference fails.
|
|
68
|
+
*/
|
|
69
|
+
export declare function embed(params: {
|
|
70
|
+
modelId: string;
|
|
71
|
+
inputs: EmbedInput[];
|
|
72
|
+
text?: never;
|
|
73
|
+
input?: never;
|
|
74
|
+
}, options?: RPCOptions): EmbedResult<number[][]>;
|
|
75
|
+
/**
|
|
76
|
+
* Embeds a single input or a legacy batch supported by the loaded model.
|
|
77
|
+
*
|
|
78
|
+
* @param params - Model identifier and input.
|
|
79
|
+
* @param options - Optional RPC options.
|
|
80
|
+
* @returns Embeddings, optional statistics, and a requestId for cancellation.
|
|
81
|
+
* @throws {QvacErrorBase} When validation or inference fails.
|
|
82
|
+
*/
|
|
83
|
+
export declare function embed(params: EmbedClientParams, options?: RPCOptions): EmbedResult<number[] | number[][]>;
|
|
84
|
+
/**
|
|
85
|
+
* Embeds a batch of inputs supported by the loaded model, in input order.
|
|
86
|
+
*
|
|
87
|
+
* @param params - Model identifier and a non-empty list of inputs.
|
|
88
|
+
* @param options - Optional RPC options.
|
|
89
|
+
* @returns One vector per input, including one-item batches, optional statistics, and a requestId.
|
|
90
|
+
* @throws {QvacErrorBase} When validation or inference fails.
|
|
91
|
+
*/
|
|
92
|
+
export declare function embedBatch(params: EmbedBatchClientParams, options?: RPCOptions): EmbedResult<number[][]>;
|
|
93
|
+
export declare function createEmbedCall(params: EmbedClientParams, options?: RPCOptions, sendRequest?: typeof send): EmbedResult<number[] | number[][]>;
|
|
94
|
+
export {};
|
|
42
95
|
//# sourceMappingURL=embed.d.ts.map
|
|
@@ -1,30 +1,75 @@
|
|
|
1
|
-
import { send } from '
|
|
2
|
-
import {} from '@qvac/inference/surface';
|
|
1
|
+
import { send } from '../../client/rpc/rpc-client.js';
|
|
2
|
+
import { embedClientParamsSchema, embedBatchClientParamsSchema, embedResponseSchema, embedBatchResponseSchema } from '@qvac/inference/surface';
|
|
3
3
|
import { InvalidResponseError } from '../../utils/errors-client.js';
|
|
4
|
+
import { parseClientInput } from '../../client/parse-input.js';
|
|
5
|
+
import { encodeBase64 } from '../../utils/encoding.js';
|
|
4
6
|
import { decoratePromise } from '../../utils/decorate-promise.js';
|
|
5
|
-
import { generateClientRequestId } from '
|
|
7
|
+
import { generateClientRequestId } from '../../client/api/client-request-id.js';
|
|
8
|
+
import { getClientLogger } from '../../logging/index.js';
|
|
9
|
+
const logger = getClientLogger();
|
|
6
10
|
export function embed(params, options) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
return createEmbedCall(params, options);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Embeds a batch of inputs supported by the loaded model, in input order.
|
|
15
|
+
*
|
|
16
|
+
* @param params - Model identifier and a non-empty list of inputs.
|
|
17
|
+
* @param options - Optional RPC options.
|
|
18
|
+
* @returns One vector per input, including one-item batches, optional statistics, and a requestId.
|
|
19
|
+
* @throws {QvacErrorBase} When validation or inference fails.
|
|
20
|
+
*/
|
|
21
|
+
export function embedBatch(params, options) {
|
|
12
22
|
const requestId = generateClientRequestId();
|
|
13
|
-
|
|
14
|
-
return decoratePromise(inner, { requestId });
|
|
23
|
+
return decoratePromise(runEmbedBatch(params, requestId, options), { requestId });
|
|
15
24
|
}
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
export function createEmbedCall(params, options, sendRequest = send) {
|
|
26
|
+
const requestId = generateClientRequestId();
|
|
27
|
+
return decoratePromise(runEmbed(params, requestId, options, sendRequest), { requestId });
|
|
28
|
+
}
|
|
29
|
+
function encodeInput(input) {
|
|
30
|
+
return typeof input === 'object' && !Array.isArray(input)
|
|
31
|
+
? { ...input, image: encodeBase64(input.image) }
|
|
32
|
+
: input;
|
|
33
|
+
}
|
|
34
|
+
async function runEmbed(params, requestId, options, sendRequest) {
|
|
35
|
+
const parsed = parseClientInput(embedClientParamsSchema, params);
|
|
36
|
+
if (parsed.inputs !== undefined) {
|
|
37
|
+
logger.warn('embed() with inputs is deprecated. Use embedBatch() instead.');
|
|
25
38
|
}
|
|
39
|
+
else if (Array.isArray(parsed.text)) {
|
|
40
|
+
logger.warn('embed() with a text array is deprecated. Use embedBatch() instead.');
|
|
41
|
+
}
|
|
42
|
+
const request = parsed.input !== undefined
|
|
43
|
+
? { modelId: parsed.modelId, input: encodeInput(parsed.input) }
|
|
44
|
+
: parsed.inputs !== undefined
|
|
45
|
+
? { modelId: parsed.modelId, inputs: parsed.inputs }
|
|
46
|
+
: { modelId: parsed.modelId, text: parsed.text };
|
|
47
|
+
const response = await sendRequest({ ...request, type: 'embed', requestId }, options);
|
|
48
|
+
if (response.type !== 'embed')
|
|
49
|
+
throw new InvalidResponseError('embed');
|
|
50
|
+
const result = embedResponseSchema.safeParse(response);
|
|
51
|
+
if (!result.success)
|
|
52
|
+
throw new InvalidResponseError('embed', result.error);
|
|
53
|
+
return {
|
|
54
|
+
embedding: result.data.embedding,
|
|
55
|
+
...(result.data.stats !== undefined && { stats: result.data.stats })
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
async function runEmbedBatch(params, requestId, options) {
|
|
59
|
+
const parsed = parseClientInput(embedBatchClientParamsSchema, params);
|
|
60
|
+
const response = await send({
|
|
61
|
+
modelId: parsed.modelId,
|
|
62
|
+
inputs: parsed.inputs.map(encodeInput),
|
|
63
|
+
type: 'embedBatch',
|
|
64
|
+
requestId
|
|
65
|
+
}, options);
|
|
66
|
+
if (response.type !== 'embedBatch')
|
|
67
|
+
throw new InvalidResponseError('embedBatch');
|
|
68
|
+
const result = embedBatchResponseSchema.safeParse(response);
|
|
69
|
+
if (!result.success)
|
|
70
|
+
throw new InvalidResponseError('embedBatch', result.error);
|
|
26
71
|
return {
|
|
27
|
-
embedding:
|
|
28
|
-
...(
|
|
72
|
+
embedding: result.data.embedding,
|
|
73
|
+
...(result.data.stats !== undefined && { stats: result.data.stats })
|
|
29
74
|
};
|
|
30
75
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { send, stream as streamRpc } from '
|
|
1
|
+
import { send, stream as streamRpc } from '../../client/rpc/rpc-client.js';
|
|
2
2
|
import { finetuneRunParamsSchema, finetuneRunRequestSchema, finetuneStopRequestSchema, finetuneGetStateParamsSchema, finetuneGetStateRequestSchema, finetuneProgressResponseSchema, finetuneResponseSchema } from '@qvac/inference/surface';
|
|
3
3
|
import { InvalidResponseError, StreamEndedError } from '../../utils/errors-client.js';
|
|
4
|
-
import { parseClientInput } from '
|
|
5
|
-
import { generateClientRequestId } from '
|
|
4
|
+
import { parseClientInput } from '../../client/parse-input.js';
|
|
5
|
+
import { generateClientRequestId } from '../../client/api/client-request-id.js';
|
|
6
6
|
function isFinetuneReplyParams(params) {
|
|
7
7
|
return (params.operation === 'pause' || params.operation === 'cancel' || params.operation === 'getState');
|
|
8
8
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {} from '@qvac/inference/surface';
|
|
2
|
-
import { send } from '
|
|
2
|
+
import { send } from '../../client/rpc/rpc-client.js';
|
|
3
3
|
import { InvalidResponseError } from '../../utils/errors-client.js';
|
|
4
4
|
/**
|
|
5
5
|
* Returns introspection info for a loaded `modelId`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type GetModelInfoParams, type ModelInfo } from '@qvac/inference/surface';
|
|
1
|
+
import { type GetModelInfoParams, type ModelInfo, type RPCOptions } from '@qvac/inference/surface';
|
|
2
2
|
/**
|
|
3
3
|
* Returns status information for a catalog model, including cache state and loaded instances.
|
|
4
4
|
*
|
|
@@ -7,5 +7,5 @@ import { type GetModelInfoParams, type ModelInfo } from '@qvac/inference/surface
|
|
|
7
7
|
* @returns A promise resolving to the model's status information (cache presence, loaded instances, size on disk, etc.).
|
|
8
8
|
* @throws {QvacErrorBase} When the response type is invalid (`InvalidResponseError`) or the RPC layer fails.
|
|
9
9
|
*/
|
|
10
|
-
export declare function getModelInfo(params: GetModelInfoParams): Promise<ModelInfo>;
|
|
10
|
+
export declare function getModelInfo(params: GetModelInfoParams, options?: RPCOptions): Promise<ModelInfo>;
|
|
11
11
|
//# sourceMappingURL=get-model-info.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {} from '@qvac/inference/surface';
|
|
2
|
-
import { send } from '
|
|
2
|
+
import { send } from '../../client/rpc/rpc-client.js';
|
|
3
3
|
import { InvalidResponseError } from '../../utils/errors-client.js';
|
|
4
4
|
/**
|
|
5
5
|
* Returns status information for a catalog model, including cache state and loaded instances.
|
|
@@ -9,12 +9,12 @@ import { InvalidResponseError } from '../../utils/errors-client.js';
|
|
|
9
9
|
* @returns A promise resolving to the model's status information (cache presence, loaded instances, size on disk, etc.).
|
|
10
10
|
* @throws {QvacErrorBase} When the response type is invalid (`InvalidResponseError`) or the RPC layer fails.
|
|
11
11
|
*/
|
|
12
|
-
export async function getModelInfo(params) {
|
|
12
|
+
export async function getModelInfo(params, options) {
|
|
13
13
|
const request = {
|
|
14
14
|
type: 'getModelInfo',
|
|
15
15
|
name: params.name
|
|
16
16
|
};
|
|
17
|
-
const response = await send(request);
|
|
17
|
+
const response = await send(request, options);
|
|
18
18
|
if (response.type !== 'getModelInfo') {
|
|
19
19
|
throw new InvalidResponseError('getModelInfo');
|
|
20
20
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type GetSystemResourcesInput, type SystemResources } from '@qvac/inference/surface';
|
|
1
|
+
import { type GetSystemResourcesInput, type SystemResources, type RPCOptions } from '@qvac/inference/surface';
|
|
2
2
|
/**
|
|
3
3
|
* Read the worker's system capabilities and optional resource sample.
|
|
4
4
|
*
|
|
@@ -7,5 +7,5 @@ import { type GetSystemResourcesInput, type SystemResources } from '@qvac/infere
|
|
|
7
7
|
* @throws {InvalidResponseError} If the worker returns a different response type.
|
|
8
8
|
* @throws {Error} If the RPC request fails.
|
|
9
9
|
*/
|
|
10
|
-
export declare function getSystemResources(input?: GetSystemResourcesInput): Promise<SystemResources>;
|
|
10
|
+
export declare function getSystemResources(input?: GetSystemResourcesInput, options?: RPCOptions): Promise<SystemResources>;
|
|
11
11
|
//# sourceMappingURL=get-system-resources.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import {} from '@qvac/inference/surface';
|
|
2
|
-
import { send } from '
|
|
2
|
+
import { send } from '../../client/rpc/rpc-client.js';
|
|
3
3
|
import { InvalidResponseError } from '../../utils/errors-client.js';
|
|
4
4
|
/**
|
|
5
5
|
* Read the worker's system capabilities and optional resource sample.
|
|
@@ -9,12 +9,12 @@ import { InvalidResponseError } from '../../utils/errors-client.js';
|
|
|
9
9
|
* @throws {InvalidResponseError} If the worker returns a different response type.
|
|
10
10
|
* @throws {Error} If the RPC request fails.
|
|
11
11
|
*/
|
|
12
|
-
export async function getSystemResources(input) {
|
|
12
|
+
export async function getSystemResources(input, options) {
|
|
13
13
|
const request = {
|
|
14
14
|
type: 'getSystemResources',
|
|
15
15
|
...(input?.sample !== undefined && { sample: input.sample })
|
|
16
16
|
};
|
|
17
|
-
const response = await send(request);
|
|
17
|
+
const response = await send(request, options);
|
|
18
18
|
if (response.type !== 'getSystemResources') {
|
|
19
19
|
throw new InvalidResponseError('getSystemResources');
|
|
20
20
|
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { type HeartbeatResponse } from '@qvac/inference/surface';
|
|
1
|
+
import { type HeartbeatResponse, type RPCOptions } from '@qvac/inference/surface';
|
|
2
2
|
/**
|
|
3
3
|
* Checks whether the local SDK worker is responsive by sending a heartbeat
|
|
4
4
|
* round-trip.
|
|
5
5
|
*
|
|
6
|
+
* @param options - Optional RPC options (timeout, profiling, force new connection).
|
|
6
7
|
* @returns A promise that resolves to a heartbeat response.
|
|
7
8
|
* @throws {QvacErrorBase} When the response is invalid.
|
|
8
9
|
*
|
|
9
10
|
* @example
|
|
10
11
|
* await heartbeat();
|
|
11
12
|
*/
|
|
12
|
-
export declare function heartbeat(): Promise<HeartbeatResponse>;
|
|
13
|
+
export declare function heartbeat(options?: RPCOptions): Promise<HeartbeatResponse>;
|
|
13
14
|
//# sourceMappingURL=heartbeat.d.ts.map
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import {} from '@qvac/inference/surface';
|
|
2
|
-
import { send } from '
|
|
2
|
+
import { send } from '../../client/rpc/rpc-client.js';
|
|
3
3
|
import { InvalidResponseError } from '../../utils/errors-client.js';
|
|
4
4
|
/**
|
|
5
5
|
* Checks whether the local SDK worker is responsive by sending a heartbeat
|
|
6
6
|
* round-trip.
|
|
7
7
|
*
|
|
8
|
+
* @param options - Optional RPC options (timeout, profiling, force new connection).
|
|
8
9
|
* @returns A promise that resolves to a heartbeat response.
|
|
9
10
|
* @throws {QvacErrorBase} When the response is invalid.
|
|
10
11
|
*
|
|
11
12
|
* @example
|
|
12
13
|
* await heartbeat();
|
|
13
14
|
*/
|
|
14
|
-
export async function heartbeat() {
|
|
15
|
+
export async function heartbeat(options) {
|
|
15
16
|
const request = { type: 'heartbeat' };
|
|
16
|
-
const response = await send(request);
|
|
17
|
+
const response = await send(request, options);
|
|
17
18
|
if (response.type !== 'heartbeat') {
|
|
18
19
|
throw new InvalidResponseError('heartbeat');
|
|
19
20
|
}
|
|
@@ -3,18 +3,19 @@ export { downloadAsset } from './download-asset.js';
|
|
|
3
3
|
export { batchCompletion } from './batch-completion.js';
|
|
4
4
|
export { completion } from './completion-stream.js';
|
|
5
5
|
export { deleteCache } from './delete-cache.js';
|
|
6
|
-
export {
|
|
6
|
+
export { calcTokens, type CalcTokensClientParams } from './calc-tokens.js';
|
|
7
|
+
export { unloadModel, type UnloadModelResult } from './unload-model.js';
|
|
7
8
|
export { loggingStream } from './logging-stream.js';
|
|
8
9
|
export { subscribeServerLogs, type ServerLogHandler } from './subscribe-logs.js';
|
|
9
10
|
export { heartbeat } from './heartbeat.js';
|
|
10
11
|
export { transcribe, transcribeStream } from './transcribe.js';
|
|
11
12
|
export { bciTranscribe, bciTranscribeStream } from './bci-transcribe.js';
|
|
12
|
-
export { embed } from './embed.js';
|
|
13
|
+
export { embed, embedBatch } from './embed.js';
|
|
13
14
|
export { finetune, type FinetuneHandle } from './finetune.js';
|
|
14
15
|
export { translate } from './translate.js';
|
|
15
16
|
export { cancel } from './cancel.js';
|
|
16
17
|
export { ragChunk, ragIngest, ragSaveEmbeddings, ragSearch, ragDeleteEmbeddings, ragReindex, ragListWorkspaces, ragCloseWorkspace, ragDeleteWorkspace } from './rag.js';
|
|
17
|
-
export { createVectorIndex, loadVectorIndex, type VectorIndex } from './vector-index.js';
|
|
18
|
+
export { createVectorIndex, loadVectorIndex, type VectorIndex, type VectorIndexOperation } from './vector-index.js';
|
|
18
19
|
export { textToSpeech, textToSpeechStream } from './text-to-speech.js';
|
|
19
20
|
export { getModelInfo } from './get-model-info.js';
|
|
20
21
|
export { getLoadedModelInfo } from './get-loaded-model-info.js';
|
|
@@ -34,9 +35,10 @@ export { resume } from './resume.js';
|
|
|
34
35
|
export { state } from './state.js';
|
|
35
36
|
export { vla, vlaHparams, vlaSetEmbodiment } from './vla.js';
|
|
36
37
|
export { vlaPreprocessImage, vlaPadState, VLA_DEFAULT_IMAGE_SIZE } from './vla-helpers.js';
|
|
37
|
-
export { audioGen } from '
|
|
38
|
-
export { audioEdit } from '
|
|
39
|
-
export { audioUnderstand } from '
|
|
38
|
+
export { audioGen } from '../../client/api/audio-gen.js';
|
|
39
|
+
export { audioEdit } from '../../client/api/audio-edit.js';
|
|
40
|
+
export { audioUnderstand } from '../../client/api/audio-understand.js';
|
|
40
41
|
export { startRpcServer, stopRpcServer, discoverRpcServers } from './rpc-server.js';
|
|
41
42
|
export { decide } from './decide.js';
|
|
43
|
+
export { rerank } from './rerank.js';
|
|
42
44
|
//# sourceMappingURL=index.d.ts.map
|