@simplexai/localmodels-linux-arm64 0.1.0-dev.102 → 0.1.0-dev.103
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/bootstrap.identity +1 -1
- package/bootstrap.sha256 +46 -27
- package/modules/localmodels/__init__.py +1 -1
- package/modules/localmodels/__main__.py +3 -1
- package/modules/localmodels/catalog.json +306 -1
- package/modules/localmodels/cli_parser.py +4 -0
- package/modules/localmodels/debug_stub_server.py +280 -7
- package/modules/localmodels/download-mirrors.json +76 -0
- package/modules/localmodels/engines-speechcpp-v0.11.3.json +84 -0
- package/modules/localmodels/library_serve.py +46 -26
- package/modules/localmodels/remote_ops_common.py +12 -2
- package/modules/localmodels/sidecar_downloads.py +426 -0
- package/modules/localmodels/sidecar_http.py +396 -0
- package/modules/localmodels/sidecar_state.py +466 -0
- package/modules/localmodels/speech_admission.py +13 -0
- package/modules/localmodels/speech_jobs.py +81 -370
- package/modules/localmodels/speech_server.py +17 -8
- package/modules/localmodels/speech_state.py +87 -454
- package/modules/localmodels/speech_workers.py +41 -163
- package/modules/localmodels/stack.py +18 -0
- package/modules/localmodels/stack_down.py +19 -14
- package/modules/localmodels/stack_ports.py +1 -0
- package/modules/localmodels/stack_up.py +51 -1
- package/modules/localmodels/strata_poly_server.py +140 -3
- package/modules/localmodels/tts-moss.txt +321 -0
- package/modules/localmodels/tts_admission.py +396 -0
- package/modules/localmodels/tts_backend_speechcpp.py +487 -0
- package/modules/localmodels/tts_catalog.py +251 -0
- package/modules/localmodels/tts_cli.py +333 -0
- package/modules/localmodels/tts_http.py +617 -0
- package/modules/localmodels/tts_jobs.py +496 -0
- package/modules/localmodels/tts_model.py +591 -0
- package/modules/localmodels/tts_moss_presets.json +1 -0
- package/modules/localmodels/tts_serve.py +451 -0
- package/modules/localmodels/tts_sidecar.py +750 -0
- package/modules/localmodels/tts_state.py +395 -0
- package/modules/localmodels/tts_worker_kokoro.py +463 -0
- package/modules/localmodels/tts_worker_moss.py +748 -0
- package/modules/localmodels/tts_workers.py +696 -0
- package/modules/{simplex_localmodels-0.1.0.dev102.dist-info → simplex_localmodels-0.1.0.dev103.dist-info}/METADATA +1 -1
- package/modules/{simplex_localmodels-0.1.0.dev102.dist-info → simplex_localmodels-0.1.0.dev103.dist-info}/RECORD +43 -24
- package/modules/{simplex_localmodels-0.1.0.dev102.dist-info → simplex_localmodels-0.1.0.dev103.dist-info}/licenses/NOTICE +29 -0
- package/package.json +1 -1
- package/tool.json +1 -1
- /package/modules/{simplex_localmodels-0.1.0.dev102.dist-info → simplex_localmodels-0.1.0.dev103.dist-info}/WHEEL +0 -0
- /package/modules/{simplex_localmodels-0.1.0.dev102.dist-info → simplex_localmodels-0.1.0.dev103.dist-info}/entry_points.txt +0 -0
- /package/modules/{simplex_localmodels-0.1.0.dev102.dist-info → simplex_localmodels-0.1.0.dev103.dist-info}/licenses/localmodels/HERMES-LICENSE +0 -0
|
@@ -14,7 +14,13 @@ from http import HTTPStatus
|
|
|
14
14
|
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
|
|
15
15
|
from typing import Any
|
|
16
16
|
|
|
17
|
-
from localmodels import
|
|
17
|
+
from localmodels import (
|
|
18
|
+
sidecar_http,
|
|
19
|
+
speech_worker_sensevoice,
|
|
20
|
+
tts_model,
|
|
21
|
+
tts_worker_kokoro,
|
|
22
|
+
tts_worker_moss,
|
|
23
|
+
)
|
|
18
24
|
|
|
19
25
|
_SPEECH_SILENCE_RMS = 150.0
|
|
20
26
|
_BOUNDARY_RE = re.compile(r'boundary=(?:"([^"]+)"|([^;\s]+))', re.IGNORECASE)
|
|
@@ -348,6 +354,262 @@ def _make_handler(served_model: str) -> type[BaseHTTPRequestHandler]:
|
|
|
348
354
|
return Handler
|
|
349
355
|
|
|
350
356
|
|
|
357
|
+
def _synth_tone_pcm(text: str, sample_rate: int, speed: float = 1.0) -> tuple[bytes, int]:
|
|
358
|
+
dur = max(0.25, min(4.0, (len(text) * 0.05) / max(0.5, speed)))
|
|
359
|
+
count = int(sample_rate * dur)
|
|
360
|
+
samples = [0.25 * math.sin(2.0 * math.pi * 440.0 * i / sample_rate) for i in range(count)]
|
|
361
|
+
return sidecar_http.encode_pcm16_bytes(samples), count
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
def _send_chunked_pcm(
|
|
365
|
+
handler: BaseHTTPRequestHandler,
|
|
366
|
+
pcm_bytes: bytes,
|
|
367
|
+
*,
|
|
368
|
+
step: int,
|
|
369
|
+
extra_headers: dict[str, str] | None = None,
|
|
370
|
+
) -> None:
|
|
371
|
+
handler.send_response(HTTPStatus.OK)
|
|
372
|
+
handler.send_header("Content-Type", "audio/pcm")
|
|
373
|
+
handler.send_header("Transfer-Encoding", "chunked")
|
|
374
|
+
for name, value in (extra_headers or {}).items():
|
|
375
|
+
handler.send_header(name, value)
|
|
376
|
+
handler.send_header("Connection", "close")
|
|
377
|
+
handler.end_headers()
|
|
378
|
+
for pos in range(0, len(pcm_bytes), step):
|
|
379
|
+
part = pcm_bytes[pos : pos + step]
|
|
380
|
+
handler.wfile.write(f"{len(part):x}\r\n".encode("ascii"))
|
|
381
|
+
handler.wfile.write(part)
|
|
382
|
+
handler.wfile.write(b"\r\n")
|
|
383
|
+
handler.wfile.flush()
|
|
384
|
+
handler.wfile.write(b"0\r\n\r\n")
|
|
385
|
+
handler.wfile.flush()
|
|
386
|
+
handler.close_connection = True
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
def _make_qwen3_tts_handler(served_model: str) -> type[BaseHTTPRequestHandler]:
|
|
390
|
+
sample_rate = 24000
|
|
391
|
+
valid_voices = {v["id"] for v in tts_model.QWEN3_CUSTOMVOICE_VOICES}
|
|
392
|
+
supports_instr = "1.7b" in served_model.lower()
|
|
393
|
+
speech_voices = [
|
|
394
|
+
{"name": v["id"], "language": v["language"], "gender": v["gender"]}
|
|
395
|
+
for v in tts_model.QWEN3_CUSTOMVOICE_VOICES
|
|
396
|
+
]
|
|
397
|
+
|
|
398
|
+
class Qwen3TtsStubHandler(BaseHTTPRequestHandler):
|
|
399
|
+
protocol_version = "HTTP/1.1"
|
|
400
|
+
|
|
401
|
+
def log_message(self, format: str, *args: object) -> None: # noqa: A002
|
|
402
|
+
_ = (format, args)
|
|
403
|
+
|
|
404
|
+
def do_GET(self) -> None: # noqa: N802
|
|
405
|
+
path = urllib.parse.urlsplit(self.path).path
|
|
406
|
+
if path == "/health":
|
|
407
|
+
sidecar_http.send_json_response(
|
|
408
|
+
self,
|
|
409
|
+
HTTPStatus.OK,
|
|
410
|
+
{
|
|
411
|
+
"status": "ok",
|
|
412
|
+
"engine": "speech.cpp",
|
|
413
|
+
"model": served_model,
|
|
414
|
+
"sample_rate": sample_rate,
|
|
415
|
+
"simulated": True,
|
|
416
|
+
},
|
|
417
|
+
)
|
|
418
|
+
return
|
|
419
|
+
if path == "/v1/models":
|
|
420
|
+
sidecar_http.send_json_response(
|
|
421
|
+
self,
|
|
422
|
+
HTTPStatus.OK,
|
|
423
|
+
{
|
|
424
|
+
"object": "list",
|
|
425
|
+
"data": [
|
|
426
|
+
{
|
|
427
|
+
"id": served_model,
|
|
428
|
+
"object": "model",
|
|
429
|
+
"owned_by": "speech.cpp",
|
|
430
|
+
"speech": {
|
|
431
|
+
"sample_rate": sample_rate,
|
|
432
|
+
"incremental": True,
|
|
433
|
+
"voice_files": False,
|
|
434
|
+
"voices": speech_voices,
|
|
435
|
+
},
|
|
436
|
+
}
|
|
437
|
+
],
|
|
438
|
+
},
|
|
439
|
+
)
|
|
440
|
+
return
|
|
441
|
+
sidecar_http.send_json_response(
|
|
442
|
+
self, HTTPStatus.NOT_FOUND, {"error": {"message": "not found"}}
|
|
443
|
+
)
|
|
444
|
+
|
|
445
|
+
def do_POST(self) -> None: # noqa: N802
|
|
446
|
+
path = urllib.parse.urlsplit(self.path).path
|
|
447
|
+
if path != "/v1/audio/speech":
|
|
448
|
+
sidecar_http.send_json_response(
|
|
449
|
+
self, HTTPStatus.NOT_FOUND, {"error": {"message": "not found"}}
|
|
450
|
+
)
|
|
451
|
+
return
|
|
452
|
+
length = int(self.headers.get("Content-Length") or "0")
|
|
453
|
+
raw = self.rfile.read(length) if length > 0 else b"{}"
|
|
454
|
+
try:
|
|
455
|
+
payload = json.loads(raw.decode("utf-8"))
|
|
456
|
+
except (UnicodeDecodeError, ValueError):
|
|
457
|
+
sidecar_http.send_json_response(
|
|
458
|
+
self, HTTPStatus.BAD_REQUEST, {"error": {"message": "invalid JSON"}}
|
|
459
|
+
)
|
|
460
|
+
return
|
|
461
|
+
if not isinstance(payload, dict):
|
|
462
|
+
sidecar_http.send_json_response(
|
|
463
|
+
self, HTTPStatus.BAD_REQUEST, {"error": {"message": "invalid JSON object"}}
|
|
464
|
+
)
|
|
465
|
+
return
|
|
466
|
+
text = str(payload.get("input") or "")
|
|
467
|
+
if not text.strip():
|
|
468
|
+
sidecar_http.send_json_response(
|
|
469
|
+
self, HTTPStatus.BAD_REQUEST, {"error": {"message": "empty input"}}
|
|
470
|
+
)
|
|
471
|
+
return
|
|
472
|
+
voice = str(payload.get("voice") or tts_model.QWEN3_DEFAULT_VOICE).strip().lower()
|
|
473
|
+
if voice not in valid_voices:
|
|
474
|
+
sidecar_http.send_json_response(
|
|
475
|
+
self,
|
|
476
|
+
HTTPStatus.BAD_REQUEST,
|
|
477
|
+
{"error": {"message": f"unknown voice {voice!r}", "code": "unsupported_value"}},
|
|
478
|
+
)
|
|
479
|
+
return
|
|
480
|
+
if payload.get("instructions") and not supports_instr:
|
|
481
|
+
sidecar_http.send_json_response(
|
|
482
|
+
self,
|
|
483
|
+
HTTPStatus.BAD_REQUEST,
|
|
484
|
+
{
|
|
485
|
+
"error": {
|
|
486
|
+
"message": f"{served_model} does not take the option instructions",
|
|
487
|
+
"code": "unsupported_parameter",
|
|
488
|
+
}
|
|
489
|
+
},
|
|
490
|
+
)
|
|
491
|
+
return
|
|
492
|
+
pcm_bytes, _count = _synth_tone_pcm(text, sample_rate)
|
|
493
|
+
fmt = str(payload.get("response_format") or "pcm").lower()
|
|
494
|
+
if fmt == "wav":
|
|
495
|
+
wav = sidecar_http.wrap_pcm16_wav(pcm_bytes, sample_rate)
|
|
496
|
+
sidecar_http.send_binary_response(
|
|
497
|
+
self, HTTPStatus.OK, wav, content_type="audio/wav"
|
|
498
|
+
)
|
|
499
|
+
return
|
|
500
|
+
_send_chunked_pcm(self, pcm_bytes, step=4096)
|
|
501
|
+
|
|
502
|
+
return Qwen3TtsStubHandler
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
def _make_tts_handler(served_model: str, engine_mode: str) -> type[BaseHTTPRequestHandler]:
|
|
506
|
+
if engine_mode in ("tts-qwen3", "tts-speech.cpp"):
|
|
507
|
+
return _make_qwen3_tts_handler(served_model)
|
|
508
|
+
is_moss = engine_mode in ("tts-moss", "tts-onnxruntime")
|
|
509
|
+
if is_moss:
|
|
510
|
+
engine_name = "onnxruntime"
|
|
511
|
+
sample_rate = tts_worker_moss.DEFAULT_SAMPLE_RATE
|
|
512
|
+
else:
|
|
513
|
+
engine_name = (
|
|
514
|
+
"sherpa-onnx" if engine_mode == "tts-kokoro" else engine_mode.removeprefix("tts-")
|
|
515
|
+
)
|
|
516
|
+
sample_rate = tts_worker_kokoro.DEFAULT_SAMPLE_RATE
|
|
517
|
+
|
|
518
|
+
def _sim_pcm(text: str, speed: float) -> tuple[bytes, int]:
|
|
519
|
+
return _synth_tone_pcm(text, sample_rate, speed)
|
|
520
|
+
|
|
521
|
+
class TtsStubHandler(BaseHTTPRequestHandler):
|
|
522
|
+
protocol_version = "HTTP/1.1"
|
|
523
|
+
|
|
524
|
+
def log_message(self, format: str, *args: object) -> None: # noqa: A002
|
|
525
|
+
_ = (format, args)
|
|
526
|
+
|
|
527
|
+
def do_GET(self) -> None: # noqa: N802
|
|
528
|
+
path = urllib.parse.urlsplit(self.path).path
|
|
529
|
+
if path == "/health":
|
|
530
|
+
sidecar_http.send_json_response(
|
|
531
|
+
self,
|
|
532
|
+
HTTPStatus.OK,
|
|
533
|
+
{
|
|
534
|
+
"status": "ok",
|
|
535
|
+
"engine": engine_name,
|
|
536
|
+
"model": served_model,
|
|
537
|
+
"sample_rate": sample_rate,
|
|
538
|
+
"simulated": True,
|
|
539
|
+
},
|
|
540
|
+
)
|
|
541
|
+
return
|
|
542
|
+
if path == "/voices":
|
|
543
|
+
voices = (
|
|
544
|
+
tts_worker_moss.moss_voice_list()
|
|
545
|
+
if is_moss
|
|
546
|
+
else tts_worker_kokoro.kokoro_voice_list()
|
|
547
|
+
)
|
|
548
|
+
sidecar_http.send_json_response(self, HTTPStatus.OK, {"voices": voices})
|
|
549
|
+
return
|
|
550
|
+
sidecar_http.send_json_response(
|
|
551
|
+
self, HTTPStatus.NOT_FOUND, {"error": {"message": "not found"}}
|
|
552
|
+
)
|
|
553
|
+
|
|
554
|
+
def do_POST(self) -> None: # noqa: N802
|
|
555
|
+
path = urllib.parse.urlsplit(self.path).path
|
|
556
|
+
if path not in ("/synthesize", "/synthesize-stream"):
|
|
557
|
+
sidecar_http.send_json_response(
|
|
558
|
+
self, HTTPStatus.NOT_FOUND, {"error": {"message": "not found"}}
|
|
559
|
+
)
|
|
560
|
+
return
|
|
561
|
+
length = int(self.headers.get("Content-Length") or "0")
|
|
562
|
+
raw = self.rfile.read(length) if length > 0 else b"{}"
|
|
563
|
+
try:
|
|
564
|
+
payload = json.loads(raw.decode("utf-8"))
|
|
565
|
+
except (UnicodeDecodeError, ValueError):
|
|
566
|
+
sidecar_http.send_json_response(
|
|
567
|
+
self, HTTPStatus.BAD_REQUEST, {"error": {"message": "invalid JSON"}}
|
|
568
|
+
)
|
|
569
|
+
return
|
|
570
|
+
text = str(payload.get("text") or "") if isinstance(payload, dict) else ""
|
|
571
|
+
if not text.strip():
|
|
572
|
+
sidecar_http.send_json_response(
|
|
573
|
+
self, HTTPStatus.BAD_REQUEST, {"error": {"message": "empty text"}}
|
|
574
|
+
)
|
|
575
|
+
return
|
|
576
|
+
raw_voice = str(payload.get("voice") or "") if isinstance(payload, dict) else ""
|
|
577
|
+
if is_moss:
|
|
578
|
+
try:
|
|
579
|
+
voice = tts_worker_moss.resolve_voice(raw_voice)
|
|
580
|
+
except ValueError as exc:
|
|
581
|
+
sidecar_http.send_json_response(
|
|
582
|
+
self, HTTPStatus.BAD_REQUEST, {"error": {"message": str(exc)}}
|
|
583
|
+
)
|
|
584
|
+
return
|
|
585
|
+
else:
|
|
586
|
+
voice = raw_voice or tts_worker_kokoro.DEFAULT_VOICE
|
|
587
|
+
speed = float(payload.get("speed") or 1.0)
|
|
588
|
+
pcm_bytes, count = _sim_pcm(text, speed)
|
|
589
|
+
if path == "/synthesize-stream":
|
|
590
|
+
step = max(2, ((len(pcm_bytes) // 3) // 2) * 2)
|
|
591
|
+
_send_chunked_pcm(
|
|
592
|
+
self,
|
|
593
|
+
pcm_bytes,
|
|
594
|
+
step=step,
|
|
595
|
+
extra_headers={"X-Sample-Rate": str(sample_rate), "X-Voice": voice},
|
|
596
|
+
)
|
|
597
|
+
return
|
|
598
|
+
sidecar_http.send_binary_response(
|
|
599
|
+
self,
|
|
600
|
+
HTTPStatus.OK,
|
|
601
|
+
pcm_bytes,
|
|
602
|
+
content_type="audio/pcm",
|
|
603
|
+
extra_headers={
|
|
604
|
+
"X-Sample-Rate": str(sample_rate),
|
|
605
|
+
"X-Audio-Seconds": f"{count / float(sample_rate):.3f}",
|
|
606
|
+
"X-Voice": voice,
|
|
607
|
+
},
|
|
608
|
+
)
|
|
609
|
+
|
|
610
|
+
return TtsStubHandler
|
|
611
|
+
|
|
612
|
+
|
|
351
613
|
def main(argv: list[str] | None = None) -> int:
|
|
352
614
|
parser = argparse.ArgumentParser(description="Simulated localmodels inference endpoint")
|
|
353
615
|
parser.add_argument("--bind", default="127.0.0.1")
|
|
@@ -355,15 +617,26 @@ def main(argv: list[str] | None = None) -> int:
|
|
|
355
617
|
parser.add_argument("--model", required=True)
|
|
356
618
|
parser.add_argument(
|
|
357
619
|
"--mode",
|
|
358
|
-
choices=(
|
|
620
|
+
choices=(
|
|
621
|
+
"llm",
|
|
622
|
+
"speech-whisper",
|
|
623
|
+
"speech-sensevoice",
|
|
624
|
+
"speech-qwen3-asr",
|
|
625
|
+
"tts-kokoro",
|
|
626
|
+
"tts-moss",
|
|
627
|
+
"tts-qwen3",
|
|
628
|
+
"tts-onnxruntime",
|
|
629
|
+
"tts-speech.cpp",
|
|
630
|
+
),
|
|
359
631
|
default="llm",
|
|
360
632
|
)
|
|
361
633
|
args = parser.parse_args(argv)
|
|
362
|
-
|
|
363
|
-
_make_handler(args.model)
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
634
|
+
if args.mode == "llm":
|
|
635
|
+
handler = _make_handler(args.model)
|
|
636
|
+
elif args.mode.startswith("tts-"):
|
|
637
|
+
handler = _make_tts_handler(args.model, args.mode)
|
|
638
|
+
else:
|
|
639
|
+
handler = _make_speech_handler(args.model, args.mode)
|
|
367
640
|
server = ThreadingHTTPServer((args.bind, args.port), handler)
|
|
368
641
|
server.daemon_threads = True
|
|
369
642
|
signal.signal(signal.SIGTERM, lambda *_a: sys.exit(0))
|
|
@@ -429,6 +429,82 @@
|
|
|
429
429
|
"811882f6df81c8ea204a5d382f196d6bd601245091786912d4c70df41cdfa052": {
|
|
430
430
|
"repo": "unsloth/gemma-4-26B-A4B-it-GGUF",
|
|
431
431
|
"path": "gemma-4-26B-A4B-it-UD-Q3_K_M.gguf"
|
|
432
|
+
},
|
|
433
|
+
"acc4adc175b9d9986106cd20060329673ad5a2e12ef3c557d2d3745b694f8b38": {
|
|
434
|
+
"repo": "HZZSCIENCE/kokoro-multi-lang-v1_1",
|
|
435
|
+
"path": "model.onnx"
|
|
436
|
+
},
|
|
437
|
+
"e64a5a581d8c2a350d848f51c3121657cd83aa07ed6109172177345874a7244c": {
|
|
438
|
+
"repo": "HZZSCIENCE/kokoro-multi-lang-v1_1",
|
|
439
|
+
"path": "voices.bin"
|
|
440
|
+
},
|
|
441
|
+
"931ab2df2400cd65d580a22402024c2347ced8ae9ea300e545144b1aacc48e14": {
|
|
442
|
+
"repo": "HZZSCIENCE/kokoro-multi-lang-v1_1",
|
|
443
|
+
"path": "tokens.txt"
|
|
444
|
+
},
|
|
445
|
+
"7daaab53a181be9885b853a8582bf1838186317e5dadacbcef9c426d6fa0da14": {
|
|
446
|
+
"repo": "HZZSCIENCE/kokoro-multi-lang-v1_1",
|
|
447
|
+
"path": "lexicon-us-en.txt"
|
|
448
|
+
},
|
|
449
|
+
"c4cbb37316f62210dff52718a7afcaae24f50c032cc75ab47ae67b831d1049e7": {
|
|
450
|
+
"repo": "HZZSCIENCE/kokoro-multi-lang-v1_1",
|
|
451
|
+
"path": "lexicon-gb-en.txt"
|
|
452
|
+
},
|
|
453
|
+
"11111d8cd695fba2ace1367a1d0a708b586e6ef5c1f9be91da5d7eef129b651c": {
|
|
454
|
+
"repo": "HZZSCIENCE/kokoro-multi-lang-v1_1",
|
|
455
|
+
"path": "lexicon-zh.txt"
|
|
456
|
+
},
|
|
457
|
+
"eb8aa079ae3cb81d8f4404992f39d61a0cb990947512b5b8d1e54d1f6980e718": {
|
|
458
|
+
"repo": "HZZSCIENCE/kokoro-multi-lang-v1_1",
|
|
459
|
+
"path": "date-zh.fst"
|
|
460
|
+
},
|
|
461
|
+
"743f402181fcfebf76cc2f0546b71fa26476e626fbe4e460fb7b4c3a7a8bd5bd": {
|
|
462
|
+
"repo": "HZZSCIENCE/kokoro-multi-lang-v1_1",
|
|
463
|
+
"path": "number-zh.fst"
|
|
464
|
+
},
|
|
465
|
+
"1ac2b6fa56b1442320c4de7db08353bab8963a2b57f365eebcdd3a2d3562f8d7": {
|
|
466
|
+
"repo": "HZZSCIENCE/kokoro-multi-lang-v1_1",
|
|
467
|
+
"path": "phone-zh.fst"
|
|
468
|
+
},
|
|
469
|
+
"d56126dcd0574c2f15d98fc6b35eda68d0386b5bd9c5e38e28548d6f2ea8f3db": {
|
|
470
|
+
"repo": "openmoss/MOSS-TTS-Nano-100M-ONNX",
|
|
471
|
+
"path": "moss_tts_prefill.onnx"
|
|
472
|
+
},
|
|
473
|
+
"698cbc2fc1c2feca16e5895614ed52bbb32ded10f236c076f477b2e69abf32d8": {
|
|
474
|
+
"repo": "openmoss/MOSS-TTS-Nano-100M-ONNX",
|
|
475
|
+
"path": "moss_tts_decode_step.onnx"
|
|
476
|
+
},
|
|
477
|
+
"40cdb00efc171c450cf91468e01429caa41b0252222cd308e978f58fe354afa8": {
|
|
478
|
+
"repo": "openmoss/MOSS-TTS-Nano-100M-ONNX",
|
|
479
|
+
"path": "moss_tts_local_fixed_sampled_frame.onnx"
|
|
480
|
+
},
|
|
481
|
+
"bce8312c3df6a44545302cae229b61054fe0672e0b252ba59cba47adeed831dc": {
|
|
482
|
+
"repo": "openmoss/MOSS-TTS-Nano-100M-ONNX",
|
|
483
|
+
"path": "moss_tts_global_shared.data"
|
|
484
|
+
},
|
|
485
|
+
"bae7782032c0fb12490ab42afe009f87ae6c75a0f0596fc7b5c08e4d5ee93916": {
|
|
486
|
+
"repo": "openmoss/MOSS-TTS-Nano-100M-ONNX",
|
|
487
|
+
"path": "moss_tts_local_shared.data"
|
|
488
|
+
},
|
|
489
|
+
"c353ee1479b536bf414c1b247f5542b6607fb8ae91320e5af1781fee200fddff": {
|
|
490
|
+
"repo": "openmoss/MOSS-TTS-Nano-100M-ONNX",
|
|
491
|
+
"path": "tokenizer.model"
|
|
492
|
+
},
|
|
493
|
+
"9527c86a29e1837edec1f74db57d5eeaadb3a715af3382703566460afed25855": {
|
|
494
|
+
"repo": "openmoss/MOSS-Audio-Tokenizer-Nano-ONNX",
|
|
495
|
+
"path": "moss_audio_tokenizer_decode_step.onnx"
|
|
496
|
+
},
|
|
497
|
+
"e69d52e0f4e84ca27850557ee54face46632d3a5a16c89bd246c7c408466dcad": {
|
|
498
|
+
"repo": "openmoss/MOSS-Audio-Tokenizer-Nano-ONNX",
|
|
499
|
+
"path": "moss_audio_tokenizer_decode_shared.data"
|
|
500
|
+
},
|
|
501
|
+
"f606ea3981aa42762b16db9a94826d2d560eb60f0b102001618f40d5a2f78cc6": {
|
|
502
|
+
"repo": "sakasegawa/Qwen3-TTS-12Hz-0.6B-CustomVoice-GGUF",
|
|
503
|
+
"path": "Qwen3-TTS-12Hz-0.6B-CustomVoice-Q8_0.gguf"
|
|
504
|
+
},
|
|
505
|
+
"1bc0ef69547c003507b6536639a6080c8856382f4d0963b15d4475528330592d": {
|
|
506
|
+
"repo": "sakasegawa/Qwen3-TTS-12Hz-1.7B-CustomVoice-GGUF",
|
|
507
|
+
"path": "Qwen3-TTS-12Hz-1.7B-CustomVoice-Q8_0.gguf"
|
|
432
508
|
}
|
|
433
509
|
},
|
|
434
510
|
"unmirrored": {
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schema": "localmodels.engine-lock/v1",
|
|
3
|
+
"tag": "speechcpp-v0.11.3",
|
|
4
|
+
"commit": "d4b53e6091d28e0f127e718aec06eaa433f407dd",
|
|
5
|
+
"source": "https://github.com/nyosegawa/speech.cpp/releases/tag/v0.11.3",
|
|
6
|
+
"note": "speech.cpp v0.11.3 (MIT License, C API 4.3, commit d4b53e6091d28e0f127e718aec06eaa433f407dd). All four archive digests and byte sizes are verified against the upstream GitHub release SHA256SUMS and downloaded archives (2026-12-01). Linux x64 CPU (speech + libspeech.so.4) and Linux x64 Vulkan builds import at most GLIBC_2.34 and do not link libgomp.so.1; the Linux Vulkan build links libvulkan.so.1 and supports NVIDIA/AMD/Intel Vulkan GPUs plus --device cpu fallback. macOS arm64 Metal (speech + libspeech.4.dylib) links system Metal/Accelerate frameworks and also supports --device cpu fallback. Upstream v0.11.3 ships no separate win32/x64/cpu archive: speech-0.11.3-windows-x64-vulkan.zip (speech.exe + speech.dll, static CRT) directly imports vulkan-1.dll and runs both Vulkan GPU and --device cpu fallback on Windows hosts with a Vulkan loader. Linux arm64, macOS x64, and Windows arm64 have no upstream v0.11.3 release archives.",
|
|
7
|
+
"builds": [
|
|
8
|
+
{
|
|
9
|
+
"platform": "linux",
|
|
10
|
+
"arch": "x64",
|
|
11
|
+
"backend": "cpu",
|
|
12
|
+
"min_glibc": "2.34",
|
|
13
|
+
"binary": "speech",
|
|
14
|
+
"assets": [
|
|
15
|
+
{
|
|
16
|
+
"name": "speech-0.11.3-linux-x64-cpu.zip",
|
|
17
|
+
"url": "https://github.com/nyosegawa/speech.cpp/releases/download/v0.11.3/speech-0.11.3-linux-x64-cpu.zip",
|
|
18
|
+
"sha256": "d81f9fb74fe585efb6a4e03ae1e55fe8e9fa81f30ed38311583b5f8953993c15",
|
|
19
|
+
"size_bytes": 6497445,
|
|
20
|
+
"npm_copy": {
|
|
21
|
+
"package": "@simplexai/engine-speech-0.11.3-linux-x64-cpu",
|
|
22
|
+
"version": "0.0.0-sha256-d81f9fb74fe585ef"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"platform": "linux",
|
|
29
|
+
"arch": "x64",
|
|
30
|
+
"backend": "vulkan",
|
|
31
|
+
"min_glibc": "2.34",
|
|
32
|
+
"binary": "speech",
|
|
33
|
+
"assets": [
|
|
34
|
+
{
|
|
35
|
+
"name": "speech-0.11.3-linux-x64-vulkan.zip",
|
|
36
|
+
"url": "https://github.com/nyosegawa/speech.cpp/releases/download/v0.11.3/speech-0.11.3-linux-x64-vulkan.zip",
|
|
37
|
+
"sha256": "29f52d271c2f475e98b38679aebc03d493394912bbd09f24b9d49818ab6cee81",
|
|
38
|
+
"size_bytes": 32735417,
|
|
39
|
+
"npm_copy": {
|
|
40
|
+
"package": "@simplexai/engine-speech-0.11.3-linux-x64-vulkan",
|
|
41
|
+
"version": "0.0.0-sha256-29f52d271c2f475e"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"platform": "darwin",
|
|
48
|
+
"arch": "arm64",
|
|
49
|
+
"backend": "metal",
|
|
50
|
+
"binary": "speech",
|
|
51
|
+
"assets": [
|
|
52
|
+
{
|
|
53
|
+
"name": "speech-0.11.3-macos-arm64-metal.zip",
|
|
54
|
+
"url": "https://github.com/nyosegawa/speech.cpp/releases/download/v0.11.3/speech-0.11.3-macos-arm64-metal.zip",
|
|
55
|
+
"sha256": "0131a19b33324603c30598125fa09a9e3a30ad3db3930575a87f075dccee7c4d",
|
|
56
|
+
"size_bytes": 6290980,
|
|
57
|
+
"npm_copy": {
|
|
58
|
+
"package": "@simplexai/engine-speech-0.11.3-macos-arm64-metal",
|
|
59
|
+
"version": "0.0.0-sha256-0131a19b33324603"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"platform": "win32",
|
|
66
|
+
"arch": "x64",
|
|
67
|
+
"backend": "vulkan",
|
|
68
|
+
"binary": "speech.exe",
|
|
69
|
+
"assets": [
|
|
70
|
+
{
|
|
71
|
+
"name": "speech-0.11.3-windows-x64-vulkan.zip",
|
|
72
|
+
"url": "https://github.com/nyosegawa/speech.cpp/releases/download/v0.11.3/speech-0.11.3-windows-x64-vulkan.zip",
|
|
73
|
+
"sha256": "a62eb1f137626fca98c50a9d44129363299149776732e65b2631c66814e1f865",
|
|
74
|
+
"size_bytes": 29738369,
|
|
75
|
+
"npm_copy": {
|
|
76
|
+
"package": "@simplexai/engine-speech-0.11.3-windows-x64-vulkan",
|
|
77
|
+
"version": "0.0.0-sha256-a62eb1f137626fca"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"version": "0.11.3"
|
|
84
|
+
}
|
|
@@ -39,6 +39,7 @@ from localmodels import (
|
|
|
39
39
|
stack_lifecycle,
|
|
40
40
|
stack_ports,
|
|
41
41
|
stack_warm,
|
|
42
|
+
tts_state,
|
|
42
43
|
)
|
|
43
44
|
from localmodels.library_elastic import ElasticPlan, ElasticRoomError
|
|
44
45
|
from localmodels.library_model import LibraryError, LoadStep, Row, problem_from_error, progress
|
|
@@ -379,6 +380,11 @@ def demote_speech_if_holding_pool(state_dir: Path | None, pool_id: str) -> bool:
|
|
|
379
380
|
return speech_admission.demote_speech_if_holding_pool(state_dir, pool_id)
|
|
380
381
|
|
|
381
382
|
|
|
383
|
+
def demote_tts_if_holding_pool(state_dir: Path | None, pool_id: str) -> bool:
|
|
384
|
+
"""Demote a running TTS sidecar (RANK 3) to CPU when it holds memory on ``pool_id``."""
|
|
385
|
+
return tts_state.demote_if_holding_pool(state_dir, pool_id, reason="yielded_to_llm")
|
|
386
|
+
|
|
387
|
+
|
|
382
388
|
def _serve_elastic_plan(
|
|
383
389
|
model: Model,
|
|
384
390
|
record: Record,
|
|
@@ -389,7 +395,7 @@ def _serve_elastic_plan(
|
|
|
389
395
|
*,
|
|
390
396
|
use_jinja: bool,
|
|
391
397
|
) -> tuple[HostFacts, ElasticPlan]:
|
|
392
|
-
"""Price the elastic plan for ``_serve``, demoting
|
|
398
|
+
"""Price the elastic plan for ``_serve``, demoting TTS (RANK 3) then STT (RANK 2) when tight."""
|
|
393
399
|
|
|
394
400
|
def price(seen: HostFacts) -> ElasticPlan:
|
|
395
401
|
now = memory_pools.live(seen, _reserved(model.id))
|
|
@@ -409,15 +415,15 @@ def _serve_elastic_plan(
|
|
|
409
415
|
try:
|
|
410
416
|
elastic = price(facts)
|
|
411
417
|
except deploy.AgentMemoryError as exc:
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
raise _fail(record, _no_room_error(model,
|
|
418
|
+
last_exc: deploy.AgentMemoryError = exc
|
|
419
|
+
for demoter in (demote_tts_if_holding_pool, demote_speech_if_holding_pool):
|
|
420
|
+
if demoter(hosts.state_dir(), record["pool"]):
|
|
421
|
+
fresh = library_jobs.probe()
|
|
422
|
+
try:
|
|
423
|
+
return fresh, price(fresh)
|
|
424
|
+
except deploy.AgentMemoryError as retry_exc:
|
|
425
|
+
last_exc = retry_exc
|
|
426
|
+
raise _fail(record, _no_room_error(model, last_exc, record["pool"], failed=True)) from None
|
|
421
427
|
except engines.CudaDriverError as exc:
|
|
422
428
|
raise LibraryError("DRIVER_UPDATE_REQUIRED", str(exc), failed=True) from None
|
|
423
429
|
except engines.EngineUnavailableError as exc:
|
|
@@ -438,11 +444,17 @@ def _serve_elastic_plan(
|
|
|
438
444
|
can_force=False,
|
|
439
445
|
),
|
|
440
446
|
) from None
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
447
|
+
current_facts = facts
|
|
448
|
+
for demoter in (demote_tts_if_holding_pool, demote_speech_if_holding_pool):
|
|
449
|
+
if not elastic.degraded:
|
|
450
|
+
break
|
|
451
|
+
if demoter(hosts.state_dir(), record["pool"]):
|
|
452
|
+
fresh = library_jobs.probe()
|
|
453
|
+
with contextlib.suppress(
|
|
454
|
+
deploy.AgentMemoryError, library_pricing.LiveMemoryUnavailable
|
|
455
|
+
):
|
|
456
|
+
current_facts, elastic = fresh, price(fresh)
|
|
457
|
+
return current_facts, elastic
|
|
446
458
|
|
|
447
459
|
|
|
448
460
|
def _serve(
|
|
@@ -641,20 +653,28 @@ def _admit(
|
|
|
641
653
|
try:
|
|
642
654
|
elastic = _room(facts, model, record, freed, force=ctx.force, ctx=ctx.ctx_override)
|
|
643
655
|
except LibraryError as exc:
|
|
644
|
-
if exc.code
|
|
645
|
-
|
|
646
|
-
|
|
656
|
+
if exc.code != "LOAD_NO_ROOM":
|
|
657
|
+
raise
|
|
658
|
+
last_room_err = exc
|
|
659
|
+
for demoter in (demote_tts_if_holding_pool, demote_speech_if_holding_pool):
|
|
660
|
+
if demoter(hosts.state_dir(), record["pool"]):
|
|
661
|
+
fresh = library_jobs.probe()
|
|
662
|
+
try:
|
|
663
|
+
_room(fresh, model, record, freed, force=ctx.force, ctx=ctx.ctx_override)
|
|
664
|
+
cast(dict[str, object], facts).clear()
|
|
665
|
+
facts.update(fresh)
|
|
666
|
+
return
|
|
667
|
+
except LibraryError as retry_err:
|
|
668
|
+
last_room_err = retry_err
|
|
669
|
+
raise last_room_err from None
|
|
670
|
+
for demoter in (demote_tts_if_holding_pool, demote_speech_if_holding_pool):
|
|
671
|
+
if not elastic.degraded:
|
|
672
|
+
break
|
|
673
|
+
if demoter(hosts.state_dir(), record["pool"]):
|
|
647
674
|
fresh = library_jobs.probe()
|
|
648
|
-
_room(fresh, model, record, freed, force=ctx.force, ctx=ctx.ctx_override)
|
|
675
|
+
elastic = _room(fresh, model, record, freed, force=ctx.force, ctx=ctx.ctx_override)
|
|
649
676
|
cast(dict[str, object], facts).clear()
|
|
650
677
|
facts.update(fresh)
|
|
651
|
-
return
|
|
652
|
-
raise
|
|
653
|
-
if elastic.degraded and demote_speech_if_holding_pool(hosts.state_dir(), record["pool"]):
|
|
654
|
-
fresh = library_jobs.probe()
|
|
655
|
-
_room(fresh, model, record, freed, force=ctx.force, ctx=ctx.ctx_override)
|
|
656
|
-
cast(dict[str, object], facts).clear()
|
|
657
|
-
facts.update(fresh)
|
|
658
678
|
|
|
659
679
|
|
|
660
680
|
def _row(model: Model, base_dir: str) -> Row:
|
|
@@ -462,7 +462,7 @@ def _relative(name: str) -> str:
|
|
|
462
462
|
|
|
463
463
|
|
|
464
464
|
def _unzip(archive: str, directory: str, members: tuple[str, ...] = ()) -> None:
|
|
465
|
-
"""
|
|
465
|
+
"""Release zip: regular files only, each kept inside ``directory`` with safe execute bits."""
|
|
466
466
|
with zipfile.ZipFile(archive) as bundle:
|
|
467
467
|
names = [_relative(i.filename.replace("\\", "/")) for i in bundle.infolist()]
|
|
468
468
|
tops = {n.split("/", 1)[0] for n in names if n}
|
|
@@ -472,7 +472,13 @@ def _unzip(archive: str, directory: str, members: tuple[str, ...] = ()) -> None:
|
|
|
472
472
|
name = name.split("/", 1)[1] if "/" in name else ""
|
|
473
473
|
if members and not name.startswith(members):
|
|
474
474
|
continue
|
|
475
|
-
if
|
|
475
|
+
if (
|
|
476
|
+
not name
|
|
477
|
+
or info.is_dir()
|
|
478
|
+
or name.endswith("/")
|
|
479
|
+
or name.startswith("/")
|
|
480
|
+
or ".." in name.split("/")
|
|
481
|
+
):
|
|
476
482
|
continue
|
|
477
483
|
if ":" in name or (info.external_attr >> 16) & 0o170000 == 0o120000:
|
|
478
484
|
continue # a drive letter or a symlink entry
|
|
@@ -480,6 +486,10 @@ def _unzip(archive: str, directory: str, members: tuple[str, ...] = ()) -> None:
|
|
|
480
486
|
os.makedirs(os.path.dirname(target), exist_ok=True)
|
|
481
487
|
with bundle.open(info) as source, open(target, "wb") as dest:
|
|
482
488
|
shutil.copyfileobj(source, dest)
|
|
489
|
+
if os.name == "posix":
|
|
490
|
+
unix_mode = (info.external_attr >> 16) & 0o777
|
|
491
|
+
if unix_mode & 0o111:
|
|
492
|
+
os.chmod(target, (unix_mode & 0o755) | 0o700)
|
|
483
493
|
|
|
484
494
|
|
|
485
495
|
def unpack(archive: str, directory: str, keep: tuple[str, ...] = ()) -> None:
|