@qvac/sdk 0.17.0 → 0.18.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.
Files changed (154) hide show
  1. package/NOTICE +83 -18
  2. package/README.md +19 -0
  3. package/dist/client/api/audio-gen.d.ts +17 -0
  4. package/dist/client/api/audio-gen.js +17 -0
  5. package/dist/client/api/finetune.d.ts +2 -0
  6. package/dist/client/api/finetune.js +7 -1
  7. package/dist/client/api/index.d.ts +1 -1
  8. package/dist/client/api/index.js +1 -1
  9. package/dist/client/api/load-model.d.ts +8 -0
  10. package/dist/client/api/transcribe.d.ts +19 -2
  11. package/dist/client/api/transcribe.js +66 -27
  12. package/dist/client/api/translate.d.ts +3 -2
  13. package/dist/client/api/translate.js +42 -21
  14. package/dist/client/api/vla.d.ts +42 -1
  15. package/dist/client/api/vla.js +50 -1
  16. package/dist/commands/bundle/entry-gen.d.ts +4 -0
  17. package/dist/commands/bundle/entry-gen.js +6 -0
  18. package/dist/commands/bundle/index.js +19 -12
  19. package/dist/examples/asr/parakeet-indic-conformer-filesystem.d.ts +2 -0
  20. package/dist/examples/asr/parakeet-indic-conformer-filesystem.js +52 -0
  21. package/dist/examples/audiogen/generate-cover.d.ts +2 -0
  22. package/dist/examples/audiogen/generate-cover.js +100 -0
  23. package/dist/examples/llamacpp-fallback.d.ts +2 -0
  24. package/dist/examples/llamacpp-fallback.js +34 -0
  25. package/dist/examples/multi-job-completion.d.ts +28 -0
  26. package/dist/examples/multi-job-completion.js +128 -0
  27. package/dist/examples/profiling/basic.js +32 -1
  28. package/dist/examples/system-resources.d.ts +2 -0
  29. package/dist/examples/system-resources.js +86 -0
  30. package/dist/examples/tts/audio8.d.ts +2 -0
  31. package/dist/examples/tts/audio8.js +54 -0
  32. package/dist/examples/tts/cosyvoice3.d.ts +2 -0
  33. package/dist/examples/tts/cosyvoice3.js +52 -0
  34. package/dist/examples/vla-groot.js +92 -49
  35. package/dist/index.d.ts +2 -2
  36. package/dist/index.js +2 -2
  37. package/dist/models/registry/models.d.ts +782 -6
  38. package/dist/models/registry/models.js +2664 -1859
  39. package/dist/schemas/audio-gen.d.ts +103 -0
  40. package/dist/schemas/audio-gen.js +135 -4
  41. package/dist/schemas/common.d.ts +550 -11
  42. package/dist/schemas/constants-registry.d.ts +18 -4
  43. package/dist/schemas/constants-registry.js +16 -3
  44. package/dist/schemas/index.d.ts +1 -1
  45. package/dist/schemas/index.js +1 -1
  46. package/dist/schemas/llamacpp-config.d.ts +10 -10
  47. package/dist/schemas/llamacpp-config.js +12 -5
  48. package/dist/schemas/load-model.d.ts +3678 -323
  49. package/dist/schemas/load-model.js +21 -3
  50. package/dist/schemas/sdk-config.d.ts +60 -24
  51. package/dist/schemas/sdk-errors-server.d.ts +1 -0
  52. package/dist/schemas/sdk-errors-server.js +5 -0
  53. package/dist/schemas/text-to-speech.d.ts +1086 -110
  54. package/dist/schemas/text-to-speech.js +194 -4
  55. package/dist/schemas/tools.d.ts +0 -16
  56. package/dist/schemas/tools.js +0 -15
  57. package/dist/schemas/transcription-config.d.ts +2 -0
  58. package/dist/schemas/transcription-config.js +10 -4
  59. package/dist/schemas/transcription.d.ts +3 -0
  60. package/dist/schemas/vla.d.ts +83 -0
  61. package/dist/schemas/vla.js +105 -2
  62. package/dist/scripts/link-workspace-inference.d.ts +2 -0
  63. package/dist/scripts/link-workspace-inference.js +31 -0
  64. package/dist/server/bare/ops/cancel.d.ts +1 -1
  65. package/dist/server/bare/ops/cancel.js +1 -1
  66. package/dist/server/bare/ops/kv-cache-retention.js +11 -0
  67. package/dist/server/bare/ops/kv-cache-utils.d.ts +1 -1
  68. package/dist/server/bare/ops/kv-cache-utils.js +40 -12
  69. package/dist/server/bare/ops/transcribe.d.ts +2 -2
  70. package/dist/server/bare/ops/transcribe.js +54 -48
  71. package/dist/server/bare/ops/translate-stats.d.ts +5 -0
  72. package/dist/server/bare/ops/translate-stats.js +11 -0
  73. package/dist/server/bare/ops/translate.js +66 -38
  74. package/dist/server/bare/ops/unload-model.js +30 -24
  75. package/dist/server/bare/plugins/audiogen-ggml/ops/audio-gen-input.d.ts +20 -0
  76. package/dist/server/bare/plugins/audiogen-ggml/ops/audio-gen-input.js +153 -0
  77. package/dist/server/bare/plugins/audiogen-ggml/ops/audio-gen-stream.js +52 -1
  78. package/dist/server/bare/plugins/audiogen-ggml/plugin.d.ts +28 -0
  79. package/dist/server/bare/plugins/ggml-ocr/plugin.js +3 -1
  80. package/dist/server/bare/plugins/ggml-vla/ops/vla-set-embodiment.d.ts +3 -0
  81. package/dist/server/bare/plugins/ggml-vla/ops/vla-set-embodiment.js +9 -0
  82. package/dist/server/bare/plugins/ggml-vla/plugin.d.ts +37 -0
  83. package/dist/server/bare/plugins/ggml-vla/plugin.js +21 -4
  84. package/dist/server/bare/plugins/llamacpp-completion/ops/batch-completion-stream.js +16 -15
  85. package/dist/server/bare/plugins/llamacpp-completion/ops/cache-logger.d.ts +1 -1
  86. package/dist/server/bare/plugins/llamacpp-completion/ops/cache-logger.js +2 -2
  87. package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stats.d.ts +6 -0
  88. package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stats.js +10 -0
  89. package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.d.ts +1 -0
  90. package/dist/server/bare/plugins/llamacpp-completion/ops/completion-stream.js +131 -123
  91. package/dist/server/bare/plugins/llamacpp-completion/ops/finetune.js +110 -20
  92. package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-session.d.ts +49 -23
  93. package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-session.js +308 -143
  94. package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-state.d.ts +1 -0
  95. package/dist/server/bare/plugins/llamacpp-completion/ops/kv-cache-state.js +2 -2
  96. package/dist/server/bare/plugins/llamacpp-completion/plugin.d.ts +6 -6
  97. package/dist/server/bare/plugins/llamacpp-completion/plugin.js +55 -36
  98. package/dist/server/bare/plugins/llamacpp-completion/transform.js +1 -7
  99. package/dist/server/bare/plugins/llamacpp-embedding/plugin.js +2 -3
  100. package/dist/server/bare/plugins/nmtcpp-translation/plugin.js +6 -5
  101. package/dist/server/bare/plugins/parakeet-transcription/plugin.js +27 -16
  102. package/dist/server/bare/plugins/tts-ggml/ops/parler-options.js +23 -3
  103. package/dist/server/bare/plugins/tts-ggml/plugin.d.ts +302 -4
  104. package/dist/server/bare/plugins/tts-ggml/plugin.js +131 -0
  105. package/dist/server/bare/plugins/whispercpp-transcription/plugin.js +48 -39
  106. package/dist/server/bare/registry/model-registry.d.ts +1 -0
  107. package/dist/server/bare/runtime/request-registry-singleton.js +29 -15
  108. package/dist/server/bare/runtime/request-registry.d.ts +27 -0
  109. package/dist/server/bare/runtime/request-registry.js +246 -76
  110. package/dist/server/bare/types/addon-responses.d.ts +4 -12
  111. package/dist/server/rpc/handlers/load-model/handler.js +2 -2
  112. package/dist/server/rpc/handlers/load-model/resolve-session.d.ts +1 -1
  113. package/dist/server/rpc/handlers/load-model/resolve-session.js +3 -3
  114. package/dist/server/rpc/handlers/load-model/resolve.d.ts +12 -2
  115. package/dist/server/rpc/handlers/load-model/resolve.js +90 -12
  116. package/dist/server/utils/audio/decoder.d.ts +37 -1
  117. package/dist/server/utils/audio/decoder.js +81 -51
  118. package/dist/server/utils/config-transform.d.ts +3 -0
  119. package/dist/server/utils/config-transform.js +6 -0
  120. package/dist/server/utils/index.d.ts +0 -1
  121. package/dist/server/utils/index.js +0 -1
  122. package/dist/server/utils/shard-utils.d.ts +1 -0
  123. package/dist/server/utils/shard-utils.js +14 -0
  124. package/dist/server/utils/tool-integration.d.ts +3 -10
  125. package/dist/server/utils/tool-integration.js +3 -12
  126. package/dist/utils/errors-server.d.ts +3 -0
  127. package/dist/utils/errors-server.js +5 -0
  128. package/package.json +12 -14
  129. package/dist/examples/llamacpp-dynamic-tools.d.ts +0 -2
  130. package/dist/examples/llamacpp-dynamic-tools.js +0 -152
  131. package/dist/models/update-models/codegen.d.ts +0 -3
  132. package/dist/models/update-models/codegen.js +0 -196
  133. package/dist/models/update-models/companions.d.ts +0 -30
  134. package/dist/models/update-models/companions.js +0 -296
  135. package/dist/models/update-models/history.d.ts +0 -24
  136. package/dist/models/update-models/history.js +0 -107
  137. package/dist/models/update-models/index.d.ts +0 -2
  138. package/dist/models/update-models/index.js +0 -123
  139. package/dist/models/update-models/naming.d.ts +0 -4
  140. package/dist/models/update-models/naming.js +0 -396
  141. package/dist/models/update-models/processing.d.ts +0 -8
  142. package/dist/models/update-models/processing.js +0 -65
  143. package/dist/models/update-models/registry.d.ts +0 -5
  144. package/dist/models/update-models/registry.js +0 -87
  145. package/dist/models/update-models/shards.d.ts +0 -4
  146. package/dist/models/update-models/shards.js +0 -57
  147. package/dist/models/update-models/types.d.ts +0 -88
  148. package/dist/models/update-models/types.js +0 -1
  149. package/dist/models/update-models/utils.d.ts +0 -3
  150. package/dist/models/update-models/utils.js +0 -21
  151. package/dist/server/bare/plugins/llamacpp-completion/ops/batch-cancelled.d.ts +0 -23
  152. package/dist/server/bare/plugins/llamacpp-completion/ops/batch-cancelled.js +0 -30
  153. package/dist/server/utils/expand-gguf-shards.d.ts +0 -3
  154. package/dist/server/utils/expand-gguf-shards.js +0 -22
