smartvoice 0.2.0__tar.gz

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 (197) hide show
  1. smartvoice-0.2.0/LICENSE +201 -0
  2. smartvoice-0.2.0/MANIFEST.in +6 -0
  3. smartvoice-0.2.0/PKG-INFO +282 -0
  4. smartvoice-0.2.0/README.md +259 -0
  5. smartvoice-0.2.0/catalog/models.json +347 -0
  6. smartvoice-0.2.0/catalog/router.json +218 -0
  7. smartvoice-0.2.0/config/smartvoice.example.json +16 -0
  8. smartvoice-0.2.0/native/qwen3-tts/LICENSE +21 -0
  9. smartvoice-0.2.0/native/qwen3-tts/Makefile +1462 -0
  10. smartvoice-0.2.0/native/qwen3-tts/UPSTREAM.md +34 -0
  11. smartvoice-0.2.0/native/qwen3-tts/bench_scalar.c +195 -0
  12. smartvoice-0.2.0/native/qwen3-tts/bench_simd.c +293 -0
  13. smartvoice-0.2.0/native/qwen3-tts/main.c +3377 -0
  14. smartvoice-0.2.0/native/qwen3-tts/qwen_flag_scope.h +238 -0
  15. smartvoice-0.2.0/native/qwen3-tts/qwen_json.c +259 -0
  16. smartvoice-0.2.0/native/qwen3-tts/qwen_json.h +32 -0
  17. smartvoice-0.2.0/native/qwen3-tts/qwen_tts.c +4630 -0
  18. smartvoice-0.2.0/native/qwen3-tts/qwen_tts.h +730 -0
  19. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_audio.c +216 -0
  20. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_audio.h +19 -0
  21. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_backend.c +261 -0
  22. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_backend.h +48 -0
  23. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_batch.h +70 -0
  24. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_code_predictor.c +1728 -0
  25. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_compose.c +419 -0
  26. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_compose.h +37 -0
  27. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_costmap.c +373 -0
  28. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_costmap.h +243 -0
  29. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_cuda.c +206 -0
  30. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_cuda.h +53 -0
  31. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_dispatch.c +786 -0
  32. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_emotion.c +99 -0
  33. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_emotion.h +18 -0
  34. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_gguf.c +570 -0
  35. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_kernels.c +13687 -0
  36. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_kernels.h +599 -0
  37. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_kernels_avx.c +1 -0
  38. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_kernels_generic.c +1 -0
  39. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_kernels_impl.h +5 -0
  40. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_kernels_neon.c +1 -0
  41. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_kleidi.c +1254 -0
  42. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_kleidi.h +87 -0
  43. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_metal.h +85 -0
  44. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_q4export.c +179 -0
  45. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_q8repack.c +653 -0
  46. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_q8repack.h +34 -0
  47. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_sampling.c +152 -0
  48. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_sd_gemm.c +139 -0
  49. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_server.c +4227 -0
  50. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_server.h +32 -0
  51. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_speech_decoder.c +4970 -0
  52. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_speech_encoder.c +680 -0
  53. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_talker.c +3013 -0
  54. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_thread.c +910 -0
  55. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_thread.h +89 -0
  56. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_tokenizer.c +874 -0
  57. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_tokenizer.h +51 -0
  58. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_voice_clone.c +825 -0
  59. smartvoice-0.2.0/native/qwen3-tts/qwen_tts_voice_clone.h +59 -0
  60. smartvoice-0.2.0/native/qwen3-tts/qwen_windows_compat.h +31 -0
  61. smartvoice-0.2.0/native/qwen3-tts/test_decoder_standalone.c +86 -0
  62. smartvoice-0.2.0/native/qwen3-tts/third_party/ingot/LICENSE +21 -0
  63. smartvoice-0.2.0/native/qwen3-tts/third_party/ingot/Makefile +208 -0
  64. smartvoice-0.2.0/native/qwen3-tts/third_party/ingot/include/ingot/dtype.h +127 -0
  65. smartvoice-0.2.0/native/qwen3-tts/third_party/ingot/include/ingot/gguf.h +139 -0
  66. smartvoice-0.2.0/native/qwen3-tts/third_party/ingot/include/ingot/quant.h +210 -0
  67. smartvoice-0.2.0/native/qwen3-tts/third_party/ingot/include/ingot/safetensors.h +103 -0
  68. smartvoice-0.2.0/native/qwen3-tts/third_party/ingot/include/ingot/wfile.h +73 -0
  69. smartvoice-0.2.0/native/qwen3-tts/third_party/ingot/include/ingot/write.h +85 -0
  70. smartvoice-0.2.0/native/qwen3-tts/third_party/ingot/src/cpu.c +285 -0
  71. smartvoice-0.2.0/native/qwen3-tts/third_party/ingot/src/dequant.c +573 -0
  72. smartvoice-0.2.0/native/qwen3-tts/third_party/ingot/src/dequant_iq.c +377 -0
  73. smartvoice-0.2.0/native/qwen3-tts/third_party/ingot/src/dtype.c +501 -0
  74. smartvoice-0.2.0/native/qwen3-tts/third_party/ingot/src/generic.c +173 -0
  75. smartvoice-0.2.0/native/qwen3-tts/third_party/ingot/src/gguf.c +796 -0
  76. smartvoice-0.2.0/native/qwen3-tts/third_party/ingot/src/internal.h +146 -0
  77. smartvoice-0.2.0/native/qwen3-tts/third_party/ingot/src/iq_tables.inc +2176 -0
  78. smartvoice-0.2.0/native/qwen3-tts/third_party/ingot/src/kernels.c +3552 -0
  79. smartvoice-0.2.0/native/qwen3-tts/third_party/ingot/src/quantize.c +443 -0
  80. smartvoice-0.2.0/native/qwen3-tts/third_party/ingot/src/safetensors.c +823 -0
  81. smartvoice-0.2.0/native/qwen3-tts/third_party/ingot/src/wfile.c +164 -0
  82. smartvoice-0.2.0/native/qwen3-tts/third_party/ingot/src/write.c +510 -0
  83. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/NOTICE.md +18 -0
  84. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/kai_common.h +313 -0
  85. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/matmul_clamp_f32_bf16p_bf16p/kai_matmul_clamp_f32_bf16p1x4_bf16p12x4b_1x36_neon_dot.c +1630 -0
  86. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/matmul_clamp_f32_bf16p_bf16p/kai_matmul_clamp_f32_bf16p1x4_bf16p12x4b_1x36_neon_dot.h +123 -0
  87. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/matmul_clamp_f32_bf16p_bf16p/kai_matmul_clamp_f32_bf16p8x4_bf16p12x4b_8x12_neon_mmla.c +582 -0
  88. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/matmul_clamp_f32_bf16p_bf16p/kai_matmul_clamp_f32_bf16p8x4_bf16p12x4b_8x12_neon_mmla.h +122 -0
  89. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/matmul_clamp_f32_bf16p_bf16p/kai_matmul_clamp_f32_bf16p_bf16p_interface.h +51 -0
  90. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/matmul_clamp_f32_qai8dxp_qsi8cxp/kai_matmul_clamp_f32_qai8dxp1x4_qsi8cxp4x4_1x4_neon_dotprod.c +162 -0
  91. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/matmul_clamp_f32_qai8dxp_qsi8cxp/kai_matmul_clamp_f32_qai8dxp1x4_qsi8cxp4x4_1x4_neon_dotprod.h +137 -0
  92. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/matmul_clamp_f32_qai8dxp_qsi8cxp/kai_matmul_clamp_f32_qai8dxp1x4_qsi8cxp4x4_1x4_neon_dotprod_asm.S +153 -0
  93. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/matmul_clamp_f32_qai8dxp_qsi8cxp/kai_matmul_clamp_f32_qai8dxp1x8_qsi8cxp4x8_1x4_neon_dotprod.c +221 -0
  94. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/matmul_clamp_f32_qai8dxp_qsi8cxp/kai_matmul_clamp_f32_qai8dxp1x8_qsi8cxp4x8_1x4_neon_dotprod.h +137 -0
  95. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/matmul_clamp_f32_qai8dxp_qsi8cxp/kai_matmul_clamp_f32_qai8dxp4x4_qsi8cxp4x4_16x4_neon_dotprod.c +769 -0
  96. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/matmul_clamp_f32_qai8dxp_qsi8cxp/kai_matmul_clamp_f32_qai8dxp4x4_qsi8cxp4x4_16x4_neon_dotprod.h +137 -0
  97. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/matmul_clamp_f32_qai8dxp_qsi8cxp/kai_matmul_clamp_f32_qai8dxp4x8_qsi8cxp4x8_16x4_neon_i8mm.c +163 -0
  98. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/matmul_clamp_f32_qai8dxp_qsi8cxp/kai_matmul_clamp_f32_qai8dxp4x8_qsi8cxp4x8_16x4_neon_i8mm.h +137 -0
  99. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/matmul_clamp_f32_qai8dxp_qsi8cxp/kai_matmul_clamp_f32_qai8dxp4x8_qsi8cxp4x8_16x4_neon_i8mm_asm.S +657 -0
  100. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/matmul_clamp_f32_qai8dxp_qsi8cxp/kai_matmul_clamp_f32_qai8dxp_qsi8cxp_interface.h +52 -0
  101. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/matmul_clamp_f32_qsi8d32p_qsi4c32p/kai_matmul_clamp_f32_qsi8d32p1x8_qsi4c32p4x8_1x4x32_neon_dotprod.c +157 -0
  102. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/matmul_clamp_f32_qsi8d32p_qsi4c32p/kai_matmul_clamp_f32_qsi8d32p1x8_qsi4c32p4x8_1x4x32_neon_dotprod.h +143 -0
  103. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/matmul_clamp_f32_qsi8d32p_qsi4c32p/kai_matmul_clamp_f32_qsi8d32p1x8_qsi4c32p4x8_1x4x32_neon_dotprod_asm.S +153 -0
  104. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/matmul_clamp_f32_qsi8d32p_qsi4c32p/kai_matmul_clamp_f32_qsi8d32p4x8_qsi4c32p4x8_16x4_neon_i8mm.c +163 -0
  105. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/matmul_clamp_f32_qsi8d32p_qsi4c32p/kai_matmul_clamp_f32_qsi8d32p4x8_qsi4c32p4x8_16x4_neon_i8mm.h +144 -0
  106. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/matmul_clamp_f32_qsi8d32p_qsi4c32p/kai_matmul_clamp_f32_qsi8d32p4x8_qsi4c32p4x8_16x4_neon_i8mm_asm.S +701 -0
  107. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/matmul_clamp_f32_qsi8d32p_qsi4c32p/kai_matmul_clamp_f32_qsi8d32p_qsi4c32p_interface.h +54 -0
  108. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/pack/kai_lhs_quant_pack_bf16p1x4_f32_neon.c +123 -0
  109. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/pack/kai_lhs_quant_pack_bf16p1x4_f32_neon.h +80 -0
  110. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/pack/kai_lhs_quant_pack_bf16p8x4_f32_neon.c +216 -0
  111. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/pack/kai_lhs_quant_pack_bf16p8x4_f32_neon.h +80 -0
  112. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/pack/kai_lhs_quant_pack_qai8dxp_f32.c +268 -0
  113. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/pack/kai_lhs_quant_pack_qai8dxp_f32.h +77 -0
  114. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/pack/kai_lhs_quant_pack_qsi8d32p_f32.c +124 -0
  115. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/pack/kai_lhs_quant_pack_qsi8d32p_f32.h +84 -0
  116. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/pack/kai_rhs_pack_nxk_qsi4c32pscalef16_qsu4c32s16s0.c +158 -0
  117. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/pack/kai_rhs_pack_nxk_qsi4c32pscalef16_qsu4c32s16s0.h +118 -0
  118. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/pack/kai_rhs_pack_nxk_qsi8cxp_qsi8cx_neon.c +143 -0
  119. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/pack/kai_rhs_pack_nxk_qsi8cxp_qsi8cx_neon.h +103 -0
  120. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/pack/kai_rhs_quant_pack_kxn_bf16p12x4biasf32_f32_neon.c +480 -0
  121. smartvoice-0.2.0/native/qwen3-tts/third_party/kleidiai/kai/ukernels/matmul/pack/kai_rhs_quant_pack_kxn_bf16p12x4biasf32_f32_neon.h +85 -0
  122. smartvoice-0.2.0/native/qwen3-tts/vendor/lz4.c +2829 -0
  123. smartvoice-0.2.0/native/qwen3-tts/vendor/lz4.h +884 -0
  124. smartvoice-0.2.0/pyproject.toml +41 -0
  125. smartvoice-0.2.0/setup.cfg +4 -0
  126. smartvoice-0.2.0/setup.py +91 -0
  127. smartvoice-0.2.0/src/smartvoice/__init__.py +3 -0
  128. smartvoice-0.2.0/src/smartvoice/__main__.py +425 -0
  129. smartvoice-0.2.0/src/smartvoice/_version.py +3 -0
  130. smartvoice-0.2.0/src/smartvoice/adapters/__init__.py +1 -0
  131. smartvoice-0.2.0/src/smartvoice/adapters/inference/__init__.py +1 -0
  132. smartvoice-0.2.0/src/smartvoice/adapters/inference/composite_provider.py +122 -0
  133. smartvoice-0.2.0/src/smartvoice/adapters/inference/factory.py +26 -0
  134. smartvoice-0.2.0/src/smartvoice/adapters/inference/qwen_tts/__init__.py +1 -0
  135. smartvoice-0.2.0/src/smartvoice/adapters/inference/qwen_tts/native_runtime.py +215 -0
  136. smartvoice-0.2.0/src/smartvoice/adapters/inference/qwen_tts/provider.py +177 -0
  137. smartvoice-0.2.0/src/smartvoice/adapters/inference/sherpa_onnx/__init__.py +1 -0
  138. smartvoice-0.2.0/src/smartvoice/adapters/inference/sherpa_onnx/provider.py +528 -0
  139. smartvoice-0.2.0/src/smartvoice/adapters/platform/__init__.py +1 -0
  140. smartvoice-0.2.0/src/smartvoice/adapters/platform/host_metrics.py +161 -0
  141. smartvoice-0.2.0/src/smartvoice/adapters/storage/__init__.py +1 -0
  142. smartvoice-0.2.0/src/smartvoice/adapters/storage/catalog_model_repository.py +52 -0
  143. smartvoice-0.2.0/src/smartvoice/api/__init__.py +1 -0
  144. smartvoice-0.2.0/src/smartvoice/api/v1/__init__.py +1 -0
  145. smartvoice-0.2.0/src/smartvoice/api/v1/routes.py +410 -0
  146. smartvoice-0.2.0/src/smartvoice/app.py +423 -0
  147. smartvoice-0.2.0/src/smartvoice/ascii-art.txt +28 -0
  148. smartvoice-0.2.0/src/smartvoice/config/__init__.py +1 -0
  149. smartvoice-0.2.0/src/smartvoice/config/settings.py +115 -0
  150. smartvoice-0.2.0/src/smartvoice/domain/__init__.py +1 -0
  151. smartvoice-0.2.0/src/smartvoice/domain/capabilities.py +21 -0
  152. smartvoice-0.2.0/src/smartvoice/domain/contracts.py +54 -0
  153. smartvoice-0.2.0/src/smartvoice/domain/errors.py +68 -0
  154. smartvoice-0.2.0/src/smartvoice/domain/models.py +34 -0
  155. smartvoice-0.2.0/src/smartvoice/ports/__init__.py +1 -0
  156. smartvoice-0.2.0/src/smartvoice/ports/inference.py +56 -0
  157. smartvoice-0.2.0/src/smartvoice/ports/model_repository.py +33 -0
  158. smartvoice-0.2.0/src/smartvoice/resources/models.json +347 -0
  159. smartvoice-0.2.0/src/smartvoice/resources/router.json +218 -0
  160. smartvoice-0.2.0/src/smartvoice/resources/smartvoice-favicon.png +0 -0
  161. smartvoice-0.2.0/src/smartvoice/resources/smartvoice-logo.png +0 -0
  162. smartvoice-0.2.0/src/smartvoice/services/__init__.py +1 -0
  163. smartvoice-0.2.0/src/smartvoice/services/builtin_resources.py +16 -0
  164. smartvoice-0.2.0/src/smartvoice/services/file_integrity.py +76 -0
  165. smartvoice-0.2.0/src/smartvoice/services/host_metrics.py +9 -0
  166. smartvoice-0.2.0/src/smartvoice/services/inference_queue.py +82 -0
  167. smartvoice-0.2.0/src/smartvoice/services/language_detection.py +96 -0
  168. smartvoice-0.2.0/src/smartvoice/services/model_catalog_constants.py +8 -0
  169. smartvoice-0.2.0/src/smartvoice/services/model_download.py +339 -0
  170. smartvoice-0.2.0/src/smartvoice/services/model_jobs.py +89 -0
  171. smartvoice-0.2.0/src/smartvoice/services/model_local_state.py +64 -0
  172. smartvoice-0.2.0/src/smartvoice/services/model_management.py +59 -0
  173. smartvoice-0.2.0/src/smartvoice/services/model_registry.py +93 -0
  174. smartvoice-0.2.0/src/smartvoice/services/model_router.py +192 -0
  175. smartvoice-0.2.0/src/smartvoice/services/model_storage.py +372 -0
  176. smartvoice-0.2.0/src/smartvoice/services/speech.py +110 -0
  177. smartvoice-0.2.0/src/smartvoice/services/spoken_language_identifier.py +109 -0
  178. smartvoice-0.2.0/src/smartvoice/services/transcription.py +125 -0
  179. smartvoice-0.2.0/src/smartvoice/web/test.html +39 -0
  180. smartvoice-0.2.0/src/smartvoice.egg-info/PKG-INFO +282 -0
  181. smartvoice-0.2.0/src/smartvoice.egg-info/SOURCES.txt +195 -0
  182. smartvoice-0.2.0/src/smartvoice.egg-info/dependency_links.txt +1 -0
  183. smartvoice-0.2.0/src/smartvoice.egg-info/requires.txt +13 -0
  184. smartvoice-0.2.0/src/smartvoice.egg-info/top_level.txt +1 -0
  185. smartvoice-0.2.0/tests/test_api.py +746 -0
  186. smartvoice-0.2.0/tests/test_cli.py +94 -0
  187. smartvoice-0.2.0/tests/test_host_metrics.py +46 -0
  188. smartvoice-0.2.0/tests/test_inference_boundaries.py +129 -0
  189. smartvoice-0.2.0/tests/test_inference_queue.py +98 -0
  190. smartvoice-0.2.0/tests/test_language_detection.py +122 -0
  191. smartvoice-0.2.0/tests/test_model_catalog.py +261 -0
  192. smartvoice-0.2.0/tests/test_model_jobs.py +48 -0
  193. smartvoice-0.2.0/tests/test_model_router.py +130 -0
  194. smartvoice-0.2.0/tests/test_provider_contract.py +178 -0
  195. smartvoice-0.2.0/tests/test_real_inference.py +259 -0
  196. smartvoice-0.2.0/tests/test_settings.py +81 -0
  197. smartvoice-0.2.0/tests/test_spoken_language_identifier.py +58 -0
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,6 @@
1
+ include catalog/models.json
2
+ include catalog/router.json
3
+ include config/smartvoice.example.json
4
+ include native/qwen3-tts/LICENSE
5
+ include native/qwen3-tts/UPSTREAM.md
6
+ recursive-include native/qwen3-tts *.c *.h *.S *.inc Makefile LICENSE NOTICE.md
@@ -0,0 +1,282 @@
1
+ Metadata-Version: 2.4
2
+ Name: smartvoice
3
+ Version: 0.2.0
4
+ Summary: Local speech-to-text and text-to-speech service
5
+ Project-URL: Homepage, https://github.com/dxhome/SmartVoice
6
+ Project-URL: Repository, https://github.com/dxhome/SmartVoice
7
+ Project-URL: Issues, https://github.com/dxhome/SmartVoice/issues
8
+ Requires-Python: >=3.11
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Requires-Dist: fastapi<1.0,>=0.115
12
+ Requires-Dist: uvicorn<1.0,>=0.30
13
+ Requires-Dist: python-multipart<1.0,>=0.0.18
14
+ Requires-Dist: langid<2.0,>=1.1.6
15
+ Provides-Extra: inference
16
+ Requires-Dist: sherpa-onnx<2.0,>=1.13.8; extra == "inference"
17
+ Requires-Dist: numpy<3.0,>=1.26; extra == "inference"
18
+ Requires-Dist: av<19.0,>=12.0; extra == "inference"
19
+ Provides-Extra: dev
20
+ Requires-Dist: httpx<1.0,>=0.27; extra == "dev"
21
+ Requires-Dist: jiwer<5.0,>=4.0; extra == "dev"
22
+ Dynamic: license-file
23
+
24
+ <div align="center">
25
+ <img src="assets/smartvoice-logo.png" alt="SmartVoice logo" width="220">
26
+ <p><strong>Local speech recognition and synthesis, with language-aware model routing.</strong></p>
27
+ <p>Multilingual STT and TTS · CPU inference · OpenAPI · No per-request API fee</p>
28
+ </div>
29
+
30
+ # SmartVoice
31
+
32
+ SmartVoice is a local speech-to-text (STT) and text-to-speech (TTS) service. It offers both through one OpenAI-style audio API, with models installed and run on your machine.
33
+
34
+ ## Why SmartVoice?
35
+
36
+ - **One local service for speech:** Transcribe audio and synthesize speech through the same API, without sending media to a cloud provider.
37
+ - **Choose models by language automatically:** Use SmartVoice's virtual model IDs to route each request to an installed model configured for that language.
38
+ - **Works offline after setup:** Install model files once, then run inference locally on CPU with no per-request API fee.
39
+
40
+ ## Capabilities
41
+
42
+ | Area | Capability |
43
+ |---|---|
44
+ | Platforms | Windows x64 and macOS Apple Silicon, run from source |
45
+ | Inference | sherpa-onnx on Windows x64 and macOS Apple Silicon; native C INT8 Qwen3-TTS on macOS Apple Silicon and Windows x64 |
46
+ | STT | Whisper Base multilingual, SenseVoice Small, Qwen3-ASR 0.6B |
47
+ | TTS | Kokoro 1.1, Matcha Baker, Supertonic 3, Qwen3-TTS 0.6B |
48
+ | Smart routing | Selects an installed model by task and language using an editable priority list; `smartvoice-auto` works for both STT and TTS |
49
+ | API | OpenAPI docs, transcription, speech synthesis, model catalog and runtime status |
50
+ | Model management | Install, uninstall, offline import/export, and resumable downloads |
51
+ | Not yet supported | GPU inference, streaming, Linux/Android, remote access, packaged installers, MCP |
52
+
53
+ For the architecture principles, implementation overview, per-backend OS/architecture/device/build matrix, and the difference between installed models and inference availability, see [Architecture Summary and Guidelines](doc/architecture-guidelines.md).
54
+
55
+ SmartVoice supports a subset of OpenAI Audio API conventions; this is not a claim of full API compatibility. See the [API specification](doc/api-spec.md) for request and response details.
56
+
57
+ ## Smart routing
58
+
59
+ Smart routing selects an installed model using the request task, language, and an ordered, user-editable JSON table. Use `smartvoice-auto` for language-aware routing on either audio endpoint, or pass a concrete model ID to call that model directly.
60
+
61
+ TTS model priority order:
62
+
63
+ 1. Chinese: Qwen3-TTS → Matcha → Kokoro
64
+ 2. German, French, Spanish, Japanese, Korean: Supertonic → Qwen3-TTS
65
+ 3. English: Supertonic → Qwen3-TTS → Kokoro
66
+ 4. Portuguese, Russian, Italian: Supertonic → Qwen3-TTS
67
+ 5. Other supported languages: Supertonic
68
+
69
+ For STT, the built-in route table prioritizes SenseVoice for Chinese, English, Cantonese, Japanese, and Korean; Qwen3-ASR covers the remaining configured languages, with Whisper as a fallback for selected languages.
70
+
71
+ SmartVoice routes by the API endpoint and language:
72
+
73
+ | Request | Virtual model ID | Language source |
74
+ |---|---|---|
75
+ | Transcription | `smartvoice-auto` | Explicit `language`, or automatic detection when omitted or `auto` |
76
+ | Speech synthesis | `smartvoice-auto` | Explicit `language`, or text detection when omitted or `auto` |
77
+
78
+ The built-in route table is copied to `<data_dir>/router.json` on first startup. Edit it to customize model priorities, then apply changes without restarting:
79
+
80
+ ```bash
81
+ python -m smartvoice router reload
82
+ ```
83
+
84
+ The first installed and verified candidate is selected. An inference failure does not trigger a retry with the next candidate. See the [API specification](doc/api-spec.md) for request details.
85
+
86
+ ## Model catalog
87
+
88
+ Models use the inference adapter identified in the catalog. Language availability describes catalog capability, not comparative quality; model and voice licenses may differ from SmartVoice's license. The recommended STT models are SenseVoice and Qwen3-ASR. TTS recommendations are reflected in the [Smart routing](#smart-routing) priorities. Supertonic 3 does not support Chinese. Benchmark coverage varies by language, and TTS listening quality has not been rated with MOS.
89
+
90
+ | Model ID | Task | Languages / voices | Estimated model files | Recommendation |
91
+ |---|---|---|---|---|
92
+ | `stt-whisper-base-multilingual-int8` | STT | Auto detection; English, Chinese, Japanese, Korean, French, German | ~0.16 GB | — |
93
+ | `stt-sensevoice-small-int8` | STT | Chinese, English, Cantonese, Japanese, Korean | ~0.24 GB | Recommended |
94
+ | `stt-qwen3-asr-600m-int8` | STT | 30 language codes including Cantonese; automatic detection | ~0.99 GB | Recommended |
95
+ | `tts-kokoro-multilingual-v1-1-zh-en` | TTS | Chinese, English; 103 speakers | ~0.41 GB | Chinese / English fallback |
96
+ | `tts-matcha-zh-baker` | TTS | Chinese; one voice | ~0.13 GB | Chinese fallback |
97
+ | `tts-supertonic-v3-multilingual-int8` | TTS | 31 languages; no Chinese | ~0.15 GB | Recommended for its supported languages |
98
+ | `tts-qwen3-0-6b-customvoice` | TTS | 10 languages; 9 preset voices | ~2.50 GB | Recommended for Chinese and measured multilingual routes |
99
+
100
+ Catalog model sizes are estimates of the unpacked model files, rounded to two decimal places in decimal GB; actual disk use can vary slightly. The web test page shows the recorded on-disk size when available and otherwise labels the catalog estimate. Installation may need additional temporary space. Qwen3-TTS 0.6B needs at least 6 GiB free disk space during installation. See [`catalog/models.json`](catalog/models.json) for the byte estimates, exact language codes, sources, and model details.
101
+
102
+ Melo TTS has been removed from the supported catalog, and Supertonic 3 does not support Chinese. Existing model files are left on disk. If an older `<data_dir>/router.json` references the removed Melo model or routes Supertonic for Chinese, SmartVoice rejects that saved routing table, uses the built-in router, and reports a warning. Remove those stale entries and run `python -m smartvoice router reload` to clear the warning.
103
+
104
+ For routed STT requests with `language=auto`, SmartVoice uses the Whisper Tiny spoken-language detector when it is installed, then routes to an STT model for the detected language. `python -m smartvoice models install all` installs this detector by default. Without it, SmartVoice falls back to an installed STT model that supports automatic language detection. The detector is not downloaded during service startup. Its availability is reported by `/v1/capabilities`.
105
+
106
+ ## Quick start
107
+
108
+ SmartVoice requires Python 3.11 or newer and runs inference on CPU. The service binds to `127.0.0.1` by default.
109
+
110
+ ### 1. Install SmartVoice
111
+
112
+ From a source checkout, create a virtual environment and install the inference dependencies. Windows x64 source builds include the Qwen native runtime, so install the MSYS2 UCRT64 build tools described below before running `pip install`.
113
+
114
+ macOS:
115
+
116
+ ```bash
117
+ python3 -m venv .venv
118
+ source .venv/bin/activate
119
+ python -m pip install -e ".[inference]"
120
+ ```
121
+
122
+ Windows PowerShell:
123
+
124
+ ```powershell
125
+ python -m venv .venv
126
+ .\.venv\Scripts\python.exe -m pip install -e ".[inference]"
127
+ ```
128
+
129
+ Run these commands from the repository root. You do not need to activate the virtual environment. In the model and server commands below, replace `python` with `.\.venv\Scripts\python.exe` in Windows PowerShell.
130
+
131
+ On macOS Apple Silicon, the source install builds the native INT8 Qwen3-TTS runtime using Xcode Command Line Tools. On Windows x64, build the native runtime from the source checkout as described below.
132
+
133
+ #### Build the Qwen3-TTS runtime on Windows
134
+
135
+ The Windows source deployment builds Qwen3-TTS with MSYS2 UCRT64 GCC and OpenBLAS. Install MSYS2 and its UCRT64 toolchain packages in an elevated MSYS2 UCRT64 terminal before installing SmartVoice:
136
+
137
+ ```bash
138
+ pacman -S --needed make gcc diffutils mingw-w64-ucrt-x86_64-openblas
139
+ ```
140
+
141
+ Then, from the SmartVoice repository root in PowerShell, build the runtime into the source package and check that it starts:
142
+
143
+ ```powershell
144
+ # Omit this if MSYS2 is installed at C:\msys64 or %USERPROFILE%\msys64.
145
+ $env:SMARTVOICE_MSYS2_ROOT = "C:\msys64"
146
+ $env:SMARTVOICE_QWEN_OUTPUT = "$PWD\src\smartvoice\resources\bin"
147
+ .\.venv\Scripts\python.exe .\scripts\build_qwen3_tts_windows.py
148
+ ```
149
+
150
+ The build script runs the native runtime self-test and stages `qwen_tts.exe`, its required runtime DLLs, and license notices in `src/smartvoice/resources/bin` for the editable source checkout. The Windows package build also bundles the runtime in its build output. These generated binaries are local build artifacts and are not committed. If MSYS2 is installed elsewhere, set `SMARTVOICE_MSYS2_ROOT` to that directory. Python source installation remains editable; a SmartVoice wheel is not required.
151
+
152
+ ### 2. Download models
153
+
154
+ Install a basic STT and TTS model. Model files are downloaded once and stored outside the source checkout, under `~/Library/Application Support/SmartVoice` on macOS or `%LOCALAPPDATA%\SmartVoice` on Windows.
155
+
156
+ ```bash
157
+ python -m smartvoice models install stt-sensevoice-small-int8
158
+ python -m smartvoice models install tts-kokoro-multilingual-v1-1-zh-en
159
+ python -m smartvoice models install-language-id
160
+ ```
161
+
162
+ On macOS Apple Silicon and Windows x64 after building its native runtime, install Qwen3-TTS to use the configured Chinese and multilingual routes:
163
+
164
+ ```bash
165
+ python -m smartvoice models install tts-qwen3-0-6b-customvoice
166
+ ```
167
+
168
+ On Windows, first build the native runtime as described in [Build the Qwen3-TTS runtime on Windows](#build-the-qwen3-tts-runtime-on-windows). Then install the model as above. Without that runtime, the model will be listed as unavailable and other installed TTS models remain usable.
169
+
170
+ The first model installation requires internet access. After installation, inference runs locally. See [Model catalog](#model-catalog) for supported languages and estimated sizes.
171
+
172
+ ### 3. Start SmartVoice
173
+
174
+ Start SmartVoice:
175
+
176
+ ```bash
177
+ python -m smartvoice --host 127.0.0.1 --port 8000
178
+ ```
179
+
180
+ Open the [test page](http://127.0.0.1:8000/test) to verify basic STT and TTS functionality with your installed models. Open [API docs](http://127.0.0.1:8000/docs) for endpoint details. Service settings are stored in `<data_dir>/smartvoice.json`; routing priorities are stored separately in `<data_dir>/router.json` and can be reloaded with `python -m smartvoice router reload`.
181
+
182
+ ### 4. Connect an agent or application
183
+
184
+ In your agent or application's settings, choose **OpenAI-compatible API** and set the SmartVoice API base URL to:
185
+
186
+ ```text
187
+ http://127.0.0.1:8000/v1
188
+ ```
189
+
190
+ ## API
191
+
192
+ The audio endpoints follow a supported subset of the OpenAI Audio API conventions. For request fields, response formats, and errors, see the [API specification](doc/api-spec.md).
193
+
194
+ ### Transcribe audio with routing
195
+
196
+ ```powershell
197
+ curl.exe -F "file=@sample.wav" -F "model=smartvoice-auto" -F "language=auto" `
198
+ http://127.0.0.1:8000/v1/audio/transcriptions
199
+ ```
200
+
201
+ Supported upload formats include WAV, MP3, M4A, and FLAC. Audio is limited to 25 MiB and 10 minutes by default.
202
+
203
+ ### Synthesize speech with routing
204
+
205
+ ```powershell
206
+ curl.exe -X POST http://127.0.0.1:8000/v1/audio/speech `
207
+ -H "Content-Type: application/json" `
208
+ -d '{"model":"smartvoice-auto","input":"Hello from SmartVoice.","language":"auto"}' `
209
+ --output speech.wav
210
+ ```
211
+
212
+ TTS returns mono WAV audio. Requests support up to 4,000 characters; generated audio is limited to 180 seconds or 32 MiB by default. See `/docs` or the [API specification](doc/api-spec.md) for available parameters, language behavior, and error codes.
213
+
214
+ ## Manage models
215
+
216
+ The CLI supports `models list`, `install`, `uninstall`, `export`, and `import`. `models list` groups models by installed state, then by STT, TTS, and SmartVoice native; each model shows its availability, and unavailable models include a reason. Availability checks both model-file integrity and the active inference runtime/device. Use `python -m smartvoice models install all` to install every catalog model that is not already installed and the Whisper Tiny language detector. Model downloads run sequentially from their catalog sources; invalid existing model directories are skipped with a repair hint. Installing all models can require several gigabytes of disk space. On Windows x64, Qwen3-TTS is available only when its native runtime has been built; see [Build the Qwen3-TTS runtime on Windows](#build-the-qwen3-tts-runtime-on-windows). Models can also be installed through API download jobs. Exported model packages can be transferred to offline machines and imported there. An installed model cannot be uninstalled while the service is using it.
217
+
218
+ Install a model with `python -m smartvoice models install <model-id>`. By default, SmartVoice uses the model's catalog source. For Hugging Face models, pass `--source` with a compatible mirror base URL to use another source, such as:
219
+
220
+ ```bash
221
+ python -m smartvoice models install stt-qwen3-asr-600m-int8 --source https://hf-mirror.com
222
+ ```
223
+
224
+ The base URL is combined with the catalog-pinned repository, revision, and file paths. This option is available only when all required model files are hosted on Hugging Face. Downloaded files are still checked against their catalog SHA-256 values.
225
+
226
+ ```bash
227
+ python -m smartvoice models list
228
+ python -m smartvoice models export stt-sensevoice-small-int8 ./sensevoice.smartvoice.zip
229
+ python -m smartvoice models import ./sensevoice.smartvoice.zip
230
+ python -m smartvoice models uninstall stt-sensevoice-small-int8
231
+ ```
232
+
233
+ ## Architecture
234
+
235
+ ```text
236
+ Client / Agent ──► Versioned HTTP API ──► Application services
237
+ ▲ │
238
+ │ ▼
239
+ Local CLI Domain contracts
240
+ │
241
+ ┌─────────────────┴─────────────────┐
242
+ ▼ ▼
243
+ Inference port Model repository port
244
+ │ │
245
+ ▼ ▼
246
+ Composite inference provider Filesystem catalog adapter
247
+ ┌───────┴────────┐
248
+ ▼ ▼
249
+ sherpa-onnx native C INT8 Qwen-TTS
250
+ adapter adapter
251
+ │
252
+ ▼
253
+ Platform diagnostics adapter
254
+ ```
255
+
256
+ Callers use versioned API and capability endpoints; inference details stay behind provider and repository interfaces. The source deployment supports CPU inference on Windows x64 and macOS Apple Silicon. Qwen3-TTS uses the native C INT8 adapter on both platforms; Windows x64 source deployments build its runtime with MSYS2 as described above. GPU providers, streaming, Linux and Android runtimes are not available in SmartVoice. See [Architecture Summary and Guidelines](doc/architecture-guidelines.md) for the detailed matrix and model availability semantics.
257
+
258
+ ## Development
259
+
260
+ ```bash
261
+ python -m pip install -e ".[inference,dev]"
262
+ python scripts/test.py ci
263
+ ```
264
+
265
+ Run `python scripts/test.py regression` to execute the full functional suite including real STT/TTS inference. It directly smoke-tests each catalog model installed and available on the current runtime, using one representative language per model; unavailable models are skipped individually. The existing route integration scenarios also run when their optional models and language-ID assets are installed. See [`doc/testing.md`](doc/testing.md) for details and [`benchmarks/README.md`](benchmarks/README.md) for model quality, latency, and concurrency comparisons.
266
+ See [`doc/releasing.md`](doc/releasing.md) for versioning, GitHub Releases, and optional PyPI publishing.
267
+
268
+ ## Repository layout
269
+
270
+ ```text
271
+ catalog/ Model metadata and default router table
272
+ src/ API/CLI entry points, application services, domain contracts, ports, and adapters
273
+ tests/ Unit, API, and optional real-inference tests
274
+ benchmarks/ Benchmark code, configurations, and results
275
+ config/ Example service settings
276
+ doc/ API specification, testing, release, requirements, and design notes
277
+ assets/ Project logo
278
+ ```
279
+
280
+ ## License
281
+
282
+ SmartVoice source code is licensed under the [Apache License 2.0](LICENSE). Model weights, voices, and other third-party assets may have separate license terms; review them before use or redistribution.