@tryhamster/gerbil 1.11.0 → 1.11.2
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/dist/cli.mjs +7 -7
- package/dist/cli.mjs.map +1 -1
- package/dist/{defaults-C_bJK9zs.mjs → defaults-DfGx4d1m.mjs} +22 -2
- package/dist/{defaults-C_bJK9zs.mjs.map → defaults-DfGx4d1m.mjs.map} +1 -1
- package/dist/frameworks/express.mjs +1 -1
- package/dist/frameworks/fastify.mjs +1 -1
- package/dist/frameworks/hono.mjs +1 -1
- package/dist/frameworks/next.d.mts +2 -2
- package/dist/frameworks/next.mjs +1 -1
- package/dist/frameworks/trpc.mjs +1 -1
- package/dist/{gerbil-BpYemKEH.mjs → gerbil-CfNSSpgW.mjs} +2 -2
- package/dist/{gerbil-BpYemKEH.mjs.map → gerbil-CfNSSpgW.mjs.map} +1 -1
- package/dist/gerbil-Cq20PKtz.mjs +4 -0
- package/dist/{gerbil-6E0XH_8s.d.mts → gerbil-Cs8L0iVm.d.mts} +2 -2
- package/dist/{gerbil-6E0XH_8s.d.mts.map → gerbil-Cs8L0iVm.d.mts.map} +1 -1
- package/dist/gpu/hooks.d.mts +1 -1
- package/dist/gpu/hooks.mjs +1 -1
- package/dist/gpu/index.d.mts +2 -2
- package/dist/gpu/index.mjs +4 -4
- package/dist/{gpu-CzgbyVeq.mjs → gpu-BQ8I-VDx.mjs} +58 -18
- package/dist/{gpu-CzgbyVeq.mjs.map → gpu-BQ8I-VDx.mjs.map} +1 -1
- package/dist/{index-DyqcKFfQ.d.mts → index-t_hY-XWW.d.mts} +72 -7
- package/dist/index-t_hY-XWW.d.mts.map +1 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +5 -5
- package/dist/integrations/ai-sdk.mjs +1 -1
- package/dist/integrations/langchain.mjs +1 -1
- package/dist/integrations/llamaindex.mjs +1 -1
- package/dist/integrations/mcp.d.mts +2 -2
- package/dist/integrations/mcp.mjs +4 -4
- package/dist/{mcp-DSpjqWZC.mjs → mcp-BITYRhF6.mjs} +3 -3
- package/dist/{mcp-DSpjqWZC.mjs.map → mcp-BITYRhF6.mjs.map} +1 -1
- package/dist/{moonshine-stt-CgDXoLFd.mjs → moonshine-stt-BI-5UmD_.mjs} +640 -550
- package/dist/moonshine-stt-BI-5UmD_.mjs.map +1 -0
- package/dist/moonshine-stt-CZ00EdnB.mjs +4 -0
- package/dist/{one-liner-BgNDxJSJ.mjs → one-liner-BLz8g6Gz.mjs} +2 -2
- package/dist/{one-liner-BgNDxJSJ.mjs.map → one-liner-BLz8g6Gz.mjs.map} +1 -1
- package/dist/{repl-DSK2hDzu.mjs → repl-CXCSbfES.mjs} +3 -3
- package/dist/skills/index.d.mts +4 -4
- package/dist/skills/index.mjs +3 -3
- package/dist/{skills-Cd75ZGew.mjs → skills-BPQb-p5b.mjs} +2 -2
- package/dist/{skills-Cd75ZGew.mjs.map → skills-BPQb-p5b.mjs.map} +1 -1
- package/dist/tune/index.d.mts.map +1 -1
- package/dist/tune/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/gerbil-BY5EW-Jk.mjs +0 -4
- package/dist/index-DyqcKFfQ.d.mts.map +0 -1
- package/dist/moonshine-stt-CcVt4Vdd.mjs +0 -4
- package/dist/moonshine-stt-CgDXoLFd.mjs.map +0 -1
|
@@ -47,6 +47,26 @@ const OUTETTS_PRESET_VOICES = [
|
|
|
47
47
|
"gerbil-voice-5",
|
|
48
48
|
"gerbil-voice-6"
|
|
49
49
|
];
|
|
50
|
+
/**
|
|
51
|
+
* True when `repo`/`architecture` identify a text-to-speech checkpoint that must
|
|
52
|
+
* run through a dedicated native TTS engine (KaniTTS, OuteTTS, or Parler-TTS)
|
|
53
|
+
* rather than the single-graph base text loader. Mirrors the routing used by
|
|
54
|
+
* `WebGPUEngine.speak()` / `Gerbil.ensureNativeTTSEngine`:
|
|
55
|
+
* - Parler → encoder-decoder (`ParlerTTSForConditionalGeneration`)
|
|
56
|
+
* - OuteTTS → Qwen3-0.6B codec-LM
|
|
57
|
+
* - Kani → conv-backbone codec-LM (`KaniTTS2ForCausalLM`, or the Apache
|
|
58
|
+
* default which is a plain `Lfm2ForCausalLM` — hence the repo-name
|
|
59
|
+
* gate; the architecture string alone does not identify it).
|
|
60
|
+
* At `create()` time only the repo is known (the architecture is discovered
|
|
61
|
+
* during load), so the repo-name signals below cover all three DEFAULT_MODELS
|
|
62
|
+
* and conventionally-named TTS repos; the architecture arg is honored when a
|
|
63
|
+
* caller already has it.
|
|
64
|
+
*/
|
|
65
|
+
function isTTSRepo(repo, architecture) {
|
|
66
|
+
const r = repo ?? "";
|
|
67
|
+
const a = architecture ?? "";
|
|
68
|
+
return r === DEFAULT_MODELS.tts || r === DEFAULT_MODELS.ttsOute || r === DEFAULT_MODELS.ttsParler || /parler/i.test(r) || /parler/i.test(a) || /outetts/i.test(r) || /oute/i.test(a) || a === "KaniTTS2ForCausalLM" || /kani-tts/i.test(r) || /\btts\b/i.test(r);
|
|
69
|
+
}
|
|
50
70
|
/** Resolve the model repo for a set of options, falling back to the defaults. */
|
|
51
71
|
function resolveDefaultRepo(opts) {
|
|
52
72
|
if (opts.repo) return opts.repo;
|
|
@@ -56,5 +76,5 @@ function resolveDefaultRepo(opts) {
|
|
|
56
76
|
}
|
|
57
77
|
|
|
58
78
|
//#endregion
|
|
59
|
-
export { resolveDefaultRepo as i, OUTETTS_ASSETS as n, OUTETTS_PRESET_VOICES as r, DEFAULT_MODELS as t };
|
|
60
|
-
//# sourceMappingURL=defaults-
|
|
79
|
+
export { resolveDefaultRepo as a, isTTSRepo as i, OUTETTS_ASSETS as n, OUTETTS_PRESET_VOICES as r, DEFAULT_MODELS as t };
|
|
80
|
+
//# sourceMappingURL=defaults-DfGx4d1m.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults-
|
|
1
|
+
{"version":3,"file":"defaults-DfGx4d1m.mjs","names":[],"sources":["../src/gpu/defaults.ts"],"sourcesContent":["/**\n * Default model per capability. Kept in its own tiny module (no heavy imports)\n * so the React hooks can resolve defaults without statically pulling in the GPU\n * engine — they import the engine dynamically to stay light.\n */\nexport const DEFAULT_MODELS = {\n /** Text generation (also the vision-capable checkpoint). */\n text: \"mlx-community/Qwen3.5-0.8B-4bit\",\n /** Image understanding — same checkpoint, vision tower built on demand. */\n vision: \"mlx-community/Qwen3.5-0.8B-4bit\",\n /** Text embeddings. */\n embedding: \"mlx-community/embeddinggemma-300m-4bit\",\n /** Text-to-speech (Apache-2.0; LFM2-350M backbone + NanoCodec). Small/fast default. */\n tts: \"nineninesix/kani-tts-450m-0.2-ft\",\n /**\n * Selectable many-voices TTS (OuteTTS-1.0-0.6B: Qwen3-0.6B codec-LM + DAC.speech).\n * Pass this as the `repo`/`model` to engine.speak()/useTTS to route to OuteTTS.\n */\n ttsOute: \"OuteAI/OuteTTS-1.0-0.6B\",\n /**\n * Selectable describe-your-voice TTS (Parler-TTS-mini-v1: Flan-T5 encoder +\n * cross-attending decoder LM + dac_44khz). Pass this as the `repo`/`model` to\n * engine.speak()/useTTS with a `describeVoice` natural-language description.\n */\n ttsParler: \"parler-tts/parler-tts-mini-v1\",\n /** Speech-to-text. */\n stt: \"UsefulSensors/moonshine-base\",\n} as const;\n\n/**\n * OuteTTS auxiliary assets. The DAC.speech codec ships only `.pth` (non-safetensors),\n * so the folded weights (prep-dac-speech.py output) and the preset speaker JSONs are\n * hosted on the Cloudflare R2 model mirror (same public host the engine reads via\n * GERBIL_MODEL_BASE — range + CORS, free egress, no redirect). Override via the OuteTTS\n * options when self-hosting.\n */\nconst OUTETTS_ASSET_BASE =\n \"https://pub-0522ecec25fc412bb35a523f3e3f63c6.r2.dev/tryhamster/gerbil-outetts-assets\";\nexport const OUTETTS_ASSETS = {\n /** Folded DAC.speech.v1.0 encoder+decoder weights (prep-dac-speech.py output). */\n codecWeightsURL: `${OUTETTS_ASSET_BASE}/dac-speech-folded.safetensors`,\n /** Base URL for the preset speaker JSONs (`{name}.json`). */\n speakersBaseURL: `${OUTETTS_ASSET_BASE}/speakers`,\n /** The default preset voice. */\n defaultVoice: \"en-female-1-neutral\",\n} as const;\n\n/**\n * Bundled OuteTTS preset voices.\n *\n * Provenance (honest labelling):\n * - `en-female-1-neutral` is the ONE AUTHENTIC OuteAI voice — the OuteTTS v3 bundled\n * default speaker (default_speakers/en-female-1-neutral), copied verbatim.\n * - `gerbil-voice-2..6` are DERIVED voices: distinct timbres produced by running\n * pitch/tempo-varied renderings of that authentic clip back through the REAL\n * DAC.speech encode + prosody pipeline (scripts/engine/stage-outetts-assets.py).\n * They are genuine DAC-encoded OuteSpeakers, but they are NOT OuteAI's own\n * `en-male-*` voices, so they are not labelled as such. (Earlier builds mislabelled\n * them as `en-male-2-neutral` etc.; renamed for honesty.)\n */\nexport const OUTETTS_PRESET_VOICES = [\n \"en-female-1-neutral\",\n \"gerbil-voice-2\",\n \"gerbil-voice-3\",\n \"gerbil-voice-4\",\n \"gerbil-voice-5\",\n \"gerbil-voice-6\",\n] as const;\n\n/**\n * True when `repo`/`architecture` identify a text-to-speech checkpoint that must\n * run through a dedicated native TTS engine (KaniTTS, OuteTTS, or Parler-TTS)\n * rather than the single-graph base text loader. Mirrors the routing used by\n * `WebGPUEngine.speak()` / `Gerbil.ensureNativeTTSEngine`:\n * - Parler → encoder-decoder (`ParlerTTSForConditionalGeneration`)\n * - OuteTTS → Qwen3-0.6B codec-LM\n * - Kani → conv-backbone codec-LM (`KaniTTS2ForCausalLM`, or the Apache\n * default which is a plain `Lfm2ForCausalLM` — hence the repo-name\n * gate; the architecture string alone does not identify it).\n * At `create()` time only the repo is known (the architecture is discovered\n * during load), so the repo-name signals below cover all three DEFAULT_MODELS\n * and conventionally-named TTS repos; the architecture arg is honored when a\n * caller already has it.\n */\nexport function isTTSRepo(repo?: string, architecture?: string): boolean {\n const r = repo ?? \"\";\n const a = architecture ?? \"\";\n return (\n r === DEFAULT_MODELS.tts ||\n r === DEFAULT_MODELS.ttsOute ||\n r === DEFAULT_MODELS.ttsParler ||\n /parler/i.test(r) ||\n /parler/i.test(a) ||\n /outetts/i.test(r) ||\n /oute/i.test(a) ||\n a === \"KaniTTS2ForCausalLM\" ||\n /kani-tts/i.test(r) ||\n /\\btts\\b/i.test(r)\n );\n}\n\n/** Resolve the model repo for a set of options, falling back to the defaults. */\nexport function resolveDefaultRepo(opts: {\n repo?: string;\n embedding?: boolean;\n enableVision?: boolean;\n}): string {\n if (opts.repo) return opts.repo;\n if (opts.embedding) return DEFAULT_MODELS.embedding;\n if (opts.enableVision) return DEFAULT_MODELS.vision;\n return DEFAULT_MODELS.text;\n}\n"],"mappings":";;;;;;AAKA,MAAa,iBAAiB;CAE5B,MAAM;CAEN,QAAQ;CAER,WAAW;CAEX,KAAK;CAKL,SAAS;CAMT,WAAW;CAEX,KAAK;CACN;;;;;;;;AASD,MAAM,qBACJ;AACF,MAAa,iBAAiB;CAE5B,iBAAiB,GAAG,mBAAmB;CAEvC,iBAAiB,GAAG,mBAAmB;CAEvC,cAAc;CACf;;;;;;;;;;;;;;AAeD,MAAa,wBAAwB;CACnC;CACA;CACA;CACA;CACA;CACA;CACD;;;;;;;;;;;;;;;;AAiBD,SAAgB,UAAU,MAAe,cAAgC;CACvE,MAAM,IAAI,QAAQ;CAClB,MAAM,IAAI,gBAAgB;AAC1B,QACE,MAAM,eAAe,OACrB,MAAM,eAAe,WACrB,MAAM,eAAe,aACrB,UAAU,KAAK,EAAE,IACjB,UAAU,KAAK,EAAE,IACjB,WAAW,KAAK,EAAE,IAClB,QAAQ,KAAK,EAAE,IACf,MAAM,yBACN,YAAY,KAAK,EAAE,IACnB,WAAW,KAAK,EAAE;;;AAKtB,SAAgB,mBAAmB,MAIxB;AACT,KAAI,KAAK,KAAM,QAAO,KAAK;AAC3B,KAAI,KAAK,UAAW,QAAO,eAAe;AAC1C,KAAI,KAAK,aAAc,QAAO,eAAe;AAC7C,QAAO,eAAe"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __require } from "../chunk-BeNUM--j.mjs";
|
|
2
|
-
import { r as DEFAULT_MODEL, t as Gerbil } from "../gerbil-
|
|
2
|
+
import { r as DEFAULT_MODEL, t as Gerbil } from "../gerbil-CfNSSpgW.mjs";
|
|
3
3
|
import "../utils-CZBZ8dgR.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/frameworks/express.ts
|
package/dist/frameworks/hono.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../outetts-CAL3_K3j.mjs";
|
|
2
2
|
import { d as GerbilConfig } from "../types-BzbBDoaP.mjs";
|
|
3
|
-
import "../index-
|
|
4
|
-
import { t as Gerbil } from "../gerbil-
|
|
3
|
+
import "../index-t_hY-XWW.mjs";
|
|
4
|
+
import { t as Gerbil } from "../gerbil-Cs8L0iVm.mjs";
|
|
5
5
|
|
|
6
6
|
//#region src/frameworks/next.d.ts
|
|
7
7
|
|
package/dist/frameworks/next.mjs
CHANGED
package/dist/frameworks/trpc.mjs
CHANGED
|
@@ -1619,7 +1619,7 @@ The JSON must conform to this schema: ${JSON.stringify(zodToJsonSchema(schema))}
|
|
|
1619
1619
|
/** Lazily build (or reuse) the native MoonshineSTT engine (default repo). */
|
|
1620
1620
|
async ensureNativeSTT() {
|
|
1621
1621
|
if (!this.nativeSTT) {
|
|
1622
|
-
const { MoonshineSTT } = await import("./moonshine-stt-
|
|
1622
|
+
const { MoonshineSTT } = await import("./moonshine-stt-CZ00EdnB.mjs");
|
|
1623
1623
|
this.nativeSTT = await MoonshineSTT.create();
|
|
1624
1624
|
}
|
|
1625
1625
|
return this.nativeSTT;
|
|
@@ -1786,4 +1786,4 @@ The JSON must conform to this schema: ${JSON.stringify(zodToJsonSchema(schema))}
|
|
|
1786
1786
|
|
|
1787
1787
|
//#endregion
|
|
1788
1788
|
export { resolveModel as a, configureGlobalCache as c, listBuiltinModels as i, getGlobalCache as l, BUILTIN_MODELS as n, ResponseCache as o, DEFAULT_MODEL as r, clearGlobalCache as s, Gerbil as t };
|
|
1789
|
-
//# sourceMappingURL=gerbil-
|
|
1789
|
+
//# sourceMappingURL=gerbil-CfNSSpgW.mjs.map
|