@@ -0,0 +1,128 @@
1
+ /**
2
+ * Multi-job continuous batching — concurrent completions on one loaded LLM.
3
+ *
4
+ * Unlike `batchCompletion()` (which bundles many prompts into ONE call), this
5
+ * shows independent `completion()` calls fired concurrently against the SAME
6
+ * loaded model. When the model is loaded with `modelConfig.parallel >= 2`, the
7
+ * SDK admits up to `parallel` completions at once and the llama.cpp addon
8
+ * decodes their sequences together — so a burst of prompts finishes in roughly
9
+ * the time of the slowest one, not the sum of all of them.
10
+ *
11
+ * Each `completion()` returns an independent `CompletionRun`:
12
+ * - `events` — an `AsyncIterable` of streamed events for that call.
13
+ * - `final` — a `Promise<CompletionFinal>` with THIS call's own
14
+ * `contentText` and `stats` (its own tokens/sec, TTFT).
15
+ * `stats.avgConcurrentSeq` stays model-level (how busy the
16
+ * shared backend was).
17
+ * - `requestId` — cancel just this call with `cancel({ requestId })`; peers
18
+ * keep decoding.
19
+ *
20
+ * Non-cached completions and batches share the model's `parallel` admission
21
+ * cap: with `parallel` in flight, admitting one more waits FIFO until a slot
22
+ * frees.
23
+ *
24
+ * Run from packages/sdk:
25
+ * bun run examples/multi-job-completion.ts
26
+ */
27
+ import { completion, cancel, loadModel, unloadModel, InferenceCancelledError, LLAMA_3_2_1B_INST_Q4_0 } from '@qvac/sdk';
28
+ const PROMPTS = [
29
+ { id: 'cherry', ask: 'Reply with only the word CHERRY.' },
30
+ { id: 'banana', ask: 'Reply with only the word BANANA.' },
31
+ { id: 'grape', ask: 'Reply with only the word GRAPE.' },
32
+ { id: 'lemon', ask: 'Reply with only the word LEMON.' }
33
+ ];
34
+ try {
35
+ // `parallel: 4` opens the concurrent decode slots continuous batching needs.
36
+ const modelId = await loadModel({
37
+ modelSrc: LLAMA_3_2_1B_INST_Q4_0,
38
+ modelType: 'llm',
39
+ modelConfig: { ctx_size: 4096, parallel: 4 },
40
+ onProgress: (p) => {
41
+ const mb = (n) => (n / 1e6).toFixed(1);
42
+ const line = `▸ Downloading ${p.percentage.toFixed(0)}% (${mb(p.downloaded)}/${mb(p.total)} MB)`;
43
+ process.stderr.write(process.stderr.isTTY ? `\r${line}` : `${line}\n`);
44
+ if (p.percentage >= 100)
45
+ process.stderr.write('\n');
46
+ }
47
+ });
48
+ console.log(`▸ Model loaded: ${modelId}`);
49
+ // ---- Concurrent completions. Fire every call before awaiting any, so all
50
+ // four are admitted and decode together (not one-after-another). ----
51
+ console.log('\n▸ Firing 4 completions concurrently:');
52
+ const started = Date.now();
53
+ const runs = PROMPTS.map(({ ask }) => completion({
54
+ modelId,
55
+ history: [{ role: 'user', content: ask }],
56
+ generationParams: { temp: 0, seed: 42, predict: 16 },
57
+ stream: true
58
+ }));
59
+ const outputs = await Promise.all(runs.map(async (run, i) => {
60
+ const final = await run.final;
61
+ return {
62
+ id: PROMPTS[i].id,
63
+ text: final.contentText.replace(/\s+/g, ' ').trim(),
64
+ stats: final.stats
65
+ };
66
+ }));
67
+ const elapsed = Date.now() - started;
68
+ for (const { id, text, stats } of outputs) {
69
+ const tps = stats?.tokensPerSecond?.toFixed(1) ?? 'n/a';
70
+ console.log(` ▸ ${id}: "${text}" (own ${tps} tok/s)`);
71
+ }
72
+ // Report the engine's own measure of overlap rather than inferring it from
73
+ // wall-clock: avgConcurrentSeq > 1 means the addon decoded sequences together.
74
+ const peakConcurrent = Math.max(...outputs.map((o) => o.stats?.avgConcurrentSeq ?? 0));
75
+ console.log(`\n▸ All 4 finished in ${elapsed} ms; engine avg concurrent sequences: ${peakConcurrent.toFixed(1)} (> 1 = decoded together).`);
76
+ // ---- Per-request cancel isolation. Fire two long runs; cancel only the
77
+ // first by its requestId. The second must keep decoding past the cancel. ----
78
+ console.log('\n▸ Per-request cancel: cancelling one of two in-flight completions:');
79
+ const doomed = completion({
80
+ modelId,
81
+ history: [{ role: 'user', content: 'Write a long story about an otter.' }],
82
+ generationParams: { temp: 0, seed: 1, predict: 256 },
83
+ stream: true
84
+ });
85
+ const survivor = completion({
86
+ modelId,
87
+ history: [{ role: 'user', content: 'Write a long story about a melon.' }],
88
+ generationParams: { temp: 0, seed: 42, predict: 256 },
89
+ stream: true
90
+ });
91
+ // Consume the survivor's stream directly so we can count tokens produced AFTER
92
+ // the cancel is acknowledged — a short survivor could otherwise finish before
93
+ // the cancel lands and pass even under a model-wide cancel.
94
+ const survivorTokens = survivor.events[Symbol.asyncIterator]();
95
+ // Wait until BOTH runs are actually streaming before cancelling, so the cancel
96
+ // hits a genuinely in-flight peer, not a pre-admission drop.
97
+ await Promise.all([doomed.events[Symbol.asyncIterator]().next(), survivorTokens.next()]);
98
+ await cancel({ requestId: doomed.requestId });
99
+ let doomedCancelled = false;
100
+ try {
101
+ await doomed.final;
102
+ }
103
+ catch (err) {
104
+ doomedCancelled = err instanceof InferenceCancelledError;
105
+ }
106
+ // Drain what the survivor emits from here on: a per-request cancel leaves it
107
+ // decoding to completion, a model-wide cancel would have stopped it.
108
+ let tokensAfterCancel = 0;
109
+ for (let next = await survivorTokens.next(); !next.done; next = await survivorTokens.next()) {
110
+ tokensAfterCancel++;
111
+ }
112
+ const survivorText = (await survivor.final).contentText.replace(/\s+/g, ' ').trim();
113
+ console.log(` ▸ cancelled run -> ${doomedCancelled ? 'cancelled' : 'NOT cancelled'}`);
114
+ console.log(` ▸ peer kept decoding -> +${tokensAfterCancel} tokens after the cancel ack`);
115
+ await unloadModel({ modelId, clearStorage: false });
116
+ // A zero exit must prove concurrent scheduling, typed cancellation, and survivor
117
+ // isolation: the first burst reported multiple resident sequences, the doomed
118
+ // run cancelled, and its peer produced tokens AFTER the cancel landed.
119
+ if (peakConcurrent <= 1 || !doomedCancelled || tokensAfterCancel === 0) {
120
+ console.error(`✖ multi-job behavior not demonstrated (peakConcurrent=${peakConcurrent.toFixed(2)}, doomedCancelled=${doomedCancelled}, tokensAfterCancel=${tokensAfterCancel}, survivorText="${survivorText}")`);
121
+ process.exit(1);
122
+ }
123
+ process.exit(0);
124
+ }
125
+ catch (error) {
126
+ console.error('✖', error);
127
+ process.exit(1);
128
+ }
@@ -3,7 +3,8 @@ try {
3
3
  // Enable profiling globally
4
4
  profiler.enable({
5
5
  mode: 'verbose',
6
- includeServerBreakdown: true
6
+ includeServerBreakdown: true,
7
+ includeResourceGauges: true
7
8
  });
8
9
  console.log('▸ Profiler enabled:', profiler.isEnabled());
9
10
  const modelId = await loadModel({
@@ -62,6 +63,36 @@ try {
62
63
  const ops = [...new Set(json.recentEvents?.map((e) => `${e.op}:${e.kind}`) ?? [])];
63
64
  console.log(' Available ops:', ops.join(', '));
64
65
  }
66
+ const resourceEvent = json.recentEvents?.filter((event) => event.resources).at(-1);
67
+ console.log('\n▸ Resource Gauges');
68
+ if (resourceEvent?.resources) {
69
+ const resources = resourceEvent.resources;
70
+ console.log(' op:', resourceEvent.op);
71
+ console.log(' origin:', resources.origin);
72
+ console.log(' cpu:', resources.cpu.status === 'supported'
73
+ ? `${(resources.cpu.value * 100).toFixed(1)}%`
74
+ : resources.cpu.status);
75
+ console.log(' memoryUsed:', resources.memory.usedBytes.status === 'supported'
76
+ ? `${(resources.memory.usedBytes.value / 1024 ** 3).toFixed(2)} GiB`
77
+ : resources.memory.usedBytes.status);
78
+ console.log(' gpuCount:', resources.gpus.status === 'supported' ? resources.gpus.value.length : resources.gpus.status);
79
+ }
80
+ else {
81
+ console.log(' (no resource gauges reported)');
82
+ }
83
+ const backendEvent = json.recentEvents?.filter((event) => event.backend).at(-1);
84
+ console.log('\n▸ Backend Diagnostics');
85
+ if (backendEvent?.backend) {
86
+ const backend = backendEvent.backend;
87
+ console.log(' op:', backendEvent.op);
88
+ console.log(' selectedBackend:', backend.selectedBackend);
89
+ console.log(' selectedDevice:', backend.selectedDevice);
90
+ console.log(' graphicsApi:', backend.graphicsApi ?? '(not reported)');
91
+ console.log(' fallback:', backend.fallback?.reason ?? '(none)');
92
+ }
93
+ else {
94
+ console.log(' (no backend diagnostics reported for this operation)');
95
+ }
65
96
  console.log('\n▸ Profiler JSON (structure)');
66
97
  console.log(' aggregates:', Object.keys(json.aggregates).length, 'metrics');
67
98
  console.log(' recentEvents:', json.recentEvents?.length ?? 0, 'events');
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=system-resources.d.ts.map
@@ -0,0 +1,86 @@
1
+ import { getSystemResources } from '@qvac/sdk';
2
+ function formatBytes(bytes) {
3
+ return `${(bytes / 1024 ** 3).toFixed(2)} GiB`;
4
+ }
5
+ function formatUtilization(value) {
6
+ return `${(value * 100).toFixed(1)}%`;
7
+ }
8
+ function printMetric(label, metric, format, indent = ' ') {
9
+ if (metric.status === 'supported') {
10
+ const scope = metric.provenance.scope ? `/${metric.provenance.scope}` : '';
11
+ console.log(`${indent}${label}: ${format(metric.value)} (${metric.provenance.source}${scope})`);
12
+ return;
13
+ }
14
+ const reason = metric.reason ? ` — ${metric.reason}` : '';
15
+ console.log(`${indent}${label}: ${metric.status}${reason}`);
16
+ }
17
+ try {
18
+ // sample: true performs fresh usage queries, so request it only when current usage is needed.
19
+ const resources = await getSystemResources({ sample: true });
20
+ const { capabilities, sample } = resources;
21
+ console.log('▸ CPU');
22
+ if (capabilities.cpu.status === 'supported') {
23
+ const cpu = capabilities.cpu.value;
24
+ printMetric('Name', cpu.name, String);
25
+ printMetric('Physical cores', cpu.physicalCores, String);
26
+ printMetric('Logical cores', cpu.logicalCores, String);
27
+ }
28
+ else {
29
+ printMetric('Capabilities', capabilities.cpu, String);
30
+ }
31
+ console.log('\n▸ Memory');
32
+ printMetric('Total', capabilities.memory.totalBytes, formatBytes);
33
+ if (sample) {
34
+ printMetric('Used', sample.memory.usedBytes, formatBytes);
35
+ printMetric('Total (sampled)', sample.memory.totalBytes, formatBytes);
36
+ }
37
+ console.log('\n▸ GPUs');
38
+ const gpuLabels = new Map();
39
+ if (capabilities.gpus.status === 'supported') {
40
+ if (capabilities.gpus.value.length === 0) {
41
+ console.log(' No GPUs enumerated.');
42
+ }
43
+ for (const [index, gpu] of capabilities.gpus.value.entries()) {
44
+ const label = gpu.name.status === 'supported'
45
+ ? `${gpu.name.value} (GPU ${index + 1})`
46
+ : `GPU ${index + 1}`;
47
+ gpuLabels.set(gpu.id, label);
48
+ console.log(` ${label}`);
49
+ console.log(` ID: ${gpu.id}`);
50
+ printMetric('Vendor', gpu.vendor, String, ' ');
51
+ printMetric('Total memory', gpu.memoryTotalBytes, formatBytes, ' ');
52
+ const drivers = Object.entries(gpu.drivers)
53
+ .filter(([, metric]) => metric.status === 'supported' && metric.value)
54
+ .map(([driver]) => driver);
55
+ console.log(` Graphics APIs: ${drivers.join(', ') || 'none reported'}`);
56
+ }
57
+ }
58
+ else {
59
+ printMetric('Capabilities', capabilities.gpus, String);
60
+ }
61
+ if (sample) {
62
+ console.log('\n▸ Live utilization');
63
+ printMetric('CPU', sample.cpu, formatUtilization);
64
+ if (sample.gpus.status === 'supported') {
65
+ if (sample.gpus.value.length === 0) {
66
+ console.log(' No GPU samples reported.');
67
+ }
68
+ for (const [index, gpu] of sample.gpus.value.entries()) {
69
+ const label = gpuLabels.get(gpu.id) ?? `GPU ${index + 1}`;
70
+ console.log(` ${label}`);
71
+ console.log(` ID: ${gpu.id}`);
72
+ printMetric('Compute', gpu.compute, formatUtilization, ' ');
73
+ printMetric('Memory used', gpu.memoryUsedBytes, formatBytes, ' ');
74
+ }
75
+ }
76
+ else {
77
+ printMetric('GPU samples', sample.gpus, String);
78
+ }
79
+ }
80
+ console.log('\n▸ Resource diagnostics do not reserve memory or guarantee model fit.');
81
+ process.exit(0);
82
+ }
83
+ catch (error) {
84
+ console.error('✖', error);
85
+ process.exit(1);
86
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=audio8.d.ts.map
@@ -0,0 +1,54 @@
1
+ import { loadModel, textToSpeech, unloadModel, TTS_LM_MULTILINGUAL_AUDIO8_Q8_0, TTS_CODEC_DECODER_AUDIO8_Q8_0 } from '@qvac/sdk';
2
+ import { createWav, playAudio, int16ArrayToBuffer, createWavHeader } from './utils.js';
3
+ // Audio8 (GGML): DualAR LM + codec decoder, native 44.1 kHz output. The
4
+ // primary modelSrc is the LM GGUF; the codec decoder loads via modelConfig.
5
+ // For zero-shot voice cloning also pass audio8CodecEncoderModelSrc plus
6
+ // referenceAudioSrc/referenceText (a recording and its exact transcript).
7
+ const AUDIO8_SAMPLE_RATE = 44100;
8
+ try {
9
+ const modelId = await loadModel({
10
+ modelSrc: TTS_LM_MULTILINGUAL_AUDIO8_Q8_0,
11
+ modelConfig: {
12
+ ttsEngine: 'audio8',
13
+ audio8CodecDecoderModelSrc: TTS_CODEC_DECODER_AUDIO8_Q8_0,
14
+ temperature: 0.7,
15
+ topP: 0.9,
16
+ seed: 42
17
+ },
18
+ onProgress: (p) => {
19
+ const mb = (n) => (n / 1e6).toFixed(1);
20
+ const line = `▸ Downloading ${p.percentage.toFixed(0)}% (${mb(p.downloaded)}/${mb(p.total)} MB)`;
21
+ process.stderr.write(process.stderr.isTTY ? `\r${line}` : `${line}\n`);
22
+ if (p.percentage >= 100)
23
+ process.stderr.write('\n');
24
+ }
25
+ });
26
+ console.log(`▸ Model loaded: ${modelId}`);
27
+ console.log('▸ Testing Audio8 Text-to-Speech...');
28
+ const result = textToSpeech({
29
+ modelId,
30
+ text: 'Hey, how are you doing today?',
31
+ inputType: 'text',
32
+ stream: false
33
+ });
34
+ const audioBuffer = await result.buffer;
35
+ console.log(`▸ TTS complete. Total samples: ${audioBuffer.length}`);
36
+ console.log('▸ Saving audio to file...');
37
+ createWav(audioBuffer, AUDIO8_SAMPLE_RATE, 'audio8-output.wav');
38
+ console.log('▸ Audio saved to audio8-output.wav');
39
+ console.log('▸ Playing audio...');
40
+ const audioData = int16ArrayToBuffer(audioBuffer);
41
+ const wavBuffer = Buffer.concat([
42
+ createWavHeader(audioData.length, AUDIO8_SAMPLE_RATE),
43
+ audioData
44
+ ]);
45
+ playAudio(wavBuffer);
46
+ console.log('▸ Audio playback complete');
47
+ await unloadModel({ modelId });
48
+ console.log('▸ Model unloaded');
49
+ process.exit(0);
50
+ }
51
+ catch (error) {
52
+ console.error('✖', error);
53
+ process.exit(1);
54
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=cosyvoice3.d.ts.map
@@ -0,0 +1,52 @@
1
+ import { loadModel, textToSpeech, unloadModel, TTS_COSYVOICE3_LLM_COSYVOICE_Q8_0 } from '@qvac/sdk';
2
+ import { createWav, playAudio, int16ArrayToBuffer, createWavHeader } from './utils.js';
3
+ // CosyVoice3 (GGML): zero-shot speech with one conditioning control per
4
+ // synthesis (emotion, pace, or instruct). The LLM GGUF's registry companion
5
+ // set downloads the flow/HiFT models, baked voice and tokenizer alongside it.
6
+ // Native output is 24 kHz.
7
+ const COSYVOICE3_SAMPLE_RATE = 24000;
8
+ try {
9
+ const modelId = await loadModel({
10
+ modelSrc: TTS_COSYVOICE3_LLM_COSYVOICE_Q8_0,
11
+ modelConfig: {
12
+ ttsEngine: 'cosyvoice3',
13
+ seed: 42
14
+ },
15
+ onProgress: (p) => {
16
+ const mb = (n) => (n / 1e6).toFixed(1);
17
+ const line = `▸ Downloading ${p.percentage.toFixed(0)}% (${mb(p.downloaded)}/${mb(p.total)} MB)`;
18
+ process.stderr.write(process.stderr.isTTY ? `\r${line}` : `${line}\n`);
19
+ if (p.percentage >= 100)
20
+ process.stderr.write('\n');
21
+ }
22
+ });
23
+ console.log(`▸ Model loaded: ${modelId}`);
24
+ console.log('▸ Testing CosyVoice3 Text-to-Speech...');
25
+ const result = textToSpeech({
26
+ modelId,
27
+ text: 'Hey, how are you doing today?',
28
+ inputType: 'text',
29
+ stream: false,
30
+ emotion: 'happy'
31
+ });
32
+ const audioBuffer = await result.buffer;
33
+ console.log(`▸ TTS complete. Total samples: ${audioBuffer.length}`);
34
+ console.log('▸ Saving audio to file...');
35
+ createWav(audioBuffer, COSYVOICE3_SAMPLE_RATE, 'cosyvoice3-output.wav');
36
+ console.log('▸ Audio saved to cosyvoice3-output.wav');
37
+ console.log('▸ Playing audio...');
38
+ const audioData = int16ArrayToBuffer(audioBuffer);
39
+ const wavBuffer = Buffer.concat([
40
+ createWavHeader(audioData.length, COSYVOICE3_SAMPLE_RATE),
41
+ audioData
42
+ ]);
43
+ playAudio(wavBuffer);
44
+ console.log('▸ Audio playback complete');
45
+ await unloadModel({ modelId });
46
+ console.log('▸ Model unloaded');
47
+ process.exit(0);
48
+ }
49
+ catch (error) {
50
+ console.error('✖', error);
51
+ process.exit(1);
52
+ }
@@ -27,25 +27,48 @@
27
27
  * By default the example pulls the registry-baked GR00T-LIBERO GGUF (~3.76 GB)
28
28
  * on first run and caches it locally. Pass an absolute path on the command line
29
29
  * to override and load a local GGUF instead.
30
+ *
31
+ * Multi-embodiment GGUFs (vla-ggml >= 0.17.0): one GGUF can carry many
32
+ * embodiments, one active at a time. Optional env vars demonstrate selection:
33
+ * QVAC_GROOT_EMBODIMENT initial selection at load — a tag
34
+ * (e.g. 'libero_sim') or a numeric cat_id
35
+ * QVAC_GROOT_SWITCH_EMBODIMENT after load, switch via vlaSetEmbodiment()
36
+ * and run inference on the new embodiment
37
+ * Both are no-ops you can omit; the GGUF's default embodiment is used. On a
38
+ * single-embodiment GGUF a switch is rejected by the addon.
30
39
  */
31
- import { close, loadModel, GROOT_Q8_VF16, unloadModel, vla, vlaHparams, vlaPadState } from '@qvac/sdk';
40
+ import { close, loadModel, GROOT_Q8_VF16, unloadModel, vla, vlaHparams, vlaSetEmbodiment, vlaPadState } from '@qvac/sdk';
32
41
  // LIBERO GR00T prompt layout (Qwen3-VL tokenizer). GR00T reports
33
42
  // `hparams.tokenizerMaxLength === 0` — it does not surface a tokenizer length,
34
43
  // so the prompt length is fixed by the model: 2 cameras × 64 merged image
35
- // tokens (256 patches, 2×2 merge) = 128 image tokens, plus text, = 148 total.
44
+ // tokens (256 patches, 2×2 merge) = 128 image tokens, plus text ≈ 150 total.
36
45
  // A real consumer gets these from the tokenizer; the smoke hard-codes them.
46
+ // The prompt length follows the ACTIVE embodiment's camera count (a 4-camera
47
+ // DROID row needs 4 image-token runs, which a fixed 2-camera length cannot
48
+ // hold), so it is computed per inference, not a constant.
37
49
  const IMAGE_TOKEN_ID = 151655;
38
50
  const MERGED_TOKENS_PER_IMAGE = 64;
39
- const PROMPT_LENGTH = 148;
51
+ const PROMPT_TEXT_TAIL = 20;
40
52
  const TEXT_TOKEN_ID = 1000;
41
53
  const modelSrcOverride = process.argv[2];
42
54
  const modelSrc = modelSrcOverride ?? GROOT_Q8_VF16;
55
+ // A tag string or a numeric cat_id, straight from the env. '24' is a cat_id,
56
+ // 'libero_sim' a tag.
57
+ function embodimentFromEnv(name) {
58
+ const env = process.env;
59
+ const raw = env[name];
60
+ if (raw === undefined || raw === '')
61
+ return undefined;
62
+ return /^\d+$/.test(raw) ? Number(raw) : raw;
63
+ }
64
+ const embodiment = embodimentFromEnv('QVAC_GROOT_EMBODIMENT');
65
+ const switchEmbodiment = embodimentFromEnv('QVAC_GROOT_SWITCH_EMBODIMENT');
43
66
  try {
44
67
  console.log('▸ Loading GR00T (N1.7-3B LIBERO) model...');
45
68
  const modelId = await loadModel({
46
69
  modelSrc,
47
70
  modelType: 'ggml-vla',
48
- modelConfig: { backend: 'cpu' },
71
+ modelConfig: { backend: 'cpu', ...(embodiment !== undefined && { embodiment }) },
49
72
  onProgress: (p) => {
50
73
  const mb = (n) => (n / 1e6).toFixed(1);
51
74
  const line = `▸ Downloading ${p.percentage.toFixed(0)}% (${mb(p.downloaded)}/${mb(p.total)} MB)`;
@@ -60,54 +83,74 @@ try {
60
83
  const { hparams, backendName } = await vlaHparams({ modelId });
61
84
  console.log(`▸ Backend: ${backendName ?? '(unknown)'}`);
62
85
  console.log('▸ Hparams:', hparams);
63
- const patchElems = hparams.imagePatchElems;
64
- if (hparams.imageInputMode !== 'patches' || patchElems == null) {
65
- throw new Error(`expected a patch-input model (imageInputMode 'patches' + imagePatchElems); ` +
66
- `got imageInputMode=${hparams.imageInputMode}`);
86
+ if (hparams.selectedEmbodimentTag !== undefined) {
87
+ console.log(`▸ Embodiment: ${hparams.selectedEmbodimentTag} ` +
88
+ `(cat_id ${hparams.selectedEmbodimentCatId}, ${hparams.numCameras} cameras)`);
67
89
  }
68
- const numCameras = hparams.numCameras ?? 2;
69
- // Patch-input model: each camera is a pre-patchified buffer of exactly
70
- // `imagePatchElems` floats. A real consumer patchifies each camera frame the
71
- // way `Gr00tPolicy` does (the model's learned patch-embed runs inside the
72
- // addon); we use small synthetic values.
73
- const images = Array.from({ length: numCameras }, () => new Float32Array(patchElems).fill(0.02));
74
- // Continuous-state model: pad the robot state to `maxStateDim`.
75
- const state = vlaPadState([0, 0, 0, 0, 0, 0], hparams.maxStateDim);
76
- // GR00T requires the noise prior (flow-matching; it is not sampled in-model).
77
- const noise = new Float32Array(hparams.chunkSize * hparams.maxActionDim);
78
- // Prompt: one run of `MERGED_TOKENS_PER_IMAGE` image tokens per camera, each
79
- // followed by a text separator, padded out to the fixed `PROMPT_LENGTH`.
80
- const tokens = new Int32Array(PROMPT_LENGTH);
81
- let w = 0;
82
- for (let cam = 0; cam < numCameras; cam++) {
83
- for (let k = 0; k < MERGED_TOKENS_PER_IMAGE && w < tokens.length; k++) {
84
- tokens[w++] = IMAGE_TOKEN_ID;
90
+ // Inputs are sized off the hparams, which follow the ACTIVE embodiment
91
+ // (numCameras, actionDim, ...) — rebuild them after every embodiment switch.
92
+ async function runInference(hp) {
93
+ const patchElems = hp.imagePatchElems;
94
+ if (hp.imageInputMode !== 'patches' || patchElems == null) {
95
+ throw new Error(`expected a patch-input model (imageInputMode 'patches' + imagePatchElems); ` +
96
+ `got imageInputMode=${hp.imageInputMode}`);
97
+ }
98
+ const numCameras = hp.numCameras ?? 2;
99
+ // Patch-input model: each camera is a pre-patchified buffer of exactly
100
+ // `imagePatchElems` floats. A real consumer patchifies each camera frame the
101
+ // way `Gr00tPolicy` does (the model's learned patch-embed runs inside the
102
+ // addon); we use small synthetic values.
103
+ const images = Array.from({ length: numCameras }, () => new Float32Array(patchElems).fill(0.02));
104
+ // Continuous-state model: pad the robot state to `maxStateDim`.
105
+ const state = vlaPadState([0, 0, 0, 0, 0, 0], hp.maxStateDim);
106
+ // GR00T requires the noise prior (flow-matching; it is not sampled in-model).
107
+ const noise = new Float32Array(hp.chunkSize * hp.maxActionDim);
108
+ // Prompt: one run of `MERGED_TOKENS_PER_IMAGE` image tokens per camera,
109
+ // each followed by a text separator, plus a short text tail. Sized off the
110
+ // active embodiment's camera count — a fixed 2-camera length would
111
+ // silently truncate the image-token runs of cameras 3+ after a switch to
112
+ // e.g. the 4-camera DROID row.
113
+ const promptLength = numCameras * (MERGED_TOKENS_PER_IMAGE + 1) + PROMPT_TEXT_TAIL;
114
+ const tokens = new Int32Array(promptLength);
115
+ let w = 0;
116
+ for (let cam = 0; cam < numCameras; cam++) {
117
+ for (let k = 0; k < MERGED_TOKENS_PER_IMAGE && w < tokens.length; k++) {
118
+ tokens[w++] = IMAGE_TOKEN_ID;
119
+ }
120
+ if (w < tokens.length)
121
+ tokens[w++] = TEXT_TOKEN_ID + cam;
122
+ }
123
+ for (; w < tokens.length; w++)
124
+ tokens[w] = TEXT_TOKEN_ID + w;
125
+ const mask = new Uint8Array(promptLength).fill(1);
126
+ console.log('▸ Running VLA inference...');
127
+ const { actions, actionDim, chunkSize, stats } = await vla({
128
+ modelId,
129
+ images,
130
+ // Patch inputs ignore imgWidth/imgHeight, but the request schema requires
131
+ // positive integers; pass the model's vision image size.
132
+ imgWidth: hp.visionImageSize,
133
+ imgHeight: hp.visionImageSize,
134
+ state,
135
+ tokens,
136
+ mask,
137
+ noise
138
+ });
139
+ console.log(`▸ Got ${chunkSize} action steps of dim ${actionDim}.`);
140
+ console.log(Array.from(actions.subarray(0, actionDim)));
141
+ if (stats) {
142
+ console.log(`▸ Timing: vision=${stats.vision_ms?.toFixed(0)}ms ` +
143
+ `ode=${stats.ode_ms?.toFixed(0)}ms ` +
144
+ `total=${stats.total_ms?.toFixed(0)}ms`);
85
145
  }
86
- if (w < tokens.length)
87
- tokens[w++] = TEXT_TOKEN_ID + cam;
88
146
  }
89
- for (; w < tokens.length; w++)
90
- tokens[w] = TEXT_TOKEN_ID + w;
91
- const mask = new Uint8Array(PROMPT_LENGTH).fill(1);
92
- console.log('▸ Running VLA inference...');
93
- const { actions, actionDim, chunkSize, stats } = await vla({
94
- modelId,
95
- images,
96
- // Patch inputs ignore imgWidth/imgHeight, but the request schema requires
97
- // positive integers; pass the model's vision image size.
98
- imgWidth: hparams.visionImageSize,
99
- imgHeight: hparams.visionImageSize,
100
- state,
101
- tokens,
102
- mask,
103
- noise
104
- });
105
- console.log(`▸ Got ${chunkSize} action steps of dim ${actionDim}.`);
106
- console.log(Array.from(actions.subarray(0, actionDim)));
107
- if (stats) {
108
- console.log(`▸ Timing: vision=${stats.vision_ms?.toFixed(0)}ms ` +
109
- `ode=${stats.ode_ms?.toFixed(0)}ms ` +
110
- `total=${stats.total_ms?.toFixed(0)}ms`);
147
+ await runInference(hparams);
148
+ if (switchEmbodiment !== undefined) {
149
+ console.log(`▸ Switching embodiment to ${JSON.stringify(switchEmbodiment)}...`);
150
+ const { hparams: refreshed } = await vlaSetEmbodiment({ modelId, embodiment: switchEmbodiment });
151
+ console.log(`▸ Embodiment: ${refreshed.selectedEmbodimentTag} ` +
152
+ `(cat_id ${refreshed.selectedEmbodimentCatId}, ${refreshed.numCameras} cameras)`);
153
+ await runInference(refreshed);
111
154
  }
112
155
  await unloadModel({ modelId, clearStorage: false });
113
156
  console.log('▸ Model unloaded.');
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- export { batchCompletion, completion, deleteCache, loadModel, downloadAsset, heartbeat, startQVACProvider, stopQVACProvider, unloadModel, transcribe, transcribeStream, bciTranscribe, bciTranscribeStream, embed, finetune, translate, cancel, ragChunk, ragIngest, ragSaveEmbeddings, ragSearch, ragDeleteEmbeddings, ragReindex, ragListWorkspaces, ragCloseWorkspace, ragDeleteWorkspace, textToSpeech, textToSpeechStream, getModelInfo, getLoadedModelInfo, getSystemResources, loggingStream, subscribeServerLogs, type ServerLogHandler, ocr, invokePlugin, invokePluginStream, diffusion, type DiffusionProgressTick, classify, video, type VideoProgressTick, upscale, modelRegistryList, modelRegistrySearch, modelRegistryGetModel, type ModelRegistrySearchParams, suspend, resume, state, vla, vlaHparams, vlaPreprocessImage, vlaPadState, VLA_DEFAULT_IMAGE_SIZE, audioGen, type FinetuneHandle } from './client/api/index.js';
1
+ export { batchCompletion, completion, deleteCache, loadModel, downloadAsset, heartbeat, startQVACProvider, stopQVACProvider, unloadModel, transcribe, transcribeStream, bciTranscribe, bciTranscribeStream, embed, finetune, translate, cancel, ragChunk, ragIngest, ragSaveEmbeddings, ragSearch, ragDeleteEmbeddings, ragReindex, ragListWorkspaces, ragCloseWorkspace, ragDeleteWorkspace, textToSpeech, textToSpeechStream, getModelInfo, getLoadedModelInfo, getSystemResources, loggingStream, subscribeServerLogs, type ServerLogHandler, ocr, invokePlugin, invokePluginStream, diffusion, type DiffusionProgressTick, classify, video, type VideoProgressTick, upscale, modelRegistryList, modelRegistrySearch, modelRegistryGetModel, type ModelRegistrySearchParams, suspend, resume, state, vla, vlaHparams, vlaSetEmbodiment, vlaPreprocessImage, vlaPadState, VLA_DEFAULT_IMAGE_SIZE, audioGen, type FinetuneHandle } from './client/api/index.js';
2
2
  export { close } from './client/index.js';
3
3
  export { plugins } from './client/plugins-factory.js';
4
- export { type LifecycleState, type ModelProgressUpdate, type LoadModelOptions, type LoadCustomPluginModelOptions, type DownloadAssetOptions, type Tool, type ToolCall, type ToolCallWithCall, type ToolCallError, type ToolCallEvent, type CompletionEvent, type CompletionFinal, type CompletionRun, type CompletionStats, type BatchCompletionEvent, type BatchCompletionResult, type BatchCompletionRun, type BatchPrompt, type EmbedStats, VERBOSITY, type Attachment, type TranscribeStreamSession, type TranscribeStreamMetadataSession, type TranscribeStreamConversationSession, type TranscribeStreamEvent, type VadStateEvent, type EndOfTurnEvent, type TranscribeSegment, type BciConfig, type BciTranscribeClientParams, type BciTranscribeStreamClientParams, type BciTranscribeStreamSession, type BciTranscribeStreamMetadataSession, type BciStreamOpts, type NeuralInput, type TextToSpeechStreamSession, type TextToSpeechStreamResponse, type TextToSpeechStreamClientParams, type TtsClientParamsInput, type TtsParlerEmotion, type TtsParlerLoadConfig, type TtsParlerRuntimeConfig, type CompletionParams, type ToolDialect, type RagSearchResult, type RagSaveEmbeddingsResult, type RagReindexResult, type RagEmbeddedDoc, type RagDoc, type RagWorkspaceInfo, type RagCloseWorkspaceParams, type RagDeleteWorkspaceParams, type RagIngestStage, type RagReindexStage, type RagSaveStage, SDK_CLIENT_ERROR_CODES, SDK_SERVER_ERROR_CODES, RAG_ERROR_CODES, type QvacConfig, type ModelInfo, type GetModelInfoParams, type GetLoadedModelInfoParams, type LoadedModelInfo, type GetSystemResourcesInput, type ResourceScope, type ResourceProvenance, type ResourceMetric, type GraphicsDriver, type GraphicsDriverCapabilities, type BackendProbeResult, type BackendDevice, type BackendDriver, type BackendFallback, type InferenceBackendDiagnostics, type CPUResourceCapabilities, type GPUResourceCapabilities, type SystemResourceCapabilities, type GPUResourceSample, type SystemResourceSample, type SystemResources, type LoadedInstance, type CacheFileInfo, toolSchema, TOOLS_MODE, type ToolsMode, type McpClient, type McpClientInput, type OCRClientParams, type OCRTextBlock, type OCROptions, type ClassifyClientParams, type ClassificationResult, type DiffusionClientParams, type DiffusionStreamResponse, type DiffusionStats, type AudioGenClientParams, type AudioGenConfig, type AudioGenRuntimeConfig, type AudioGenProgress, type AudioGenAudio, type AudioGenStats, type AudioGenResult, type AudioGenStreamResponse, type VideoClientParams, type VideoStreamResponse, type VideoStats, type UpscaleClientParams, type UpscaleStreamResponse, type UpscaleStats, type VlaConfig, type VlaClientRunParams, type VlaClientRunResult, type VlaHparams, type VlaStats, definePlugin, defineHandler, defineDuplexHandler, type QvacPlugin, type CreateModelParams, type PluginModelResult, type ModelRegistryEntry, type ModelRegistryEntryAddon, PLUGIN_LLM, PLUGIN_EMBEDDING, PLUGIN_WHISPER, PLUGIN_BCI, PLUGIN_NMT, PLUGIN_TTS, PLUGIN_OCR, PLUGIN_DIFFUSION, PLUGIN_AUDIOGEN, PLUGIN_VLA, PLUGIN_CLASSIFICATION, SDK_DEFAULT_PLUGINS, type BuiltinPlugin, type ProfilerMode, type FinetuneValidation, type FinetuneRunParams, type FinetuneGetStateParams, type FinetuneStopParams, type FinetuneParams, type FinetuneStatus, type FinetuneProgress, type FinetuneStats, type FinetuneResult } from './schemas/index.js';
4
+ export { type LifecycleState, type ModelProgressUpdate, type LoadModelOptions, type LoadCustomPluginModelOptions, type DownloadAssetOptions, type Tool, type ToolCall, type ToolCallWithCall, type ToolCallError, type ToolCallEvent, type CompletionEvent, type CompletionFinal, type CompletionRun, type CompletionStats, type BatchCompletionEvent, type BatchCompletionResult, type BatchCompletionRun, type BatchPrompt, type EmbedStats, type TranscribeStats, VERBOSITY, type Attachment, type TranscribeStreamSession, type TranscribeStreamMetadataSession, type TranscribeStreamConversationSession, type TranscribeStreamEvent, type VadStateEvent, type EndOfTurnEvent, type TranscribeSegment, type BciConfig, type BciTranscribeClientParams, type BciTranscribeStreamClientParams, type BciTranscribeStreamSession, type BciTranscribeStreamMetadataSession, type BciStreamOpts, type NeuralInput, type TextToSpeechStreamSession, type TextToSpeechStreamResponse, type TextToSpeechStreamClientParams, type TtsClientParamsInput, type TtsParlerEmotion, type TtsParlerLoadConfig, type TtsParlerRuntimeConfig, TTS_PACES, TTS_COSYVOICE3_EMOTIONS, TTS_COSYVOICE3_INSTRUCT_DIALECTS, TTS_COSYVOICE3_INSTRUCT_VOLUMES, TTS_COSYVOICE3_INSTRUCT_STYLES, type TtsPace, type TtsCosyvoice3Emotion, type TtsCosyvoice3Instruct, type TtsCosyvoice3LoadConfig, type TtsCosyvoice3RuntimeConfig, type TtsAudio8LoadConfig, type TtsAudio8RuntimeConfig, type CompletionParams, type ToolDialect, type RagSearchResult, type RagSaveEmbeddingsResult, type RagReindexResult, type RagEmbeddedDoc, type RagDoc, type RagWorkspaceInfo, type RagCloseWorkspaceParams, type RagDeleteWorkspaceParams, type RagIngestStage, type RagReindexStage, type RagSaveStage, SDK_CLIENT_ERROR_CODES, SDK_SERVER_ERROR_CODES, RAG_ERROR_CODES, type QvacConfig, type ModelInfo, type GetModelInfoParams, type GetLoadedModelInfoParams, type LoadedModelInfo, type GetSystemResourcesInput, type ResourceScope, type ResourceProvenance, type ResourceMetric, type GraphicsDriver, type GraphicsDriverCapabilities, type BackendProbeResult, type BackendDevice, type BackendDriver, type BackendFallback, type InferenceBackendDiagnostics, type CPUResourceCapabilities, type GPUResourceCapabilities, type SystemResourceCapabilities, type GPUResourceSample, type SystemResourceSample, type SystemResources, type LoadedInstance, type CacheFileInfo, toolSchema, type McpClient, type McpClientInput, type OCRClientParams, type OCRTextBlock, type OCROptions, type ClassifyClientParams, type ClassificationResult, type DiffusionClientParams, type DiffusionStreamResponse, type DiffusionStats, AUDIOGEN_TASK_TYPES, AUDIOGEN_INPUT_SAMPLE_RATE, AUDIOGEN_INPUT_CHANNELS, AUDIOGEN_INPUT_MAX_SECONDS, type AudioGenTaskType, type AudioGenAudioInput, type AudioGenClientParams, type AudioGenConfig, type AudioGenRuntimeConfig, type AudioGenProgress, type AudioGenAudio, type AudioGenStats, type AudioGenResult, type AudioGenStreamResponse, type VideoClientParams, type VideoStreamResponse, type VideoStats, type UpscaleClientParams, type UpscaleStreamResponse, type UpscaleStats, type VlaConfig, type VlaClientRunParams, type VlaClientRunResult, type VlaEmbodimentSelection, type VlaEmbodimentSelector, type VlaHparams, type VlaStats, definePlugin, defineHandler, defineDuplexHandler, type QvacPlugin, type CreateModelParams, type PluginModelResult, type ModelRegistryEntry, type ModelRegistryEntryAddon, PLUGIN_LLM, PLUGIN_EMBEDDING, PLUGIN_WHISPER, PLUGIN_BCI, PLUGIN_NMT, PLUGIN_TTS, PLUGIN_OCR, PLUGIN_DIFFUSION, PLUGIN_AUDIOGEN, PLUGIN_VLA, PLUGIN_CLASSIFICATION, SDK_DEFAULT_PLUGINS, type BuiltinPlugin, type ProfilerMode, type FinetuneValidation, type FinetuneRunParams, type FinetuneGetStateParams, type FinetuneStopParams, type FinetuneParams, type FinetuneStatus, type FinetuneProgress, type FinetuneStats, type FinetuneResult } from './schemas/index.js';
5
5
  export { type ToolInput, type ToolHandler } from './utils/tool-helpers.js';
6
6
  export { MODEL_TYPES, ModelType } from './schemas/index.js';
7
7
  export * from './models/registry/index.js';
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  // Public API exports only
2
- export { batchCompletion, completion, deleteCache, loadModel, downloadAsset, heartbeat, startQVACProvider, stopQVACProvider, unloadModel, transcribe, transcribeStream, bciTranscribe, bciTranscribeStream, embed, finetune, translate, cancel, ragChunk, ragIngest, ragSaveEmbeddings, ragSearch, ragDeleteEmbeddings, ragReindex, ragListWorkspaces, ragCloseWorkspace, ragDeleteWorkspace, textToSpeech, textToSpeechStream, getModelInfo, getLoadedModelInfo, getSystemResources, loggingStream, subscribeServerLogs, ocr, invokePlugin, invokePluginStream, diffusion, classify, video, upscale, modelRegistryList, modelRegistrySearch, modelRegistryGetModel, suspend, resume, state, vla, vlaHparams, vlaPreprocessImage, vlaPadState, VLA_DEFAULT_IMAGE_SIZE, audioGen } from './client/api/index.js';
2
+ export { batchCompletion, completion, deleteCache, loadModel, downloadAsset, heartbeat, startQVACProvider, stopQVACProvider, unloadModel, transcribe, transcribeStream, bciTranscribe, bciTranscribeStream, embed, finetune, translate, cancel, ragChunk, ragIngest, ragSaveEmbeddings, ragSearch, ragDeleteEmbeddings, ragReindex, ragListWorkspaces, ragCloseWorkspace, ragDeleteWorkspace, textToSpeech, textToSpeechStream, getModelInfo, getLoadedModelInfo, getSystemResources, loggingStream, subscribeServerLogs, ocr, invokePlugin, invokePluginStream, diffusion, classify, video, upscale, modelRegistryList, modelRegistrySearch, modelRegistryGetModel, suspend, resume, state, vla, vlaHparams, vlaSetEmbodiment, vlaPreprocessImage, vlaPadState, VLA_DEFAULT_IMAGE_SIZE, audioGen } from './client/api/index.js';
3
3
  export { close } from './client/index.js';
4
4
  export { plugins } from './client/plugins-factory.js';
5
- export { VERBOSITY, SDK_CLIENT_ERROR_CODES, SDK_SERVER_ERROR_CODES, RAG_ERROR_CODES, toolSchema, TOOLS_MODE, definePlugin, defineHandler, defineDuplexHandler, PLUGIN_LLM, PLUGIN_EMBEDDING, PLUGIN_WHISPER, PLUGIN_BCI, PLUGIN_NMT, PLUGIN_TTS, PLUGIN_OCR, PLUGIN_DIFFUSION, PLUGIN_AUDIOGEN, PLUGIN_VLA, PLUGIN_CLASSIFICATION, SDK_DEFAULT_PLUGINS } from './schemas/index.js';
5
+ export { VERBOSITY, TTS_PACES, TTS_COSYVOICE3_EMOTIONS, TTS_COSYVOICE3_INSTRUCT_DIALECTS, TTS_COSYVOICE3_INSTRUCT_VOLUMES, TTS_COSYVOICE3_INSTRUCT_STYLES, SDK_CLIENT_ERROR_CODES, SDK_SERVER_ERROR_CODES, RAG_ERROR_CODES, toolSchema, AUDIOGEN_TASK_TYPES, AUDIOGEN_INPUT_SAMPLE_RATE, AUDIOGEN_INPUT_CHANNELS, AUDIOGEN_INPUT_MAX_SECONDS, definePlugin, defineHandler, defineDuplexHandler, PLUGIN_LLM, PLUGIN_EMBEDDING, PLUGIN_WHISPER, PLUGIN_BCI, PLUGIN_NMT, PLUGIN_TTS, PLUGIN_OCR, PLUGIN_DIFFUSION, PLUGIN_AUDIOGEN, PLUGIN_VLA, PLUGIN_CLASSIFICATION, SDK_DEFAULT_PLUGINS } from './schemas/index.js';
6
6
  export {} from './utils/tool-helpers.js';
7
7
  // Model types - canonical naming with backward-compatible aliases
8
8
  export { MODEL_TYPES, ModelType } from './schemas/index.js';