@chatpanel/gateway 0.6.24 → 0.6.25
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/package.json +1 -1
- package/src/server.js +4 -2
- package/src/stt-engine.js +9 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chatpanel/gateway",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.25",
|
|
4
4
|
"description": "Local privacy gateway — redacts PII out of OpenAI/Anthropic API traffic before it reaches a model, then restores it in the reply. Point opencode, codex, aider, Claude Code, etc. at it.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/src/server.js
CHANGED
|
@@ -43,7 +43,7 @@ import * as openai from './openai.js';
|
|
|
43
43
|
import * as responses from './responses.js';
|
|
44
44
|
import * as anthropic from './anthropic.js';
|
|
45
45
|
|
|
46
|
-
export const VERSION = '0.6.
|
|
46
|
+
export const VERSION = '0.6.25';
|
|
47
47
|
|
|
48
48
|
// WARM search tier — SQLite + FTS5 record store (falls back to an encrypted-JSON
|
|
49
49
|
// store if SQLite can't load), fed by the extension's ingest sync + backup-ingest.
|
|
@@ -499,7 +499,9 @@ export function createGateway(cfg = loadConfig()) {
|
|
|
499
499
|
const stt = sttEngine.health();
|
|
500
500
|
return sendJson(res, 200, {
|
|
501
501
|
ok: true, version: VERSION, backend: cfg.backend, tier: cfg.redaction.tier,
|
|
502
|
-
|
|
502
|
+
// `runtime` = 'native' (npm, fast quantized) | 'wasm' (binary, slow fp32) —
|
|
503
|
+
// the extension uses it to advise the far-faster native gateway.
|
|
504
|
+
stt: { enabled: cfg.stt?.enabled !== false, state: stt.state, ready: stt.ok, model: stt.model || cfg.stt?.model || DEFAULT_STT_MODEL, runtime: stt.runtime, dtype: stt.dtype },
|
|
503
505
|
});
|
|
504
506
|
}
|
|
505
507
|
|
package/src/stt-engine.js
CHANGED
|
@@ -39,6 +39,14 @@ export function runtimeDtype() {
|
|
|
39
39
|
return globalThis.__CHATPANEL_WASM_PATHS__ ? 'fp32' : 'q8';
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
+
// Which ONNX runtime is active: the standalone binary uses onnxruntime-web WASM
|
|
43
|
+
// (fp32-only, single-thread — ~10× slower); the npm package uses onnxruntime-node
|
|
44
|
+
// (native, quantized q8). The extension surfaces this so users on the slow WASM
|
|
45
|
+
// build know the native gateway is far faster.
|
|
46
|
+
export function runtimeName() {
|
|
47
|
+
return globalThis.__CHATPANEL_WASM_PATHS__ ? 'wasm' : 'native';
|
|
48
|
+
}
|
|
49
|
+
|
|
42
50
|
let _state = 'off'; // 'off' | 'loading' | 'downloading' | 'ready' | 'error'
|
|
43
51
|
let _model = null; // active model id
|
|
44
52
|
let _pipe = null; // the loaded automatic-speech-recognition pipeline
|
|
@@ -72,7 +80,7 @@ export function isReady() { return _state === 'ready' && !!_pipe; }
|
|
|
72
80
|
export function progress() { return _progress; }
|
|
73
81
|
|
|
74
82
|
export function health() {
|
|
75
|
-
return { configured: _state !== 'off', ok: isReady(), state: _state, model: _model, dtype: _dtype, error: _err };
|
|
83
|
+
return { configured: _state !== 'off', ok: isReady(), state: _state, model: _model, dtype: _dtype, runtime: runtimeName(), error: _err };
|
|
76
84
|
}
|
|
77
85
|
|
|
78
86
|
// (Re)load a model into _pipe. Same contract as ner-engine.loadModel: fail-open,
|