@qvac/sdk 0.9.1 → 0.10.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 +15 -68
- package/dist/client/api/cancel.d.ts +1 -1
- package/dist/client/api/cancel.js +1 -1
- package/dist/client/api/completion-stream.d.ts +51 -12
- package/dist/client/api/completion-stream.js +129 -56
- package/dist/client/api/delete-cache.d.ts +1 -0
- package/dist/client/api/delete-cache.js +1 -0
- package/dist/client/api/diffusion.d.ts +17 -2
- package/dist/client/api/diffusion.js +21 -4
- package/dist/client/api/embed.d.ts +4 -0
- package/dist/client/api/finetune.d.ts +21 -0
- package/dist/client/api/get-loaded-model-info.d.ts +25 -0
- package/dist/client/api/get-loaded-model-info.js +36 -0
- package/dist/client/api/get-model-info.d.ts +9 -1
- package/dist/client/api/get-model-info.js +8 -0
- package/dist/client/api/heartbeat.d.ts +2 -2
- package/dist/client/api/heartbeat.js +2 -2
- package/dist/client/api/index.d.ts +3 -1
- package/dist/client/api/index.js +3 -1
- package/dist/client/api/invoke-plugin.d.ts +16 -0
- package/dist/client/api/invoke-plugin.js +16 -0
- package/dist/client/api/load-model.d.ts +36 -3
- package/dist/client/api/load-model.js +31 -10
- package/dist/client/api/provide.d.ts +11 -5
- package/dist/client/api/provide.js +11 -6
- package/dist/client/api/rag.d.ts +9 -0
- package/dist/client/api/rag.js +9 -0
- package/dist/client/api/registry.d.ts +26 -0
- package/dist/client/api/registry.js +26 -0
- package/dist/client/api/resume.d.ts +20 -4
- package/dist/client/api/resume.js +20 -4
- package/dist/client/api/state.d.ts +23 -0
- package/dist/client/api/state.js +29 -0
- package/dist/client/api/stop-provider.d.ts +11 -5
- package/dist/client/api/stop-provider.js +11 -5
- package/dist/client/api/suspend.d.ts +21 -3
- package/dist/client/api/suspend.js +21 -3
- package/dist/client/api/text-to-speech.d.ts +64 -6
- package/dist/client/api/text-to-speech.js +423 -47
- package/dist/client/api/transcribe.d.ts +29 -4
- package/dist/client/api/transcribe.js +86 -28
- package/dist/client/api/translate.d.ts +1 -0
- package/dist/client/api/translate.js +1 -0
- package/dist/client/rpc/bare-client.js +22 -1
- package/dist/client/rpc/expo-rpc-client.d.ts +1 -1
- package/dist/client/rpc/expo-rpc-client.js +96 -4
- package/dist/client/rpc/node-rpc-client.js +36 -0
- package/dist/examples/audio/mic-input.d.ts +9 -0
- package/dist/examples/audio/mic-input.js +111 -0
- package/dist/examples/completion-events.d.ts +18 -0
- package/dist/examples/completion-events.js +79 -0
- package/dist/examples/delegated-inference/composite.js +12 -18
- package/dist/examples/delegated-inference/consumer-profiled.js +4 -11
- package/dist/examples/delegated-inference/consumer.js +8 -13
- package/dist/examples/delegated-inference/provider.js +11 -16
- package/dist/examples/diffusion-flux2-klein-img2img.d.ts +2 -0
- package/dist/examples/diffusion-flux2-klein-img2img.js +60 -0
- package/dist/examples/diffusion-flux2-klein.js +1 -0
- package/dist/examples/diffusion-img2img.d.ts +2 -0
- package/dist/examples/diffusion-img2img.js +49 -0
- package/dist/examples/diffusion-txt2img.js +2 -1
- package/dist/examples/kv-cache-example.js +11 -12
- package/dist/examples/llamacpp-cache.d.ts +2 -0
- package/dist/examples/llamacpp-cache.js +107 -0
- package/dist/examples/llamacpp-dynamic-tools.d.ts +2 -0
- package/dist/examples/llamacpp-dynamic-tools.js +144 -0
- package/dist/examples/llamacpp-native-tools.js +2 -8
- package/dist/examples/llamacpp-structured-output.d.ts +2 -0
- package/dist/examples/llamacpp-structured-output.js +106 -0
- package/dist/examples/llamacpp-tools-pythonic.d.ts +2 -0
- package/dist/examples/llamacpp-tools-pythonic.js +69 -0
- package/dist/examples/plugins.js +4 -4
- package/dist/examples/suspend-resume.js +21 -4
- package/dist/examples/transcription/parakeet-microphone-record.js +6 -33
- package/dist/examples/transcription/whispercpp-filesystem-streaming.js +7 -5
- package/dist/examples/transcription/whispercpp-filesystem.js +12 -3
- package/dist/examples/transcription/whispercpp-microphone-record.js +6 -29
- package/dist/examples/translation/translation-stream.js +5 -5
- package/dist/examples/tts/llm-to-tts-streaming.d.ts +16 -0
- package/dist/examples/tts/llm-to-tts-streaming.js +143 -0
- package/dist/examples/tts/supertonic-multilingual.js +3 -3
- package/dist/examples/tts/supertonic.js +3 -3
- package/dist/examples/tts/utils.d.ts +11 -1
- package/dist/examples/tts/utils.js +70 -17
- package/dist/examples/voice-assistant/voice-assistant.d.ts +2 -0
- package/dist/examples/voice-assistant/voice-assistant.js +207 -0
- package/dist/expo/plugins/withMobileBundle.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/logging/logger.d.ts +11 -0
- package/dist/logging/logger.js +11 -0
- package/dist/logging/types.d.ts +18 -0
- package/dist/models/registry/models.d.ts +6620 -6185
- package/dist/models/registry/models.js +6296 -5318
- package/dist/models/update-models/codegen.js +84 -23
- package/dist/models/update-models/companions.d.ts +18 -0
- package/dist/models/update-models/companions.js +175 -0
- package/dist/models/update-models/naming.js +0 -25
- package/dist/models/update-models/registry.js +4 -2
- package/dist/models/update-models/types.d.ts +37 -9
- package/dist/profiling/index.d.ts +49 -0
- package/dist/profiling/index.js +49 -0
- package/dist/schemas/cancel.d.ts +6 -2
- package/dist/schemas/cancel.js +14 -7
- package/dist/schemas/common.d.ts +361 -279
- package/dist/schemas/common.js +26 -5
- package/dist/schemas/completion-event.d.ts +225 -0
- package/dist/schemas/completion-event.js +79 -0
- package/dist/schemas/completion-stream.d.ts +122 -31
- package/dist/schemas/completion-stream.js +137 -36
- package/dist/schemas/delegate.d.ts +0 -2
- package/dist/schemas/delegate.js +25 -6
- package/dist/schemas/download-asset.d.ts +5 -5
- package/dist/schemas/embed.js +21 -9
- package/dist/schemas/engine-addon-map.d.ts +11 -1
- package/dist/schemas/engine-addon-map.js +2 -2
- package/dist/schemas/finetune.d.ts +16 -16
- package/dist/schemas/finetune.js +8 -8
- package/dist/schemas/get-loaded-model-info.d.ts +52 -0
- package/dist/schemas/get-loaded-model-info.js +44 -0
- package/dist/schemas/get-model-info.d.ts +2 -2
- package/dist/schemas/get-model-info.js +103 -32
- package/dist/schemas/heartbeat.d.ts +0 -1
- package/dist/schemas/index.d.ts +4 -1
- package/dist/schemas/index.js +4 -1
- package/dist/schemas/llamacpp-config.d.ts +14 -4
- package/dist/schemas/llamacpp-config.js +5 -0
- package/dist/schemas/load-model.d.ts +3233 -1260
- package/dist/schemas/load-model.js +23 -16
- package/dist/schemas/model-src-utils.d.ts +7 -6
- package/dist/schemas/model-src-utils.js +27 -1
- package/dist/schemas/model-types.d.ts +4 -4
- package/dist/schemas/ocr.d.ts +1 -1
- package/dist/schemas/plugin.d.ts +27 -3
- package/dist/schemas/plugin.js +27 -2
- package/dist/schemas/profiling.js +11 -3
- package/dist/schemas/provide.d.ts +1 -3
- package/dist/schemas/provide.js +0 -3
- package/dist/schemas/rag.d.ts +4 -4
- package/dist/schemas/registry.d.ts +10 -10
- package/dist/schemas/registry.js +36 -14
- package/dist/schemas/reload-config.d.ts +73 -7
- package/dist/schemas/sdcpp-config.d.ts +16 -8
- package/dist/schemas/sdcpp-config.js +118 -25
- package/dist/schemas/sdk-config.d.ts +116 -90
- package/dist/schemas/sdk-config.js +16 -0
- package/dist/schemas/sdk-errors-client.d.ts +3 -0
- package/dist/schemas/sdk-errors-client.js +16 -1
- package/dist/schemas/sdk-errors-server.d.ts +3 -0
- package/dist/schemas/sdk-errors-server.js +23 -0
- package/dist/schemas/state.d.ts +23 -0
- package/dist/schemas/state.js +14 -0
- package/dist/schemas/stop-provide.d.ts +0 -5
- package/dist/schemas/stop-provide.js +2 -6
- package/dist/schemas/text-to-speech.d.ts +93 -27
- package/dist/schemas/text-to-speech.js +27 -0
- package/dist/schemas/tools.d.ts +16 -0
- package/dist/schemas/tools.js +15 -0
- package/dist/schemas/transcription-config.d.ts +8 -8
- package/dist/schemas/transcription.d.ts +33 -0
- package/dist/schemas/transcription.js +9 -0
- package/dist/schemas/translate.js +59 -19
- package/dist/schemas/translation-config.d.ts +157 -133
- package/dist/schemas/translation-config.js +34 -11
- package/dist/server/bare/delegate-rpc-client.d.ts +1 -1
- package/dist/server/bare/delegate-rpc-client.js +131 -122
- package/dist/server/bare/hyperswarm.d.ts +2 -2
- package/dist/server/bare/hyperswarm.js +12 -7
- package/dist/server/bare/ops/cancel.js +7 -0
- package/dist/server/bare/ops/kv-cache-utils.d.ts +7 -10
- package/dist/server/bare/ops/kv-cache-utils.js +31 -40
- package/dist/server/bare/ops/load-model.js +0 -1
- package/dist/server/bare/ops/transcribe.d.ts +11 -4
- package/dist/server/bare/ops/transcribe.js +25 -4
- package/dist/server/bare/ops/translate.js +42 -4
- package/dist/server/bare/ops/unload-model.js +21 -19
- package/dist/server/bare/plugins/llamacpp-completion/ops/cache-logger.js +1 -2
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.d.ts +13 -8
- package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.js +257 -85
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-state.d.ts +101 -0
- package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-state.js +135 -0
- package/dist/server/bare/plugins/llamacpp-completion/plugin.d.ts +83 -26
- package/dist/server/bare/plugins/llamacpp-completion/plugin.js +57 -32
- package/dist/server/bare/plugins/llamacpp-embedding/plugin.js +10 -16
- package/dist/server/bare/plugins/nmtcpp-translation/plugin.d.ts +69 -44
- package/dist/server/bare/plugins/nmtcpp-translation/plugin.js +113 -94
- package/dist/server/bare/plugins/onnx-ocr/plugin.d.ts +1 -1
- package/dist/server/bare/plugins/onnx-ocr/plugin.js +1 -2
- package/dist/server/bare/plugins/onnx-tts/ops/text-to-speech-stream.d.ts +7 -0
- package/dist/server/bare/plugins/onnx-tts/ops/text-to-speech-stream.js +116 -0
- package/dist/server/bare/plugins/onnx-tts/ops/text-to-speech.d.ts +2 -3
- package/dist/server/bare/plugins/onnx-tts/ops/text-to-speech.js +71 -9
- package/dist/server/bare/plugins/onnx-tts/plugin.d.ts +41 -13
- package/dist/server/bare/plugins/onnx-tts/plugin.js +48 -3
- package/dist/server/bare/plugins/parakeet-transcription/plugin.d.ts +15 -7
- package/dist/server/bare/plugins/parakeet-transcription/plugin.js +5 -6
- package/dist/server/bare/plugins/sdcpp-generation/ops/diffusion.js +6 -0
- package/dist/server/bare/plugins/sdcpp-generation/plugin.d.ts +8 -5
- package/dist/server/bare/plugins/sdcpp-generation/plugin.js +13 -13
- package/dist/server/bare/plugins/whispercpp-transcription/plugin.d.ts +17 -1
- package/dist/server/bare/plugins/whispercpp-transcription/plugin.js +40 -17
- package/dist/server/bare/registry/config-registry.js +14 -3
- package/dist/server/bare/registry/model-registry.d.ts +8 -10
- package/dist/server/bare/registry/model-registry.js +17 -12
- package/dist/server/bare/registry/registry-client.js +79 -19
- package/dist/server/bare/runtime-lifecycle.d.ts +2 -1
- package/dist/server/bare/runtime-lifecycle.js +13 -2
- package/dist/server/bare/types/addon-responses.d.ts +8 -3
- package/dist/server/bare/utils/transcribe-metadata.d.ts +21 -0
- package/dist/server/bare/utils/transcribe-metadata.js +28 -0
- package/dist/server/bare/utils/tts-stats.d.ts +22 -0
- package/dist/server/bare/utils/tts-stats.js +10 -0
- package/dist/server/rpc/create-server.d.ts +4 -1
- package/dist/server/rpc/create-server.js +5 -1
- package/dist/server/rpc/delegate-transport.js +36 -29
- package/dist/server/rpc/handle-request.js +28 -3
- package/dist/server/rpc/handler-registry.js +7 -1
- package/dist/server/rpc/handler-utils.d.ts +5 -0
- package/dist/server/rpc/handler-utils.js +22 -0
- package/dist/server/rpc/handlers/cancel-delegated.js +3 -5
- package/dist/server/rpc/handlers/cancelHandler.js +4 -5
- package/dist/server/rpc/handlers/completion-stream-delegated.js +14 -5
- package/dist/server/rpc/handlers/delete-cache.js +8 -3
- package/dist/server/rpc/handlers/download-asset.js +3 -24
- package/dist/server/rpc/handlers/get-loaded-model-info.d.ts +3 -0
- package/dist/server/rpc/handlers/get-loaded-model-info.js +39 -0
- package/dist/server/rpc/handlers/get-model-info.js +93 -84
- package/dist/server/rpc/handlers/heartbeat-delegated.js +2 -2
- package/dist/server/rpc/handlers/index.d.ts +6 -0
- package/dist/server/rpc/handlers/index.js +6 -0
- package/dist/server/rpc/handlers/load-model/download-manager.d.ts +35 -9
- package/dist/server/rpc/handlers/load-model/download-manager.js +142 -38
- package/dist/server/rpc/handlers/load-model/download-stats.d.ts +5 -4
- package/dist/server/rpc/handlers/load-model/download-stats.js +49 -8
- package/dist/server/rpc/handlers/load-model/handler.js +31 -50
- package/dist/server/rpc/handlers/load-model/http.d.ts +2 -2
- package/dist/server/rpc/handlers/load-model/http.js +97 -142
- package/dist/server/rpc/handlers/load-model/hyperdrive.d.ts +2 -2
- package/dist/server/rpc/handlers/load-model/hyperdrive.js +55 -74
- package/dist/server/rpc/handlers/load-model/index.d.ts +0 -1
- package/dist/server/rpc/handlers/load-model/index.js +0 -1
- package/dist/server/rpc/handlers/load-model/registry-client-options.d.ts +27 -0
- package/dist/server/rpc/handlers/load-model/registry-client-options.js +19 -0
- package/dist/server/rpc/handlers/load-model/registry-companion-set.d.ts +22 -0
- package/dist/server/rpc/handlers/load-model/registry-companion-set.js +208 -0
- package/dist/server/rpc/handlers/load-model/registry-download-utils.d.ts +24 -0
- package/dist/server/rpc/handlers/load-model/registry-download-utils.js +114 -0
- package/dist/server/rpc/handlers/load-model/registry.d.ts +2 -20
- package/dist/server/rpc/handlers/load-model/registry.js +109 -381
- package/dist/server/rpc/handlers/load-model/resolve-session.d.ts +15 -0
- package/dist/server/rpc/handlers/load-model/resolve-session.js +61 -0
- package/dist/server/rpc/handlers/load-model/resolve.d.ts +3 -3
- package/dist/server/rpc/handlers/load-model/resolve.js +14 -23
- package/dist/server/rpc/handlers/load-model/types.d.ts +11 -4
- package/dist/server/rpc/handlers/load-model/types.js +28 -1
- package/dist/server/rpc/handlers/load-model-delegated.js +2 -4
- package/dist/server/rpc/handlers/plugin-dispatch.js +9 -5
- package/dist/server/rpc/handlers/plugin-invoke.js +1 -1
- package/dist/server/rpc/handlers/provideHandler/connection.js +13 -2
- package/dist/server/rpc/handlers/provideHandler/handler.js +42 -29
- package/dist/server/rpc/handlers/state.d.ts +3 -0
- package/dist/server/rpc/handlers/state.js +7 -0
- package/dist/server/rpc/handlers/stopProvideHandler.d.ts +2 -2
- package/dist/server/rpc/handlers/stopProvideHandler.js +12 -7
- package/dist/server/rpc/handlers/text-to-speech-stream.d.ts +3 -0
- package/dist/server/rpc/handlers/text-to-speech-stream.js +4 -0
- package/dist/server/rpc/handlers/unload-model-delegated.js +3 -3
- package/dist/server/rpc/profiling/operation-metrics.js +20 -0
- package/dist/server/rpc/rpc-utils.js +1 -1
- package/dist/server/rpc/transport-selector.d.ts +3 -0
- package/dist/server/rpc/transport-selector.js +18 -0
- package/dist/server/utils/cache/auto-history.d.ts +4 -0
- package/dist/server/utils/cache/auto-history.js +22 -0
- package/dist/server/utils/{cache.d.ts → cache/paths.d.ts} +22 -5
- package/dist/server/utils/{cache.js → cache/paths.js} +36 -20
- package/dist/server/utils/cache/types.d.ts +8 -0
- package/dist/server/utils/cache/types.js +1 -0
- package/dist/server/utils/checksum.d.ts +2 -2
- package/dist/server/utils/checksum.js +1 -1
- package/dist/server/utils/clear-storage.d.ts +5 -0
- package/dist/server/utils/clear-storage.js +17 -0
- package/dist/server/utils/completion-normalizer.d.ts +17 -0
- package/dist/server/utils/completion-normalizer.js +301 -0
- package/dist/server/utils/expand-gguf-shards.d.ts +3 -0
- package/dist/server/utils/expand-gguf-shards.js +22 -0
- package/dist/server/utils/formatting.js +1 -1
- package/dist/server/utils/index.d.ts +4 -2
- package/dist/server/utils/index.js +4 -2
- package/dist/server/utils/qvac-paths.d.ts +2 -0
- package/dist/server/utils/qvac-paths.js +5 -0
- package/dist/server/utils/response-format.d.ts +3 -0
- package/dist/server/utils/response-format.js +20 -0
- package/dist/server/utils/tool-integration.d.ts +15 -4
- package/dist/server/utils/tool-integration.js +21 -41
- package/dist/server/utils/tools/dialect.d.ts +8 -0
- package/dist/server/utils/tools/dialect.js +12 -0
- package/dist/server/utils/tools/index.d.ts +3 -0
- package/dist/server/utils/tools/index.js +2 -0
- package/dist/server/utils/tools/parser.d.ts +6 -0
- package/dist/server/utils/tools/parser.js +40 -0
- package/dist/server/utils/tools/parsers/hermes.d.ts +4 -0
- package/dist/server/utils/tools/parsers/hermes.js +100 -0
- package/dist/server/utils/tools/parsers/json.d.ts +6 -0
- package/dist/server/utils/tools/parsers/json.js +115 -0
- package/dist/server/utils/tools/parsers/pythonic.d.ts +4 -0
- package/dist/server/utils/tools/parsers/pythonic.js +267 -0
- package/dist/server/utils/tools/shared.d.ts +18 -0
- package/dist/server/utils/tools/shared.js +54 -0
- package/dist/server/utils/worker-lock.d.ts +3 -0
- package/dist/server/utils/worker-lock.js +67 -0
- package/dist/server/worker-core.d.ts +16 -1
- package/dist/server/worker-core.js +114 -14
- package/dist/utils/aggregate-events.d.ts +16 -0
- package/dist/utils/aggregate-events.js +52 -0
- package/dist/utils/cache-normalize.d.ts +10 -0
- package/dist/utils/cache-normalize.js +23 -0
- package/dist/utils/encoding.d.ts +8 -0
- package/dist/utils/encoding.js +13 -0
- package/dist/utils/errors-client.d.ts +12 -0
- package/dist/utils/errors-client.js +20 -0
- package/dist/utils/errors-server.d.ts +14 -0
- package/dist/utils/errors-server.js +31 -0
- package/dist/utils/load-model-validation.d.ts +7 -0
- package/dist/utils/load-model-validation.js +18 -0
- package/expo/plugins/patches/android-link.mjs +1 -1
- package/expo/plugins/patches/ios-link.mjs +1 -1
- package/package.json +15 -19
- package/dist/examples/translation/translation-opus.d.ts +0 -2
- package/dist/examples/translation/translation-opus.js +0 -33
- package/dist/server/bare/utils/loader-adapter.d.ts +0 -7
- package/dist/server/bare/utils/loader-adapter.js +0 -9
- package/dist/server/utils/model-path.d.ts +0 -5
- package/dist/server/utils/model-path.js +0 -7
- package/dist/server/utils/tool-parser.d.ts +0 -7
- package/dist/server/utils/tool-parser.js +0 -248
|
@@ -1,40 +1,95 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export const getModelInfoParamsSchema = z.object({
|
|
3
|
-
name: z
|
|
3
|
+
name: z
|
|
4
|
+
.string()
|
|
5
|
+
.describe("The model's registry name (as found in the SDK's built-in catalog)."),
|
|
4
6
|
});
|
|
5
7
|
export const getModelInfoRequestSchema = getModelInfoParamsSchema.extend({
|
|
6
8
|
type: z.literal("getModelInfo"),
|
|
7
9
|
});
|
|
8
10
|
export const loadedInstanceSchema = z.object({
|
|
9
|
-
registryId: z
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
registryId: z
|
|
12
|
+
.string()
|
|
13
|
+
.describe("Identifier of the registered loaded instance."),
|
|
14
|
+
loadedAt: z
|
|
15
|
+
.coerce.date()
|
|
16
|
+
.describe("Timestamp when the instance was loaded."),
|
|
17
|
+
config: z
|
|
18
|
+
.unknown()
|
|
19
|
+
.optional()
|
|
20
|
+
.describe("Opaque model-specific configuration the instance was loaded with."),
|
|
12
21
|
});
|
|
13
22
|
export const cacheFileInfoSchema = z.object({
|
|
14
|
-
filename: z.string(),
|
|
15
|
-
path: z.string(),
|
|
16
|
-
expectedSize: z
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
filename: z.string().describe("Name of the cached file on disk."),
|
|
24
|
+
path: z.string().describe("Absolute path to the cached file."),
|
|
25
|
+
expectedSize: z
|
|
26
|
+
.number()
|
|
27
|
+
.describe("Expected file size in bytes from the model metadata."),
|
|
28
|
+
sha256Checksum: z
|
|
29
|
+
.string()
|
|
30
|
+
.describe("Expected SHA-256 checksum of the file."),
|
|
31
|
+
isCached: z
|
|
32
|
+
.boolean()
|
|
33
|
+
.describe("Whether the file is currently present in the cache."),
|
|
34
|
+
actualSize: z
|
|
35
|
+
.number()
|
|
36
|
+
.optional()
|
|
37
|
+
.describe("Actual size of the cached file on disk, in bytes."),
|
|
38
|
+
cachedAt: z
|
|
39
|
+
.coerce.date()
|
|
40
|
+
.optional()
|
|
41
|
+
.describe("Timestamp when the file was last cached."),
|
|
21
42
|
});
|
|
22
43
|
export const modelInfoSchema = z.object({
|
|
23
|
-
name: z.string(),
|
|
24
|
-
modelId: z
|
|
44
|
+
name: z.string().describe("Catalog name of the model."),
|
|
45
|
+
modelId: z
|
|
46
|
+
.string()
|
|
47
|
+
.describe("Unique identifier used to reference the model in SDK calls."),
|
|
25
48
|
// Registry-based fields
|
|
26
|
-
registryPath: z
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
49
|
+
registryPath: z
|
|
50
|
+
.string()
|
|
51
|
+
.optional()
|
|
52
|
+
.describe("Registry-relative path (set for registry-backed models)."),
|
|
53
|
+
registrySource: z
|
|
54
|
+
.string()
|
|
55
|
+
.optional()
|
|
56
|
+
.describe("Registry source identifier, e.g. `huggingface`."),
|
|
57
|
+
blobCoreKey: z
|
|
58
|
+
.string()
|
|
59
|
+
.optional()
|
|
60
|
+
.describe("Hyperdrive blob core key for the model file."),
|
|
61
|
+
blobBlockOffset: z
|
|
62
|
+
.number()
|
|
63
|
+
.optional()
|
|
64
|
+
.describe("Starting block offset of the model file in the blob."),
|
|
65
|
+
blobBlockLength: z
|
|
66
|
+
.number()
|
|
67
|
+
.optional()
|
|
68
|
+
.describe("Number of blocks occupied by the model file in the blob."),
|
|
69
|
+
blobByteOffset: z
|
|
70
|
+
.number()
|
|
71
|
+
.optional()
|
|
72
|
+
.describe("Starting byte offset of the model file within its block."),
|
|
73
|
+
engine: z
|
|
74
|
+
.string()
|
|
75
|
+
.optional()
|
|
76
|
+
.describe("Inference engine identifier, e.g. `llamacpp-completion`."),
|
|
77
|
+
quantization: z
|
|
78
|
+
.string()
|
|
79
|
+
.optional()
|
|
80
|
+
.describe("Quantization identifier, e.g. `Q4_K_M`."),
|
|
81
|
+
params: z
|
|
82
|
+
.string()
|
|
83
|
+
.optional()
|
|
84
|
+
.describe("Parameter-count label for the model, e.g. `7B`."),
|
|
85
|
+
expectedSize: z
|
|
86
|
+
.number()
|
|
87
|
+
.describe("Expected total size of the model file in bytes."),
|
|
88
|
+
sha256Checksum: z
|
|
89
|
+
.string()
|
|
90
|
+
.describe("Expected SHA-256 checksum of the model file."),
|
|
91
|
+
addon: z
|
|
92
|
+
.enum([
|
|
38
93
|
"llm",
|
|
39
94
|
"whisper",
|
|
40
95
|
"parakeet",
|
|
@@ -45,13 +100,29 @@ export const modelInfoSchema = z.object({
|
|
|
45
100
|
"ocr",
|
|
46
101
|
"diffusion",
|
|
47
102
|
"other",
|
|
48
|
-
])
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
103
|
+
])
|
|
104
|
+
.describe("Inference addon / capability category this model belongs to."),
|
|
105
|
+
isCached: z
|
|
106
|
+
.boolean()
|
|
107
|
+
.describe("Whether the model file is present in the local cache."),
|
|
108
|
+
isLoaded: z
|
|
109
|
+
.boolean()
|
|
110
|
+
.describe("Whether the model is currently loaded into memory."),
|
|
111
|
+
cacheFiles: z
|
|
112
|
+
.array(cacheFileInfoSchema)
|
|
113
|
+
.describe("Individual cache file entries that make up this model."),
|
|
114
|
+
actualSize: z
|
|
115
|
+
.number()
|
|
116
|
+
.optional()
|
|
117
|
+
.describe("Actual total size of the cached model on disk, in bytes."),
|
|
118
|
+
cachedAt: z
|
|
119
|
+
.coerce.date()
|
|
120
|
+
.optional()
|
|
121
|
+
.describe("Timestamp when the model was last cached."),
|
|
122
|
+
loadedInstances: z
|
|
123
|
+
.array(loadedInstanceSchema)
|
|
124
|
+
.optional()
|
|
125
|
+
.describe("Loaded instances associated with this model (one per live load)."),
|
|
55
126
|
});
|
|
56
127
|
export const getModelInfoResponseSchema = z.object({
|
|
57
128
|
type: z.literal("getModelInfo"),
|
|
@@ -2,7 +2,6 @@ import { z } from "zod";
|
|
|
2
2
|
export declare const heartbeatRequestSchema: z.ZodObject<{
|
|
3
3
|
type: z.ZodLiteral<"heartbeat">;
|
|
4
4
|
delegate: z.ZodOptional<z.ZodObject<{
|
|
5
|
-
topic: z.ZodString;
|
|
6
5
|
providerPublicKey: z.ZodString;
|
|
7
6
|
timeout: z.ZodOptional<z.ZodNumber>;
|
|
8
7
|
healthCheckTimeout: z.ZodOptional<z.ZodNumber>;
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export * from "./archive";
|
|
2
2
|
export * from "./cancel";
|
|
3
3
|
export * from "./completion-stream";
|
|
4
|
-
export * from "./
|
|
4
|
+
export * from "./completion-event";
|
|
5
|
+
export { toolSchema, toolCallSchema, toolCallErrorSchema, TOOLS_MODE, type Tool, type ToolCall, type ToolCallError, type ToolCallWithCall, type ToolsMode, } from "./tools";
|
|
5
6
|
export * from "./delegate";
|
|
6
7
|
export * from "./delete-cache";
|
|
7
8
|
export * from "./download-asset";
|
|
@@ -28,6 +29,7 @@ export * from "./sdcpp-config";
|
|
|
28
29
|
export * from "./shard";
|
|
29
30
|
export * from "./suspend";
|
|
30
31
|
export * from "./resume";
|
|
32
|
+
export * from "./state";
|
|
31
33
|
export { SDK_CLIENT_ERROR_CODES } from "./sdk-errors-client";
|
|
32
34
|
export { SDK_SERVER_ERROR_CODES } from "./sdk-errors-server";
|
|
33
35
|
export { REGISTRY_ERROR_CODES } from "./sdk-errors-registry";
|
|
@@ -35,6 +37,7 @@ export { qvacConfigSchema, deviceMatchSchema, deviceConfigDefaultsSchema, device
|
|
|
35
37
|
export { PROFILING_KEY, PROFILING_TRAILER_KEY, DELEGATION_BREAKDOWN_KEY, OPERATION_EVENT_KEY, MODEL_EXECUTION_KEY, profilerModeSchema, serverBreakdownSchema, delegationBreakdownSchema, operationEventSchema, profilingRequestMetaSchema, profilingResponseMetaSchema, perCallProfilingSchema, type ProfilerMode, type ServerBreakdown, type DelegationBreakdown, type OperationEvent, type ProfilingRequestMeta, type ProfilingResponseMeta, type PerCallProfiling, } from "./profiling";
|
|
36
38
|
export { runtimeContextSchema, type RuntimeContext } from "./runtime-context";
|
|
37
39
|
export * from "./get-model-info";
|
|
40
|
+
export * from "./get-loaded-model-info";
|
|
38
41
|
export * from "./model-src-utils";
|
|
39
42
|
export * from "./json-schema";
|
|
40
43
|
export { type McpClient, type McpClientInput } from "./mcp-adapter";
|
package/dist/schemas/index.js
CHANGED
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
export * from "./archive.js";
|
|
3
3
|
export * from "./cancel.js";
|
|
4
4
|
export * from "./completion-stream.js";
|
|
5
|
-
export * from "./
|
|
5
|
+
export * from "./completion-event.js";
|
|
6
|
+
export { toolSchema, toolCallSchema, toolCallErrorSchema, TOOLS_MODE, } from "./tools.js";
|
|
6
7
|
export * from "./delegate.js";
|
|
7
8
|
export * from "./delete-cache.js";
|
|
8
9
|
export * from "./download-asset.js";
|
|
@@ -29,6 +30,7 @@ export * from "./sdcpp-config.js";
|
|
|
29
30
|
export * from "./shard.js";
|
|
30
31
|
export * from "./suspend.js";
|
|
31
32
|
export * from "./resume.js";
|
|
33
|
+
export * from "./state.js";
|
|
32
34
|
export { SDK_CLIENT_ERROR_CODES } from "./sdk-errors-client.js";
|
|
33
35
|
export { SDK_SERVER_ERROR_CODES } from "./sdk-errors-server.js";
|
|
34
36
|
export { REGISTRY_ERROR_CODES } from "./sdk-errors-registry.js";
|
|
@@ -36,6 +38,7 @@ export { qvacConfigSchema, deviceMatchSchema, deviceConfigDefaultsSchema, device
|
|
|
36
38
|
export { PROFILING_KEY, PROFILING_TRAILER_KEY, DELEGATION_BREAKDOWN_KEY, OPERATION_EVENT_KEY, MODEL_EXECUTION_KEY, profilerModeSchema, serverBreakdownSchema, delegationBreakdownSchema, operationEventSchema, profilingRequestMetaSchema, profilingResponseMetaSchema, perCallProfilingSchema, } from "./profiling.js";
|
|
37
39
|
export { runtimeContextSchema } from "./runtime-context.js";
|
|
38
40
|
export * from "./get-model-info.js";
|
|
41
|
+
export * from "./get-loaded-model-info.js";
|
|
39
42
|
export * from "./model-src-utils.js";
|
|
40
43
|
export * from "./json-schema.js";
|
|
41
44
|
export {} from "./mcp-adapter.js";
|
|
@@ -24,6 +24,10 @@ export declare const llmConfigBaseSchema: z.ZodObject<{
|
|
|
24
24
|
stop_sequences: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
25
25
|
n_discarded: z.ZodOptional<z.ZodNumber>;
|
|
26
26
|
tools: z.ZodOptional<z.ZodBoolean>;
|
|
27
|
+
toolsMode: z.ZodOptional<z.ZodEnum<{
|
|
28
|
+
static: "static";
|
|
29
|
+
dynamic: "dynamic";
|
|
30
|
+
}>>;
|
|
27
31
|
"cache-type-k": z.ZodOptional<z.ZodString>;
|
|
28
32
|
"cache-type-v": z.ZodOptional<z.ZodString>;
|
|
29
33
|
openclCacheDir: z.ZodOptional<z.ZodString>;
|
|
@@ -39,6 +43,7 @@ export declare const llmConfigBaseSchema: z.ZodObject<{
|
|
|
39
43
|
expectedSize: z.ZodOptional<z.ZodNumber>;
|
|
40
44
|
sha256Checksum: z.ZodOptional<z.ZodString>;
|
|
41
45
|
addon: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
46
|
+
embeddings: "embeddings";
|
|
42
47
|
"llamacpp-completion": "llamacpp-completion";
|
|
43
48
|
"whispercpp-transcription": "whispercpp-transcription";
|
|
44
49
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
@@ -49,7 +54,6 @@ export declare const llmConfigBaseSchema: z.ZodObject<{
|
|
|
49
54
|
"sdcpp-generation": "sdcpp-generation";
|
|
50
55
|
llm: "llm";
|
|
51
56
|
whisper: "whisper";
|
|
52
|
-
embeddings: "embeddings";
|
|
53
57
|
nmt: "nmt";
|
|
54
58
|
parakeet: "parakeet";
|
|
55
59
|
tts: "tts";
|
|
@@ -84,6 +88,10 @@ export declare const llmConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
84
88
|
stop_sequences: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
85
89
|
n_discarded: z.ZodOptional<z.ZodNumber>;
|
|
86
90
|
tools: z.ZodOptional<z.ZodBoolean>;
|
|
91
|
+
toolsMode: z.ZodOptional<z.ZodEnum<{
|
|
92
|
+
static: "static";
|
|
93
|
+
dynamic: "dynamic";
|
|
94
|
+
}>>;
|
|
87
95
|
"cache-type-k": z.ZodOptional<z.ZodString>;
|
|
88
96
|
"cache-type-v": z.ZodOptional<z.ZodString>;
|
|
89
97
|
openclCacheDir: z.ZodOptional<z.ZodString>;
|
|
@@ -99,6 +107,7 @@ export declare const llmConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
99
107
|
expectedSize: z.ZodOptional<z.ZodNumber>;
|
|
100
108
|
sha256Checksum: z.ZodOptional<z.ZodString>;
|
|
101
109
|
addon: z.ZodOptional<z.ZodUnion<readonly [z.ZodEnum<{
|
|
110
|
+
embeddings: "embeddings";
|
|
102
111
|
"llamacpp-completion": "llamacpp-completion";
|
|
103
112
|
"whispercpp-transcription": "whispercpp-transcription";
|
|
104
113
|
"llamacpp-embedding": "llamacpp-embedding";
|
|
@@ -109,7 +118,6 @@ export declare const llmConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
109
118
|
"sdcpp-generation": "sdcpp-generation";
|
|
110
119
|
llm: "llm";
|
|
111
120
|
whisper: "whisper";
|
|
112
|
-
embeddings: "embeddings";
|
|
113
121
|
nmt: "nmt";
|
|
114
122
|
parakeet: "parakeet";
|
|
115
123
|
tts: "tts";
|
|
@@ -136,6 +144,7 @@ export declare const llmConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
136
144
|
stop_sequences?: string[] | undefined;
|
|
137
145
|
n_discarded?: number | undefined;
|
|
138
146
|
tools?: boolean | undefined;
|
|
147
|
+
toolsMode?: "static" | "dynamic" | undefined;
|
|
139
148
|
"cache-type-k"?: string | undefined;
|
|
140
149
|
"cache-type-v"?: string | undefined;
|
|
141
150
|
openclCacheDir?: string | undefined;
|
|
@@ -150,7 +159,7 @@ export declare const llmConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
150
159
|
engine?: string | undefined;
|
|
151
160
|
expectedSize?: number | undefined;
|
|
152
161
|
sha256Checksum?: string | undefined;
|
|
153
|
-
addon?: "llamacpp-completion" | "whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "parakeet-transcription" | "onnx-ocr" | "sdcpp-generation" | "llm" | "whisper" | "
|
|
162
|
+
addon?: "embeddings" | "llamacpp-completion" | "whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "parakeet-transcription" | "onnx-ocr" | "sdcpp-generation" | "llm" | "whisper" | "nmt" | "parakeet" | "tts" | "ocr" | "diffusion" | "vad" | undefined;
|
|
154
163
|
} | undefined;
|
|
155
164
|
}, {
|
|
156
165
|
ctx_size?: number | undefined;
|
|
@@ -171,6 +180,7 @@ export declare const llmConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
171
180
|
stop_sequences?: string[] | undefined;
|
|
172
181
|
n_discarded?: number | undefined;
|
|
173
182
|
tools?: boolean | undefined;
|
|
183
|
+
toolsMode?: "static" | "dynamic" | undefined;
|
|
174
184
|
"cache-type-k"?: string | undefined;
|
|
175
185
|
"cache-type-v"?: string | undefined;
|
|
176
186
|
openclCacheDir?: string | undefined;
|
|
@@ -185,7 +195,7 @@ export declare const llmConfigSchema: z.ZodPipe<z.ZodObject<{
|
|
|
185
195
|
engine?: string | undefined;
|
|
186
196
|
expectedSize?: number | undefined;
|
|
187
197
|
sha256Checksum?: string | undefined;
|
|
188
|
-
addon?: "llamacpp-completion" | "whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "parakeet-transcription" | "onnx-ocr" | "sdcpp-generation" | "llm" | "whisper" | "
|
|
198
|
+
addon?: "embeddings" | "llamacpp-completion" | "whispercpp-transcription" | "llamacpp-embedding" | "nmtcpp-translation" | "onnx-tts" | "parakeet-transcription" | "onnx-ocr" | "sdcpp-generation" | "llm" | "whisper" | "nmt" | "parakeet" | "tts" | "ocr" | "diffusion" | "vad" | undefined;
|
|
189
199
|
} | undefined;
|
|
190
200
|
}>>;
|
|
191
201
|
export type LlmConfig = z.infer<typeof llmConfigSchema>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { modelSrcInputSchema } from "./model-src-utils.js";
|
|
3
|
+
import { TOOLS_MODE } from "./tools.js";
|
|
3
4
|
export const VERBOSITY = {
|
|
4
5
|
ERROR: 0,
|
|
5
6
|
WARN: 1,
|
|
@@ -38,6 +39,10 @@ export const llmConfigBaseSchema = z.object({
|
|
|
38
39
|
stop_sequences: z.array(z.string()).optional(),
|
|
39
40
|
n_discarded: z.number().optional(),
|
|
40
41
|
tools: z.boolean().optional(),
|
|
42
|
+
toolsMode: z
|
|
43
|
+
.enum([TOOLS_MODE.static, TOOLS_MODE.dynamic])
|
|
44
|
+
.describe('Controls tool placement in the prompt. "static" (default) prepends the tool set once and reuses it across the session. "dynamic" anchors tools after the last user message and trims them from the kv-cache after the chain resolves so each user prompt can carry its own tools.')
|
|
45
|
+
.optional(),
|
|
41
46
|
"cache-type-k": z.string().optional(),
|
|
42
47
|
"cache-type-v": z.string().optional(),
|
|
43
48
|
/**
|