@qvac/inference 0.20.1 → 0.21.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 +90 -24
- package/README.md +8 -5
- package/dist/api/bci-transcribe.d.ts +4 -1
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.js +1 -0
- package/dist/api/rpc-server.d.ts +19 -0
- package/dist/api/rpc-server.js +44 -0
- package/dist/api/text-to-speech.d.ts +9 -0
- package/dist/api/text-to-speech.js +9 -0
- package/dist/api/transcribe.d.ts +11 -7
- package/dist/api/transcribe.js +47 -15
- package/dist/api/video-request.d.ts +5 -5
- package/dist/dispatch.js +39 -7
- package/dist/errors/index.d.ts +7 -0
- package/dist/errors/index.js +15 -0
- package/dist/handlers/assess-model-fit.d.ts +8 -20
- package/dist/handlers/assess-model-fit.js +195 -77
- package/dist/handlers/completion-orchestrate.js +17 -0
- package/dist/handlers/get-loaded-model-info.js +4 -1
- package/dist/handlers/get-model-info.js +29 -1
- package/dist/handlers/load-model/coreml-sidecars.d.ts +25 -0
- package/dist/handlers/load-model/coreml-sidecars.js +274 -0
- package/dist/handlers/load-model/hyperdrive.js +2 -2
- package/dist/handlers/load-model/registry.js +59 -0
- package/dist/handlers/rpc-server.d.ts +23 -0
- package/dist/handlers/rpc-server.js +141 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/models/registry/models.d.ts +7731 -5672
- package/dist/models/registry/models.js +4652 -2526
- package/dist/models/registry/resource-profiles.js +481 -94
- package/dist/plugins/builtin/audiogen-ggml/plugin.d.ts +8 -6
- package/dist/plugins/builtin/audiogen-ggml/plugin.js +2 -1
- package/dist/plugins/builtin/bci-whispercpp-transcription/plugin.d.ts +73 -1
- package/dist/plugins/builtin/bci-whispercpp-transcription/plugin.js +37 -19
- package/dist/plugins/builtin/ggml-vla/plugin.d.ts +1 -1
- package/dist/plugins/builtin/llamacpp-completion/ops/batch-completion-stream.js +9 -5
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stats.d.ts +1 -1
- package/dist/plugins/builtin/llamacpp-completion/ops/completion-stream.js +16 -7
- package/dist/plugins/builtin/llamacpp-completion/plugin.d.ts +22 -11
- package/dist/plugins/builtin/llamacpp-completion/plugin.js +9 -3
- package/dist/plugins/builtin/llamacpp-embedding/plugin.d.ts +5 -3
- package/dist/plugins/builtin/llamacpp-embedding/plugin.js +2 -1
- package/dist/plugins/builtin/parakeet-transcription/plugin.d.ts +121 -0
- package/dist/plugins/builtin/parakeet-transcription/plugin.js +56 -27
- package/dist/plugins/builtin/sdcpp-generation/plugin.d.ts +8 -2
- package/dist/plugins/builtin/sdcpp-generation/plugin.js +7 -2
- package/dist/plugins/builtin/tts-ggml/ops/parler-options.d.ts +2 -0
- package/dist/plugins/builtin/tts-ggml/ops/parler-options.js +5 -1
- package/dist/plugins/builtin/tts-ggml/ops/text-to-speech.js +27 -10
- package/dist/plugins/builtin/tts-ggml/plugin.d.ts +181 -0
- package/dist/plugins/builtin/tts-ggml/plugin.js +84 -2
- package/dist/plugins/builtin/whispercpp-transcription/plugin.d.ts +136 -0
- package/dist/plugins/builtin/whispercpp-transcription/plugin.js +18 -7
- package/dist/plugins/ops/bci-transcribe.d.ts +6 -2
- package/dist/plugins/ops/bci-transcribe.js +18 -13
- package/dist/plugins/ops/load-model.js +2 -2
- package/dist/plugins/ops/transcribe.d.ts +4 -2
- package/dist/plugins/ops/transcribe.js +39 -2
- package/dist/plugins/ops/translate-stats.d.ts +2 -1
- package/dist/plugins/ops/translate-stats.js +64 -7
- package/dist/plugins/ops/translate.js +20 -4
- package/dist/profiling/operation-metrics.js +56 -0
- package/dist/registry.js +4 -0
- package/dist/resources/model-fit/assess.d.ts +37 -2
- package/dist/resources/model-fit/assess.js +24 -3
- package/dist/resources/model-fit/estimators/llm.js +2 -2
- package/dist/resources/model-fit/estimators/whisper.js +3 -4
- package/dist/resources/model-fit/fit-stub/fetch-fit-stub.d.ts +20 -1
- package/dist/resources/model-fit/fit-stub/fetch-fit-stub.js +126 -47
- package/dist/resources/model-fit/fit-stub/project-fit-from-load.d.ts +27 -0
- package/dist/resources/model-fit/fit-stub/project-fit-from-load.js +31 -0
- package/dist/resources/model-fit/fit-stub/resolve-load-from-stubs.d.ts +38 -0
- package/dist/resources/model-fit/fit-stub/resolve-load-from-stubs.js +138 -0
- package/dist/resources/model-fit/floor.js +2 -2
- package/dist/resources/model-fit/native-probe/advisory-fit.d.ts +9 -6
- package/dist/resources/model-fit/native-probe/advisory-fit.js +129 -80
- package/dist/resources/model-fit/native-probe/child-engine-fit.d.ts +2 -0
- package/dist/resources/model-fit/native-probe/child-engine-fit.js +41 -0
- package/dist/resources/model-fit/native-probe/classify-fit.d.ts +6 -0
- package/dist/resources/model-fit/native-probe/classify-fit.js +135 -0
- package/dist/resources/model-fit/native-probe/create-fit-request.d.ts +28 -0
- package/dist/resources/model-fit/native-probe/create-fit-request.js +51 -0
- package/dist/resources/model-fit/native-probe/engine-fit.d.ts +59 -0
- package/dist/resources/model-fit/native-probe/engine-fit.js +13 -0
- package/dist/resources/model-fit/native-probe/engines/asr.d.ts +10 -0
- package/dist/resources/model-fit/native-probe/engines/asr.js +103 -0
- package/dist/resources/model-fit/native-probe/engines/audiogen.d.ts +8 -0
- package/dist/resources/model-fit/native-probe/engines/audiogen.js +35 -0
- package/dist/resources/model-fit/native-probe/engines/diffusion.d.ts +7 -0
- package/dist/resources/model-fit/native-probe/engines/diffusion.js +55 -0
- package/dist/resources/model-fit/native-probe/engines/gpu.d.ts +10 -0
- package/dist/resources/model-fit/native-probe/engines/gpu.js +21 -0
- package/dist/resources/model-fit/native-probe/engines/llama.d.ts +13 -0
- package/dist/resources/model-fit/native-probe/engines/llama.js +145 -0
- package/dist/resources/model-fit/native-probe/engines/tts.d.ts +8 -0
- package/dist/resources/model-fit/native-probe/engines/tts.js +106 -0
- package/dist/resources/model-fit/native-probe/fit-outcome.d.ts +16 -0
- package/dist/resources/model-fit/native-probe/fit-outcome.js +1 -0
- package/dist/resources/model-fit/native-probe/fit-process.d.ts +27 -0
- package/dist/resources/model-fit/native-probe/fit-process.js +55 -0
- package/dist/resources/model-fit/native-probe/fit-runner.d.ts +1 -0
- package/dist/resources/model-fit/native-probe/fit-runner.js +58 -0
- package/dist/resources/model-fit/native-probe/run-fit.d.ts +24 -0
- package/dist/resources/model-fit/native-probe/run-fit.js +20 -0
- package/dist/resources/model-fit/native-probe/run-in-process-fit.d.ts +14 -34
- package/dist/resources/model-fit/native-probe/run-in-process-fit.js +55 -139
- package/dist/resources/model-fit/native-probe/run-isolated-fit.d.ts +5 -12
- package/dist/resources/model-fit/native-probe/run-isolated-fit.js +13 -8
- package/dist/resources/model-fit/platform.d.ts +9 -0
- package/dist/resources/model-fit/platform.js +28 -0
- package/dist/rpc/device-map.d.ts +13 -0
- package/dist/rpc/device-map.js +22 -0
- package/dist/rpc/discovery.d.ts +12 -0
- package/dist/rpc/discovery.js +225 -0
- package/dist/rpc/ggml-provider.d.ts +4 -0
- package/dist/rpc/ggml-provider.js +25 -0
- package/dist/rpc/index.d.ts +2 -0
- package/dist/rpc/index.js +1 -0
- package/dist/rpc/instance.d.ts +6 -0
- package/dist/rpc/instance.js +21 -0
- package/dist/rpc/inventory.d.ts +5 -0
- package/dist/rpc/inventory.js +144 -0
- package/dist/rpc/manager.d.ts +14 -0
- package/dist/rpc/manager.js +174 -0
- package/dist/rpc/network.d.ts +11 -0
- package/dist/rpc/network.js +85 -0
- package/dist/rpc/provider.d.ts +6 -0
- package/dist/rpc/provider.js +24 -0
- package/dist/runtime/lifecycle.js +31 -13
- package/dist/runtime/request-context.d.ts +1 -1
- package/dist/runtime/state.js +5 -0
- package/dist/schemas/assess-model-fit.d.ts +269 -85
- package/dist/schemas/assess-model-fit.js +78 -54
- package/dist/schemas/audio-gen.d.ts +6 -6
- package/dist/schemas/audio-gen.js +2 -2
- package/dist/schemas/batch-completion-stream.d.ts +13 -5
- package/dist/schemas/batch-completion-stream.js +5 -3
- package/dist/schemas/bci-config.js +1 -1
- package/dist/schemas/bci.d.ts +86 -1
- package/dist/schemas/bci.js +21 -2
- package/dist/schemas/cancel.d.ts +10 -0
- package/dist/schemas/cancel.js +2 -0
- package/dist/schemas/common.d.ts +708 -66
- package/dist/schemas/common.js +7 -0
- package/dist/schemas/completion-event.d.ts +6 -6
- package/dist/schemas/completion-stream.d.ts +27 -8
- package/dist/schemas/completion-stream.js +41 -4
- package/dist/schemas/config.d.ts +104 -36
- package/dist/schemas/config.js +10 -0
- package/dist/schemas/embed.d.ts +2 -2
- package/dist/schemas/error.js +13 -0
- package/dist/schemas/errors.d.ts +1 -0
- package/dist/schemas/errors.js +5 -0
- package/dist/schemas/index.d.ts +1 -0
- package/dist/schemas/index.js +1 -0
- package/dist/schemas/llamacpp-config.d.ts +25 -18
- package/dist/schemas/llamacpp-config.js +26 -16
- package/dist/schemas/load-model.d.ts +2608 -469
- package/dist/schemas/load-model.js +2 -2
- package/dist/schemas/mcp-adapter.d.ts +4 -0
- package/dist/schemas/model-config-schemas.d.ts +183 -6
- package/dist/schemas/model-info.d.ts +56 -0
- package/dist/schemas/model-info.js +5 -1
- package/dist/schemas/plugin.d.ts +8 -2
- package/dist/schemas/profiling.d.ts +4 -4
- package/dist/schemas/reload-config.d.ts +30 -0
- package/dist/schemas/rpc-server.d.ts +101 -0
- package/dist/schemas/rpc-server.js +87 -0
- package/dist/schemas/sdcpp-config.d.ts +7 -3
- package/dist/schemas/sdcpp-config.js +37 -2
- package/dist/schemas/system-resources.d.ts +4 -4
- package/dist/schemas/text-to-speech.d.ts +529 -1
- package/dist/schemas/text-to-speech.js +122 -12
- package/dist/schemas/tools.d.ts +2 -0
- package/dist/schemas/tools.js +8 -0
- package/dist/schemas/transcription-config.d.ts +5 -0
- package/dist/schemas/transcription-config.js +20 -2
- package/dist/schemas/transcription.d.ts +164 -0
- package/dist/schemas/transcription.js +71 -4
- package/dist/schemas/vla.d.ts +1 -1
- package/dist/surface.d.ts +4 -1
- package/dist/surface.js +3 -1
- package/dist/utils/addon-responses.d.ts +5 -1
- package/dist/utils/archive.js +5 -1
- package/dist/utils/asr-diagnostics.d.ts +12 -0
- package/dist/utils/asr-diagnostics.js +42 -0
- package/dist/utils/asr-events.d.ts +1 -0
- package/dist/utils/asr-events.js +3 -2
- package/dist/utils/cache/paths.js +3 -2
- package/dist/utils/mcp-adapter.js +7 -1
- package/dist/utils/multi-gpu-mobile.d.ts +1 -1
- package/dist/utils/multi-gpu-mobile.js +8 -6
- package/dist/utils/path-security.d.ts +5 -0
- package/dist/utils/path-security.js +14 -0
- package/dist/utils/tool-helpers.d.ts +4 -0
- package/dist/utils/tool-helpers.js +2 -0
- package/dist/utils/tools/defer.d.ts +93 -0
- package/dist/utils/tools/defer.js +290 -0
- package/dist/utils/tools/index.d.ts +1 -0
- package/dist/utils/tools/index.js +1 -0
- package/dist/utils/transcribe-metadata.d.ts +21 -7
- package/dist/utils/transcribe-metadata.js +24 -8
- package/dist/utils/tts-stats.d.ts +6 -0
- package/dist/utils/tts-stats.js +14 -1
- package/package.json +43 -29
- package/dist/resources/model-fit/fit-stub/index.d.ts +0 -2
- package/dist/resources/model-fit/fit-stub/index.js +0 -2
- package/dist/resources/model-fit/fit-stub/project-fit-from-stub.d.ts +0 -31
- package/dist/resources/model-fit/fit-stub/project-fit-from-stub.js +0 -36
- package/dist/resources/model-fit/native-probe/create-llama-fit-request.d.ts +0 -26
- package/dist/resources/model-fit/native-probe/create-llama-fit-request.js +0 -191
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const startRpcServerOptionsSchema: z.ZodObject<{
|
|
3
|
+
host: z.ZodOptional<z.ZodString>;
|
|
4
|
+
port: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
device: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
6
|
+
cache: z.ZodOptional<z.ZodBoolean>;
|
|
7
|
+
threads: z.ZodOptional<z.ZodNumber>;
|
|
8
|
+
expectRdma: z.ZodOptional<z.ZodBoolean>;
|
|
9
|
+
allowNonLoopbackHost: z.ZodOptional<z.ZodBoolean>;
|
|
10
|
+
discoveryTopic: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, z.core.$strip>;
|
|
12
|
+
export declare const rpcServerInfoSchema: z.ZodObject<{
|
|
13
|
+
serverId: z.ZodString;
|
|
14
|
+
url: z.ZodString;
|
|
15
|
+
rdmaCapable: z.ZodBoolean;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export declare const startRpcServerRequestSchema: z.ZodObject<{
|
|
18
|
+
host: z.ZodOptional<z.ZodString>;
|
|
19
|
+
port: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
device: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
21
|
+
cache: z.ZodOptional<z.ZodBoolean>;
|
|
22
|
+
threads: z.ZodOptional<z.ZodNumber>;
|
|
23
|
+
expectRdma: z.ZodOptional<z.ZodBoolean>;
|
|
24
|
+
allowNonLoopbackHost: z.ZodOptional<z.ZodBoolean>;
|
|
25
|
+
discoveryTopic: z.ZodOptional<z.ZodString>;
|
|
26
|
+
type: z.ZodLiteral<"startRpcServer">;
|
|
27
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
export declare const startRpcServerResponseSchema: z.ZodObject<{
|
|
30
|
+
serverId: z.ZodString;
|
|
31
|
+
url: z.ZodString;
|
|
32
|
+
rdmaCapable: z.ZodBoolean;
|
|
33
|
+
type: z.ZodLiteral<"startRpcServer">;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
export declare const stopRpcServerOptionsSchema: z.ZodObject<{
|
|
36
|
+
serverId: z.ZodString;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
export declare const stopRpcServerRequestSchema: z.ZodObject<{
|
|
39
|
+
serverId: z.ZodString;
|
|
40
|
+
type: z.ZodLiteral<"stopRpcServer">;
|
|
41
|
+
}, z.core.$strip>;
|
|
42
|
+
export declare const stopRpcServerResponseSchema: z.ZodObject<{
|
|
43
|
+
type: z.ZodLiteral<"stopRpcServer">;
|
|
44
|
+
}, z.core.$strip>;
|
|
45
|
+
export declare const discoverRpcServersOptionsSchema: z.ZodObject<{
|
|
46
|
+
topic: z.ZodString;
|
|
47
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
export declare const rpcDeviceSchema: z.ZodObject<{
|
|
50
|
+
index: z.ZodNumber;
|
|
51
|
+
freeMemory: z.ZodNumber;
|
|
52
|
+
totalMemory: z.ZodNumber;
|
|
53
|
+
}, z.core.$strip>;
|
|
54
|
+
export declare const rpcServerCandidateSchema: z.ZodObject<{
|
|
55
|
+
url: z.ZodString;
|
|
56
|
+
rdmaAvailable: z.ZodBoolean;
|
|
57
|
+
devices: z.ZodArray<z.ZodObject<{
|
|
58
|
+
index: z.ZodNumber;
|
|
59
|
+
freeMemory: z.ZodNumber;
|
|
60
|
+
totalMemory: z.ZodNumber;
|
|
61
|
+
}, z.core.$strip>>;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
export type RpcDevice = z.infer<typeof rpcDeviceSchema>;
|
|
64
|
+
export declare const discoverRpcServersRequestSchema: z.ZodObject<{
|
|
65
|
+
topic: z.ZodString;
|
|
66
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
67
|
+
type: z.ZodLiteral<"discoverRpcServers">;
|
|
68
|
+
requestId: z.ZodOptional<z.ZodString>;
|
|
69
|
+
}, z.core.$strip>;
|
|
70
|
+
export declare const discoverRpcServersResponseSchema: z.ZodObject<{
|
|
71
|
+
type: z.ZodLiteral<"discoverRpcServers">;
|
|
72
|
+
servers: z.ZodArray<z.ZodObject<{
|
|
73
|
+
url: z.ZodString;
|
|
74
|
+
rdmaAvailable: z.ZodBoolean;
|
|
75
|
+
devices: z.ZodArray<z.ZodObject<{
|
|
76
|
+
index: z.ZodNumber;
|
|
77
|
+
freeMemory: z.ZodNumber;
|
|
78
|
+
totalMemory: z.ZodNumber;
|
|
79
|
+
}, z.core.$strip>>;
|
|
80
|
+
}, z.core.$strip>>;
|
|
81
|
+
}, z.core.$strip>;
|
|
82
|
+
export type StartRpcServerOptions = z.infer<typeof startRpcServerOptionsSchema>;
|
|
83
|
+
export type RpcServerInfo = z.infer<typeof rpcServerInfoSchema>;
|
|
84
|
+
export type StopRpcServerOptions = z.infer<typeof stopRpcServerOptionsSchema>;
|
|
85
|
+
export type DiscoverRpcServersOptions = z.infer<typeof discoverRpcServersOptionsSchema>;
|
|
86
|
+
export type RpcServerCandidate = z.infer<typeof rpcServerCandidateSchema>;
|
|
87
|
+
export type StartRpcServerRequest = z.infer<typeof startRpcServerRequestSchema>;
|
|
88
|
+
export type StopRpcServerRequest = z.infer<typeof stopRpcServerRequestSchema>;
|
|
89
|
+
export type DiscoverRpcServersRequest = z.infer<typeof discoverRpcServersRequestSchema>;
|
|
90
|
+
/** Native handles remain private to the engine; callers receive an owned server ID. */
|
|
91
|
+
export interface RpcServerHandle {
|
|
92
|
+
host: string;
|
|
93
|
+
port: number;
|
|
94
|
+
url: string;
|
|
95
|
+
rdmaCapable: boolean;
|
|
96
|
+
stop(): Promise<void>;
|
|
97
|
+
}
|
|
98
|
+
/** A model-independent serving capability registered in the Bare engine. */
|
|
99
|
+
export interface RpcServerProvider {
|
|
100
|
+
start(options: Omit<StartRpcServerOptions, 'discoveryTopic'>): Promise<RpcServerHandle>;
|
|
101
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
const topicSchema = z.string().trim().min(1).max(256);
|
|
3
|
+
const requestIdSchema = z
|
|
4
|
+
.string()
|
|
5
|
+
.min(1)
|
|
6
|
+
.optional()
|
|
7
|
+
.describe('Caller-generated identifier for targeted cancellation with cancel({ requestId }). Generated by the engine when omitted.');
|
|
8
|
+
export const startRpcServerOptionsSchema = z.object({
|
|
9
|
+
host: z.string().min(1).optional().describe('IPv4 bind address. Defaults to 127.0.0.1.'),
|
|
10
|
+
port: z
|
|
11
|
+
.number()
|
|
12
|
+
.int()
|
|
13
|
+
.min(1)
|
|
14
|
+
.max(65535)
|
|
15
|
+
.optional()
|
|
16
|
+
.describe('TCP port. Omit to allocate a free port.'),
|
|
17
|
+
device: z
|
|
18
|
+
.union([z.string().min(1), z.array(z.string().min(1)).min(1)])
|
|
19
|
+
.optional()
|
|
20
|
+
.describe('Native server devices, in caller order.'),
|
|
21
|
+
cache: z.boolean().optional().describe('Enable the native RPC tensor cache.'),
|
|
22
|
+
threads: z.number().int().positive().optional().describe('Native server thread count.'),
|
|
23
|
+
expectRdma: z
|
|
24
|
+
.boolean()
|
|
25
|
+
.optional()
|
|
26
|
+
.describe('Require an RDMA-capable native backend. Reject before startup if unavailable.'),
|
|
27
|
+
allowNonLoopbackHost: z
|
|
28
|
+
.boolean()
|
|
29
|
+
.optional()
|
|
30
|
+
.describe('Explicitly allow a non-loopback bind on a trusted private network. This does not authenticate clients.'),
|
|
31
|
+
discoveryTopic: topicSchema
|
|
32
|
+
.optional()
|
|
33
|
+
.describe('Opt in to advertising a ready private IPv4 endpoint under this shared topic. The topic does not authenticate peers.')
|
|
34
|
+
});
|
|
35
|
+
export const rpcServerInfoSchema = z.object({
|
|
36
|
+
serverId: z.string().min(1),
|
|
37
|
+
url: z.string().min(1),
|
|
38
|
+
rdmaCapable: z
|
|
39
|
+
.boolean()
|
|
40
|
+
.describe('Whether the native backend supports RDMA. It falls back to TCP for clients without RDMA.')
|
|
41
|
+
});
|
|
42
|
+
export const startRpcServerRequestSchema = startRpcServerOptionsSchema.extend({
|
|
43
|
+
type: z.literal('startRpcServer'),
|
|
44
|
+
requestId: requestIdSchema
|
|
45
|
+
});
|
|
46
|
+
export const startRpcServerResponseSchema = rpcServerInfoSchema.extend({
|
|
47
|
+
type: z.literal('startRpcServer')
|
|
48
|
+
});
|
|
49
|
+
export const stopRpcServerOptionsSchema = z.object({ serverId: z.string().min(1) });
|
|
50
|
+
export const stopRpcServerRequestSchema = stopRpcServerOptionsSchema.extend({
|
|
51
|
+
type: z.literal('stopRpcServer')
|
|
52
|
+
});
|
|
53
|
+
export const stopRpcServerResponseSchema = z.object({ type: z.literal('stopRpcServer') });
|
|
54
|
+
export const discoverRpcServersOptionsSchema = z.object({
|
|
55
|
+
topic: topicSchema.describe('Shared discovery topic. Only use with trusted private-network participants.'),
|
|
56
|
+
timeoutMs: z
|
|
57
|
+
.number()
|
|
58
|
+
.int()
|
|
59
|
+
.min(100)
|
|
60
|
+
.max(30000)
|
|
61
|
+
.optional()
|
|
62
|
+
.describe('Search budget in milliseconds, including TCP probes. Defaults to 5000, at most 30000.')
|
|
63
|
+
});
|
|
64
|
+
export const rpcDeviceSchema = z.object({
|
|
65
|
+
index: z.number().int().nonnegative().describe('Zero-based device index within this endpoint.'),
|
|
66
|
+
freeMemory: z
|
|
67
|
+
.number()
|
|
68
|
+
.int()
|
|
69
|
+
.nonnegative()
|
|
70
|
+
.describe('Available device memory in bytes at discovery time.'),
|
|
71
|
+
totalMemory: z.number().int().nonnegative().describe('Total device memory in bytes.')
|
|
72
|
+
});
|
|
73
|
+
export const rpcServerCandidateSchema = z.object({
|
|
74
|
+
url: z.string().min(1),
|
|
75
|
+
rdmaAvailable: z
|
|
76
|
+
.boolean()
|
|
77
|
+
.describe('Server advertised RDMA availability for this endpoint at discovery time. Actual transport depends on client support and negotiation.'),
|
|
78
|
+
devices: z.array(rpcDeviceSchema).describe('Native served devices in endpoint enumeration order.')
|
|
79
|
+
});
|
|
80
|
+
export const discoverRpcServersRequestSchema = discoverRpcServersOptionsSchema.extend({
|
|
81
|
+
type: z.literal('discoverRpcServers'),
|
|
82
|
+
requestId: requestIdSchema
|
|
83
|
+
});
|
|
84
|
+
export const discoverRpcServersResponseSchema = z.object({
|
|
85
|
+
type: z.literal('discoverRpcServers'),
|
|
86
|
+
servers: z.array(rpcServerCandidateSchema)
|
|
87
|
+
});
|
|
@@ -8,8 +8,8 @@ export declare const sdcppConfigSchema: z.ZodObject<{
|
|
|
8
8
|
}>>;
|
|
9
9
|
threads: z.ZodOptional<z.ZodNumber>;
|
|
10
10
|
device: z.ZodOptional<z.ZodEnum<{
|
|
11
|
-
gpu: "gpu";
|
|
12
11
|
cpu: "cpu";
|
|
12
|
+
gpu: "gpu";
|
|
13
13
|
}>>;
|
|
14
14
|
'main-gpu': z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodEnum<{
|
|
15
15
|
integrated: "integrated";
|
|
@@ -543,6 +543,10 @@ export declare const sdcppConfigSchema: z.ZodObject<{
|
|
|
543
543
|
numFramePerBlock: z.ZodOptional<z.ZodNumber>;
|
|
544
544
|
localAttnSize: z.ZodOptional<z.ZodNumber>;
|
|
545
545
|
offloadParamsToCpu: z.ZodOptional<z.ZodBoolean>;
|
|
546
|
+
paramsBackend: z.ZodOptional<z.ZodString>;
|
|
547
|
+
maxVram: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
|
|
548
|
+
streamLayers: z.ZodOptional<z.ZodBoolean>;
|
|
549
|
+
verbosity: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
|
|
546
550
|
frameJpegQuality: z.ZodOptional<z.ZodNumber>;
|
|
547
551
|
kvCache: z.ZodOptional<z.ZodBoolean>;
|
|
548
552
|
profile: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -1458,8 +1462,8 @@ export declare const upscaleStatsSchema: z.ZodObject<{
|
|
|
1458
1462
|
height: z.ZodOptional<z.ZodNumber>;
|
|
1459
1463
|
repeats: z.ZodOptional<z.ZodNumber>;
|
|
1460
1464
|
backendDevice: z.ZodOptional<z.ZodEnum<{
|
|
1461
|
-
gpu: "gpu";
|
|
1462
1465
|
cpu: "cpu";
|
|
1466
|
+
gpu: "gpu";
|
|
1463
1467
|
}>>;
|
|
1464
1468
|
}, z.core.$strip>;
|
|
1465
1469
|
export type UpscaleStats = z.infer<typeof upscaleStatsSchema>;
|
|
@@ -1493,8 +1497,8 @@ export declare const upscaleStreamResponseSchema: z.ZodObject<{
|
|
|
1493
1497
|
height: z.ZodOptional<z.ZodNumber>;
|
|
1494
1498
|
repeats: z.ZodOptional<z.ZodNumber>;
|
|
1495
1499
|
backendDevice: z.ZodOptional<z.ZodEnum<{
|
|
1496
|
-
gpu: "gpu";
|
|
1497
1500
|
cpu: "cpu";
|
|
1501
|
+
gpu: "gpu";
|
|
1498
1502
|
}>>;
|
|
1499
1503
|
}, z.core.$strip>>;
|
|
1500
1504
|
}, z.core.$strip>;
|
|
@@ -85,8 +85,10 @@ export const sdcppConfigSchema = z.object({
|
|
|
85
85
|
'worldCreateScene({ ... }) and worldStep({ ... }). It requires ' +
|
|
86
86
|
'`taehvModelSrc`, plus `t5XxlModelSrc` + `vaeModelSrc` to create scenes ' +
|
|
87
87
|
'and/or `sceneSrc` to walk a pre-built one. World sessions run only on ' +
|
|
88
|
-
'the machine hosting the worker and need a dedicated GPU
|
|
89
|
-
'20 GB free VRAM.'
|
|
88
|
+
'the machine hosting the worker and need a dedicated GPU. At 832x480, ' +
|
|
89
|
+
'the default walk with resident weights needs at least 20 GB free VRAM. ' +
|
|
90
|
+
'`world.paramsBackend`, `world.maxVram`, and `world.streamLayers` can ' +
|
|
91
|
+
'reduce that requirement.'),
|
|
90
92
|
threads: z.number().optional().describe('CPU threads for loading and CPU ops. Default: auto.'),
|
|
91
93
|
device: z
|
|
92
94
|
.enum(['gpu', 'cpu'])
|
|
@@ -309,6 +311,39 @@ export const sdcppConfigSchema = z.object({
|
|
|
309
311
|
.boolean()
|
|
310
312
|
.optional()
|
|
311
313
|
.describe('Keep weights in CPU memory and offload during GPU compute.'),
|
|
314
|
+
paramsBackend: z
|
|
315
|
+
.string()
|
|
316
|
+
.max(4096)
|
|
317
|
+
.optional()
|
|
318
|
+
.describe('Parameter residency for the walk session, independent of graph ' +
|
|
319
|
+
"execution. 'diffusion' is the walk DiT and 'vae' the taehv decoder. " +
|
|
320
|
+
"'diffusion=cpu' stages DiT weights from CPU RAM; 'diffusion=disk' " +
|
|
321
|
+
'reads them from the model file on demand. Disk is never selected ' +
|
|
322
|
+
"automatically, and 'vae=disk' is rejected natively because taehv " +
|
|
323
|
+
'retains its prepared weights across steps. Explicit assignments ' +
|
|
324
|
+
'override offloadParamsToCpu for those modules.'),
|
|
325
|
+
maxVram: z
|
|
326
|
+
// No .max() on the string arm, for the same reason as the flat max_vram
|
|
327
|
+
// above: a constraint makes datamodel-codegen wrap it in a RootModel.
|
|
328
|
+
.union([z.number().finite(), z.string()])
|
|
329
|
+
.optional()
|
|
330
|
+
.describe('VRAM budget in GiB for the walk DiT graph. Positive values set a ' +
|
|
331
|
+
'budget; negative values use free VRAM minus the absolute value as ' +
|
|
332
|
+
'headroom; 0 disables graph cutting. Accepts per-device assignments ' +
|
|
333
|
+
"such as 'cuda0=6,vulkan0=4'. This budgets the DiT graph only — the " +
|
|
334
|
+
'history KV cache and the decoder allocate on top of it. Default: 0.'),
|
|
335
|
+
streamLayers: z
|
|
336
|
+
.boolean()
|
|
337
|
+
.optional()
|
|
338
|
+
.describe('Prefetch and evict DiT layers from CPU RAM. Only takes effect with ' +
|
|
339
|
+
'GPU execution, graph cutting enabled by maxVram, and CPU parameter ' +
|
|
340
|
+
'residency for diffusion. Does not stream from disk; use paramsBackend: ' +
|
|
341
|
+
"'diffusion=disk' for on-demand file reads. Default: false."),
|
|
342
|
+
verbosity: z
|
|
343
|
+
.union([z.literal(0), z.literal(1), z.literal(2), z.literal(3)])
|
|
344
|
+
.optional()
|
|
345
|
+
.describe('Native log level while the session is alive: 0=ERROR, 1=WARN, ' +
|
|
346
|
+
'2=INFO, 3=DEBUG. The level is process-wide and restored on unload.'),
|
|
312
347
|
frameJpegQuality: z
|
|
313
348
|
.number()
|
|
314
349
|
.int()
|
|
@@ -293,8 +293,8 @@ export declare const backendProbeResultSchema: z.ZodObject<{
|
|
|
293
293
|
reason: z.ZodOptional<z.ZodString>;
|
|
294
294
|
}, z.core.$strip>;
|
|
295
295
|
export declare const backendDeviceSchema: z.ZodEnum<{
|
|
296
|
-
gpu: "gpu";
|
|
297
296
|
cpu: "cpu";
|
|
297
|
+
gpu: "gpu";
|
|
298
298
|
}>;
|
|
299
299
|
export declare const backendDriverSchema: z.ZodObject<{
|
|
300
300
|
name: z.ZodString;
|
|
@@ -303,16 +303,16 @@ export declare const backendDriverSchema: z.ZodObject<{
|
|
|
303
303
|
export declare const backendFallbackSchema: z.ZodObject<{
|
|
304
304
|
requestedBackend: z.ZodOptional<z.ZodString>;
|
|
305
305
|
requestedDevice: z.ZodOptional<z.ZodEnum<{
|
|
306
|
-
gpu: "gpu";
|
|
307
306
|
cpu: "cpu";
|
|
307
|
+
gpu: "gpu";
|
|
308
308
|
}>>;
|
|
309
309
|
reason: z.ZodString;
|
|
310
310
|
}, z.core.$strip>;
|
|
311
311
|
export declare const inferenceBackendDiagnosticsSchema: z.ZodObject<{
|
|
312
312
|
selectedBackend: z.ZodString;
|
|
313
313
|
selectedDevice: z.ZodEnum<{
|
|
314
|
-
gpu: "gpu";
|
|
315
314
|
cpu: "cpu";
|
|
315
|
+
gpu: "gpu";
|
|
316
316
|
}>;
|
|
317
317
|
graphicsApi: z.ZodOptional<z.ZodEnum<{
|
|
318
318
|
vulkan: "vulkan";
|
|
@@ -334,8 +334,8 @@ export declare const inferenceBackendDiagnosticsSchema: z.ZodObject<{
|
|
|
334
334
|
fallback: z.ZodOptional<z.ZodObject<{
|
|
335
335
|
requestedBackend: z.ZodOptional<z.ZodString>;
|
|
336
336
|
requestedDevice: z.ZodOptional<z.ZodEnum<{
|
|
337
|
-
gpu: "gpu";
|
|
338
337
|
cpu: "cpu";
|
|
338
|
+
gpu: "gpu";
|
|
339
339
|
}>>;
|
|
340
340
|
reason: z.ZodString;
|
|
341
341
|
}, z.core.$strip>>;
|