Ship Jarvis LVM v1.0: enhanced British-butler voice, Kokoro INT8 bundle, samples, docs
Browse files- .gitattributes +2 -33
- LICENSE +202 -0
- NOTICE +28 -0
- README.md +267 -1
- SHA256SUMS +23 -0
- jarvis_lvm/__init__.py +14 -0
- jarvis_lvm/__main__.py +132 -0
- jarvis_lvm/engine.py +194 -0
- jarvis_lvm/text.py +35 -0
- manifest.json +148 -0
- models/kokoro-v1.0.int8.onnx +3 -0
- pyproject.toml +28 -0
- requirements.txt +4 -0
- samples/jarvis-classic-briefing.wav +3 -0
- samples/jarvis-classic-greeting.wav +3 -0
- samples/jarvis-classic-status.wav +3 -0
- samples/jarvis-deep-briefing.wav +3 -0
- samples/jarvis-deep-greeting.wav +3 -0
- samples/jarvis-deep-status.wav +3 -0
- scripts/build_styles.py +63 -0
- voices/README.md +27 -0
- voices/jarvis-classic.npy +3 -0
- voices/jarvis-deep.npy +3 -0
- voices/voices-v1.0.bin +3 -0
.gitattributes
CHANGED
|
@@ -1,35 +1,4 @@
|
|
| 1 |
-
*.
|
| 2 |
-
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
-
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
-
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
-
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
-
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
-
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
-
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
-
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
-
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
-
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
-
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
-
*.
|
| 16 |
-
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
-
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
-
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
-
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
-
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
-
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
-
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
-
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
-
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
-
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
-
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
-
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
-
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
-
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 30 |
-
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 31 |
-
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 32 |
-
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
-
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
-
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
-
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
| 1 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
|
|
|
| 2 |
*.bin filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.wav filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
Apache License
|
| 3 |
+
Version 2.0, January 2004
|
| 4 |
+
http://www.apache.org/licenses/
|
| 5 |
+
|
| 6 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 7 |
+
|
| 8 |
+
1. Definitions.
|
| 9 |
+
|
| 10 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 11 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 12 |
+
|
| 13 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 14 |
+
the copyright owner that is granting the License.
|
| 15 |
+
|
| 16 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 17 |
+
other entities that control, are controlled by, or are under common
|
| 18 |
+
control with that entity. For the purposes of this definition,
|
| 19 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 20 |
+
direction or management of such entity, whether by contract or
|
| 21 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 22 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 23 |
+
|
| 24 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 25 |
+
exercising permissions granted by this License.
|
| 26 |
+
|
| 27 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 28 |
+
including but not limited to software source code, documentation
|
| 29 |
+
source, and configuration files.
|
| 30 |
+
|
| 31 |
+
"Object" form shall mean any form resulting from mechanical
|
| 32 |
+
transformation or translation of a Source form, including but
|
| 33 |
+
not limited to compiled object code, generated documentation,
|
| 34 |
+
and conversions to other media types.
|
| 35 |
+
|
| 36 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 37 |
+
Object form, made available under the License, as indicated by a
|
| 38 |
+
copyright notice that is included in or attached to the work
|
| 39 |
+
(an example is provided in the Appendix below).
|
| 40 |
+
|
| 41 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 42 |
+
form, that is based on (or derived from) the Work and for which the
|
| 43 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 44 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 45 |
+
of this License, Derivative Works shall not include works that remain
|
| 46 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 47 |
+
the Work and Derivative Works thereof.
|
| 48 |
+
|
| 49 |
+
"Contribution" shall mean any work of authorship, including
|
| 50 |
+
the original version of the Work and any modifications or additions
|
| 51 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 52 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 53 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 54 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 55 |
+
means any form of electronic, verbal, or written communication sent
|
| 56 |
+
to the Licensor or its representatives, including but not limited to
|
| 57 |
+
communication on electronic mailing lists, source code control systems,
|
| 58 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 59 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 60 |
+
excluding communication that is conspicuously marked or otherwise
|
| 61 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 62 |
+
|
| 63 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 64 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 65 |
+
subsequently incorporated within the Work.
|
| 66 |
+
|
| 67 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 68 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 69 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 70 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 71 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 72 |
+
Work and such Derivative Works in Source or Object form.
|
| 73 |
+
|
| 74 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 75 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 76 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 77 |
+
(except as stated in this section) patent license to make, have made,
|
| 78 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 79 |
+
where such license applies only to those patent claims licensable
|
| 80 |
+
by such Contributor that are necessarily infringed by their
|
| 81 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 82 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 83 |
+
institute patent litigation against any entity (including a
|
| 84 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 85 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 86 |
+
or contributory patent infringement, then any patent licenses
|
| 87 |
+
granted to You under this License for that Work shall terminate
|
| 88 |
+
as of the date such litigation is filed.
|
| 89 |
+
|
| 90 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 91 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 92 |
+
modifications, and in Source or Object form, provided that You
|
| 93 |
+
meet the following conditions:
|
| 94 |
+
|
| 95 |
+
(a) You must give any other recipients of the Work or
|
| 96 |
+
Derivative Works a copy of this License; and
|
| 97 |
+
|
| 98 |
+
(b) You must cause any modified files to carry prominent notices
|
| 99 |
+
stating that You changed the files; and
|
| 100 |
+
|
| 101 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 102 |
+
that You distribute, all copyright, patent, trademark, and
|
| 103 |
+
attribution notices from the Source form of the Work,
|
| 104 |
+
excluding those notices that do not pertain to any part of
|
| 105 |
+
the Derivative Works; and
|
| 106 |
+
|
| 107 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 108 |
+
distribution, then any Derivative Works that You distribute must
|
| 109 |
+
include a readable copy of the attribution notices contained
|
| 110 |
+
within such NOTICE file, excluding those notices that do not
|
| 111 |
+
pertain to any part of the Derivative Works, in at least one
|
| 112 |
+
of the following places: within a NOTICE text file distributed
|
| 113 |
+
as part of the Derivative Works; within the Source form or
|
| 114 |
+
documentation, if provided along with the Derivative Works; or,
|
| 115 |
+
within a display generated by the Derivative Works, if and
|
| 116 |
+
wherever such third-party notices normally appear. The contents
|
| 117 |
+
of the NOTICE file are for informational purposes only and
|
| 118 |
+
do not modify the License. You may add Your own attribution
|
| 119 |
+
notices within Derivative Works that You distribute, alongside
|
| 120 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 121 |
+
that such additional attribution notices cannot be construed
|
| 122 |
+
as modifying the License.
|
| 123 |
+
|
| 124 |
+
You may add Your own copyright statement to Your modifications and
|
| 125 |
+
may provide additional or different license terms and conditions
|
| 126 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 127 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 128 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 129 |
+
the conditions stated in this License.
|
| 130 |
+
|
| 131 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 132 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 133 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 134 |
+
this License, without any additional terms or conditions.
|
| 135 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 136 |
+
the terms of any separate license agreement you may have executed
|
| 137 |
+
with Licensor regarding such Contributions.
|
| 138 |
+
|
| 139 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 140 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 141 |
+
except as required for reasonable and customary use in describing the
|
| 142 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 143 |
+
|
| 144 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 145 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 146 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 147 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 148 |
+
implied, including, without limitation, any warranties or conditions
|
| 149 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 150 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 151 |
+
appropriateness of using or redistributing the Work and assume any
|
| 152 |
+
risks associated with Your exercise of permissions under this License.
|
| 153 |
+
|
| 154 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 155 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 156 |
+
unless required by applicable law (such as deliberate and grossly
|
| 157 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 158 |
+
liable to You for damages, including any direct, indirect, special,
|
| 159 |
+
incidental, or consequential damages of any character arising as a
|
| 160 |
+
result of this License or out of the use or inability to use the
|
| 161 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 162 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 163 |
+
other commercial damages or losses), even if such Contributor
|
| 164 |
+
has been advised of the possibility of such damages.
|
| 165 |
+
|
| 166 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 167 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 168 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 169 |
+
or other liability obligations and/or rights consistent with this
|
| 170 |
+
License. However, in accepting such obligations, You may act only
|
| 171 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 172 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 173 |
+
defend, and hold each Contributor harmless for any liability
|
| 174 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 175 |
+
of your accepting any such warranty or additional liability.
|
| 176 |
+
|
| 177 |
+
END OF TERMS AND CONDITIONS
|
| 178 |
+
|
| 179 |
+
APPENDIX: How to apply the Apache License to your work.
|
| 180 |
+
|
| 181 |
+
To apply the Apache License to your work, attach the following
|
| 182 |
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
| 183 |
+
replaced with your own identifying information. (Don't include
|
| 184 |
+
the brackets!) The text should be enclosed in the appropriate
|
| 185 |
+
comment syntax for the file format. We also recommend that a
|
| 186 |
+
file or class name and description of purpose be included on the
|
| 187 |
+
same "printed page" as the copyright notice for easier
|
| 188 |
+
identification within third-party archives.
|
| 189 |
+
|
| 190 |
+
Copyright [yyyy] [name of copyright owner]
|
| 191 |
+
|
| 192 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 193 |
+
you may not use this file except in compliance with the License.
|
| 194 |
+
You may obtain a copy of the License at
|
| 195 |
+
|
| 196 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 197 |
+
|
| 198 |
+
Unless required by applicable law or agreed to in writing, software
|
| 199 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 200 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 201 |
+
See the License for the specific language governing permissions and
|
| 202 |
+
limitations under the License.
|
NOTICE
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Jarvis LVM
|
| 2 |
+
Copyright 2026 StealthAI
|
| 3 |
+
|
| 4 |
+
This distribution includes or is derived from the following works:
|
| 5 |
+
|
| 6 |
+
Kokoro-82M
|
| 7 |
+
https://huggingface.co/hexgrad/Kokoro-82M
|
| 8 |
+
Copyright 2025 hexgrad
|
| 9 |
+
Licensed under the Apache License, Version 2.0.
|
| 10 |
+
|
| 11 |
+
Kokoro v1.0 ONNX export and voice bundle
|
| 12 |
+
https://github.com/thewh1teagle/kokoro-onnx
|
| 13 |
+
Copyright 2025 thewh1teagle
|
| 14 |
+
The kokoro-onnx runtime is licensed under the MIT License.
|
| 15 |
+
The exported Kokoro-82M weights remain subject to the Apache License 2.0.
|
| 16 |
+
|
| 17 |
+
Kokoro voice styles (voices-v1.0.bin)
|
| 18 |
+
Derived from the Kokoro-82M voice pack.
|
| 19 |
+
Licensed under the Apache License, Version 2.0.
|
| 20 |
+
|
| 21 |
+
Jarvis LVM style vectors (jarvis-classic.npy, jarvis-deep.npy)
|
| 22 |
+
Copyright 2026 StealthAI
|
| 23 |
+
Linear blends of the Kokoro voices bm_george, bm_daniel, and bm_lewis.
|
| 24 |
+
Licensed under the Apache License, Version 2.0.
|
| 25 |
+
|
| 26 |
+
No audio from Marvel, Disney, or any Paul Bettany performance is included.
|
| 27 |
+
"JARVIS" is used only to describe the style of the synthetic voice. This
|
| 28 |
+
project is not affiliated with or endorsed by Marvel, Disney, or Paul Bettany.
|
README.md
CHANGED
|
@@ -1,3 +1,269 @@
|
|
| 1 |
---
|
| 2 |
-
license:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
library_name: kokoro-onnx
|
| 6 |
+
pipeline_tag: text-to-speech
|
| 7 |
+
base_model: hexgrad/Kokoro-82M
|
| 8 |
+
tags:
|
| 9 |
+
- text-to-speech
|
| 10 |
+
- kokoro
|
| 11 |
+
- onnx
|
| 12 |
+
- cpu
|
| 13 |
+
- local-first
|
| 14 |
+
- jarvis
|
| 15 |
+
- british-english
|
| 16 |
+
- butler
|
| 17 |
---
|
| 18 |
+
|
| 19 |
+
# Jarvis LVM
|
| 20 |
+
|
| 21 |
+
**A complete, CPU-first British-butler voice model that runs on your machine.**
|
| 22 |
+
No API key. No cloud TTS. No network request during synthesis.
|
| 23 |
+
|
| 24 |
+
Jarvis LVM packages the Apache-2.0 Kokoro-82M INT8 model, the full Kokoro voice
|
| 25 |
+
bundle, two purpose-built style vectors, and a small Python CLI into one
|
| 26 |
+
self-contained download. It is designed for the OpenJarvis desktop assistant and
|
| 27 |
+
for any product that needs a low, measured, English-butler delivery on ordinary
|
| 28 |
+
CPU hardware.
|
| 29 |
+
|
| 30 |
+
> **What "JARVIS-inspired" means here:** the cadence, pitch, and diction are
|
| 31 |
+
> tuned toward a polished British male assistant. This is **not** a Paul Bettany
|
| 32 |
+
> voice clone, was **not** trained on Marvel film audio, and cannot reproduce his
|
| 33 |
+
> exact likeness. A literal celebrity clone requires a licensed reference voice
|
| 34 |
+
> model and the actor's permission. This package deliberately contains neither.
|
| 35 |
+
|
| 36 |
+
## Hear it
|
| 37 |
+
|
| 38 |
+
| Preset | Sample |
|
| 39 |
+
|---|---|
|
| 40 |
+
| `jarvis-classic` (default) | [Greeting](samples/jarvis-classic-greeting.wav) · [Briefing](samples/jarvis-classic-briefing.wav) · [Status](samples/jarvis-classic-status.wav) |
|
| 41 |
+
| `jarvis-deep` | [Greeting](samples/jarvis-deep-greeting.wav) · [Briefing](samples/jarvis-deep-briefing.wav) · [Status](samples/jarvis-deep-status.wav) |
|
| 42 |
+
|
| 43 |
+
Sample text: *"I have reviewed the overnight telemetry, and the results are
|
| 44 |
+
encouraging. Your calendar is clear for the next two hours."*
|
| 45 |
+
|
| 46 |
+
## Quick start
|
| 47 |
+
|
| 48 |
+
### 1. Download
|
| 49 |
+
|
| 50 |
+
```bash
|
| 51 |
+
# Hugging Face CLI (recommended; fetches LFS files)
|
| 52 |
+
hf download broduer/Jarvis --repo-type model --local-dir jarvis-lvm
|
| 53 |
+
cd jarvis-lvm
|
| 54 |
+
```
|
| 55 |
+
|
| 56 |
+
Or clone with Git LFS:
|
| 57 |
+
|
| 58 |
+
```bash
|
| 59 |
+
git lfs install
|
| 60 |
+
git clone https://huggingface.co/broduer/Jarvis jarvis-lvm
|
| 61 |
+
cd jarvis-lvm
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
### 2. Install
|
| 65 |
+
|
| 66 |
+
Python 3.10–3.12 is supported. CPU only; no CUDA required.
|
| 67 |
+
|
| 68 |
+
```bash
|
| 69 |
+
python -m venv .venv
|
| 70 |
+
# Windows:
|
| 71 |
+
.venv\Scripts\activate
|
| 72 |
+
# macOS / Linux:
|
| 73 |
+
# source .venv/bin/activate
|
| 74 |
+
|
| 75 |
+
pip install -r requirements.txt
|
| 76 |
+
```
|
| 77 |
+
|
| 78 |
+
### 3. Speak
|
| 79 |
+
|
| 80 |
+
```bash
|
| 81 |
+
python -m jarvis_lvm \
|
| 82 |
+
--text "Good evening, sir. All systems are functioning within normal parameters." \
|
| 83 |
+
--voice jarvis-classic \
|
| 84 |
+
--out greeting.wav
|
| 85 |
+
```
|
| 86 |
+
|
| 87 |
+
Output is 24 kHz, mono, 16-bit PCM WAV:
|
| 88 |
+
|
| 89 |
+
```
|
| 90 |
+
wrote greeting.wav voice=jarvis-classic rate=24000Hz duration=4.395s threads=6
|
| 91 |
+
```
|
| 92 |
+
|
| 93 |
+
Install the console command if you prefer:
|
| 94 |
+
|
| 95 |
+
```bash
|
| 96 |
+
pip install -e .
|
| 97 |
+
jarvis-lvm --text "Welcome home, sir." --out welcome.wav
|
| 98 |
+
```
|
| 99 |
+
|
| 100 |
+
Useful options:
|
| 101 |
+
|
| 102 |
+
```text
|
| 103 |
+
--voice jarvis-classic|jarvis-deep|bm_george|... select a preset
|
| 104 |
+
--speed 0.95 default; lower is slower
|
| 105 |
+
--lang en-gb Kokoro language code
|
| 106 |
+
--text-file briefing.txt read a UTF-8 script
|
| 107 |
+
--raw skip Markdown/acronym cleanup
|
| 108 |
+
--model-dir PATH assets elsewhere
|
| 109 |
+
--intra-threads N pin ONNX CPU threads
|
| 110 |
+
--list-voices show every available voice
|
| 111 |
+
```
|
| 112 |
+
|
| 113 |
+
## Python API
|
| 114 |
+
|
| 115 |
+
```python
|
| 116 |
+
from pathlib import Path
|
| 117 |
+
from jarvis_lvm import JarvisLVM
|
| 118 |
+
|
| 119 |
+
model = JarvisLVM() # package root, or set JARVIS_LVM_ROOT
|
| 120 |
+
|
| 121 |
+
result = model.synthesize(
|
| 122 |
+
"Good evening, sir. All systems are functioning within normal parameters.",
|
| 123 |
+
voice="jarvis-classic",
|
| 124 |
+
speed=0.95,
|
| 125 |
+
)
|
| 126 |
+
Path("greeting.wav").write_bytes(result.wav)
|
| 127 |
+
print(result.seconds, result.sample_rate)
|
| 128 |
+
```
|
| 129 |
+
|
| 130 |
+
`JarvisLVM` loads the ONNX session once. Reuse the instance for every request;
|
| 131 |
+
it serializes synthesis internally and is safe to call from a worker thread.
|
| 132 |
+
|
| 133 |
+
If the package is installed somewhere other than the asset directory:
|
| 134 |
+
|
| 135 |
+
```python
|
| 136 |
+
model = JarvisLVM(root=r"C:\path\to\jarvis-lvm")
|
| 137 |
+
# or: set JARVIS_LVM_ROOT=C:\path\to\jarvis-lvm
|
| 138 |
+
```
|
| 139 |
+
|
| 140 |
+
## Use with OpenJarvis
|
| 141 |
+
|
| 142 |
+
Copy the default vector into the app's voice directory, then select
|
| 143 |
+
`jarvis-original` in the voice picker:
|
| 144 |
+
|
| 145 |
+
```powershell
|
| 146 |
+
# Windows
|
| 147 |
+
copy voices\jarvis-classic.npy "$env:USERPROFILE\.openjarvis\voices\jarvis-original.npy"
|
| 148 |
+
```
|
| 149 |
+
|
| 150 |
+
```bash
|
| 151 |
+
# macOS / Linux
|
| 152 |
+
mkdir -p ~/.openjarvis/voices
|
| 153 |
+
cp voices/jarvis-classic.npy ~/.openjarvis/voices/jarvis-original.npy
|
| 154 |
+
```
|
| 155 |
+
|
| 156 |
+
For the deeper preset, copy `voices/jarvis-deep.npy` instead. Restart the app
|
| 157 |
+
after replacing the file. The existing Kokoro model and `voices-v1.0.bin` are
|
| 158 |
+
already provisioned by OpenJarvis; this package duplicates them so standalone
|
| 159 |
+
users and companies get a complete, reproducible bundle.
|
| 160 |
+
|
| 161 |
+
## Why it sounds closer to JARVIS
|
| 162 |
+
|
| 163 |
+
The stock `bm_george` voice is a clean British male, but it is brighter and
|
| 164 |
+
higher than the film character's calm, low register. Jarvis LVM derives a new
|
| 165 |
+
Kokoro style vector by blending three British male voices:
|
| 166 |
+
|
| 167 |
+
| Preset | Recipe | Median F0 | F1 | F2 | Character |
|
| 168 |
+
|---|---|---|---|---|---|
|
| 169 |
+
| `jarvis-classic` | 25% `bm_george` + 35% `bm_daniel` + 40% `bm_lewis` | **113 Hz** | 589 Hz | 1,928 Hz | default; low, precise, unforced |
|
| 170 |
+
| `jarvis-deep` | 50% `bm_lewis` + 50% `bm_daniel` | **105 Hz** | 589 Hz | 1,810 Hz | heavier, slower-feeling |
|
| 171 |
+
| stock `bm_george` | reference | 137 Hz | 611 Hz | 1,990 Hz | brighter, more generic |
|
| 172 |
+
|
| 173 |
+
Measurements are median values across the included greeting sample at speed
|
| 174 |
+
`0.95`, using Praat pitch/formant analysis. The classic preset lowers median
|
| 175 |
+
pitch by roughly 24 Hz and pulls the second formant down, which reads as a
|
| 176 |
+
darker, more enclosed "butler" timbre without sacrificing intelligibility.
|
| 177 |
+
|
| 178 |
+
At the default speed the delivery is about **150–160 words per minute** — brisk
|
| 179 |
+
enough for assistant replies, slow enough to sound deliberate. The included
|
| 180 |
+
briefing samples transcribe exactly with Faster-Whisper `base` (zero word
|
| 181 |
+
errors), so the darker timbre has not cost clarity.
|
| 182 |
+
|
| 183 |
+
The recipes are reproducible with [`scripts/build_styles.py`](scripts/build_styles.py):
|
| 184 |
+
|
| 185 |
+
```bash
|
| 186 |
+
python scripts/build_styles.py --voices voices/voices-v1.0.bin --out voices
|
| 187 |
+
```
|
| 188 |
+
|
| 189 |
+
## Package contents
|
| 190 |
+
|
| 191 |
+
| File | Size | SHA-256 |
|
| 192 |
+
|---|---:|---|
|
| 193 |
+
| `models/kokoro-v1.0.int8.onnx` | 92,361,271 B | `6e742170d309016e5891a994e1ce1559c702a2ccd0075e67ef7157974f6406cb` |
|
| 194 |
+
| `voices/voices-v1.0.bin` | 28,214,398 B | `bca610b8308e8d99f32e6fe4197e7ec01679264efed0cac9140fe9c29f1fbf7d` |
|
| 195 |
+
| `voices/jarvis-classic.npy` | 522,368 B | `3dfb704fed377720ae0c75c8f3122330a3973181ed7cfb5494d7fbe69a2bff50` |
|
| 196 |
+
| `voices/jarvis-deep.npy` | 522,368 B | `13b1e8f3c82d1ed28c59ad0490ccf509c2d41ada576f8fef70f49cb64d0f7050` |
|
| 197 |
+
|
| 198 |
+
```
|
| 199 |
+
jarvis-lvm/
|
| 200 |
+
├── jarvis_lvm/ # engine, text normalization, CLI
|
| 201 |
+
├── models/ # Kokoro INT8 ONNX model
|
| 202 |
+
├── voices/ # Kokoro voice bundle + two Jarvis presets
|
| 203 |
+
├── samples/ # six rendered WAV demos
|
| 204 |
+
├── scripts/build_styles.py # reproducible blend recipe
|
| 205 |
+
├── manifest.json # machine-readable package metadata
|
| 206 |
+
├── SHA256SUMS # integrity check
|
| 207 |
+
├── LICENSE # Apache-2.0
|
| 208 |
+
└── NOTICE # Kokoro and voice attribution
|
| 209 |
+
```
|
| 210 |
+
|
| 211 |
+
Verify the download:
|
| 212 |
+
|
| 213 |
+
```bash
|
| 214 |
+
sha256sum -c SHA256SUMS
|
| 215 |
+
```
|
| 216 |
+
|
| 217 |
+
## Performance
|
| 218 |
+
|
| 219 |
+
Measured on Windows 11, 6 physical CPU cores, ONNX Runtime 1.32, INT8 model:
|
| 220 |
+
|
| 221 |
+
| Metric | Result |
|
| 222 |
+
|---|---|
|
| 223 |
+
| Model load | 0.77 s |
|
| 224 |
+
| Synthesis, 8.8 s of audio | 3.90 s |
|
| 225 |
+
| Real-time factor | **0.44×** (about 2.3× faster than playback) |
|
| 226 |
+
| Process RSS after load | ~574 MiB |
|
| 227 |
+
| Sample rate | 24 kHz mono |
|
| 228 |
+
|
| 229 |
+
A 10-second reply is generated in roughly 4.4 seconds on this class of CPU.
|
| 230 |
+
Performance scales with physical cores: the engine defaults to one ONNX thread
|
| 231 |
+
per physical core and uses `--intra-threads` for explicit control.
|
| 232 |
+
|
| 233 |
+
## Licensing
|
| 234 |
+
|
| 235 |
+
- **This package and the two Jarvis style vectors:** Apache License 2.0.
|
| 236 |
+
- **Kokoro-82M model:** Apache License 2.0, © 2025 hexgrad.
|
| 237 |
+
- **Kokoro v1.0 ONNX export and `voices-v1.0.bin`:** distributed by the
|
| 238 |
+
MIT-licensed [kokoro-onnx](https://github.com/thewh1teagle/kokoro-onnx)
|
| 239 |
+
project; the underlying Kokoro weights remain Apache-2.0.
|
| 240 |
+
- See [`NOTICE`](NOTICE) for the full attribution.
|
| 241 |
+
|
| 242 |
+
You may use the voice in commercial products, modify the style vectors, and
|
| 243 |
+
redistribute the bundle under Apache-2.0. You are responsible for your local
|
| 244 |
+
laws and for disclosing that the voice is synthetic where required.
|
| 245 |
+
|
| 246 |
+
## Limitations and responsible use
|
| 247 |
+
|
| 248 |
+
- This is a **style**, not a person. It is not Paul Bettany, Tony Stark, or any
|
| 249 |
+
real individual. Do not market it as an actor clone or use it to imply
|
| 250 |
+
endorsement.
|
| 251 |
+
- The model is English-only and optimized for `en-gb`. Other Kokoro languages
|
| 252 |
+
are available through `--lang`, but the Jarvis presets were tuned in English.
|
| 253 |
+
- Kokoro can mispronounce unusual names, and long text is synthesized in one
|
| 254 |
+
pass. For production prompts, normalize names/units first or split at sentence
|
| 255 |
+
boundaries.
|
| 256 |
+
- Do not use the voice for impersonation, fraud, harassment, or to fabricate
|
| 257 |
+
statements by a real person. Synthetic speech should be disclosed.
|
| 258 |
+
- "JARVIS" is a trademark of Marvel/Disney. This project uses the term only to
|
| 259 |
+
describe a voice style and is not affiliated with or endorsed by them.
|
| 260 |
+
|
| 261 |
+
## Provenance
|
| 262 |
+
|
| 263 |
+
Built by StealthAI for the OpenJarvis project. The style vectors are deterministic
|
| 264 |
+
linear blends of Kokoro's permissively licensed `bm_george`, `bm_daniel`, and
|
| 265 |
+
`bm_lewis` voice embeddings. No film audio, YouTube rips, or actor recordings were
|
| 266 |
+
used. Every sample in this repository was generated by the code and weights
|
| 267 |
+
shipped here.
|
| 268 |
+
|
| 269 |
+
Mirror: [stealthai-intel/Jarvis-LVM](https://huggingface.co/stealthai-intel/Jarvis-LVM)
|
SHA256SUMS
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
7a892777977f2cda519c5c575539d3890139af497499f152e8e09269cd106184 *./.gitattributes
|
| 2 |
+
cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 *./LICENSE
|
| 3 |
+
d1157c1c7d7c64381fe945354181f8e2f249e6d8339db4e2ccae2820285eef23 *./NOTICE
|
| 4 |
+
8a498491c7cd1e768a90194265c544da0f1d1825865c059a1c02d3e872792665 *./README.md
|
| 5 |
+
d04b272cc667ae658cf47975908c95dcfaa545373e436d92902d2aa28d9e3a2a *./jarvis_lvm/__init__.py
|
| 6 |
+
283e043af8c3d644f91a6f375765e4654de922a16691f3912512408742794613 *./jarvis_lvm/__main__.py
|
| 7 |
+
15782731ad2fb94202789d4ac5366a43f04eba9205cd4a8283adcf28f0981fc6 *./jarvis_lvm/engine.py
|
| 8 |
+
683807cba857233c45722858d56ace49c529fd9125b5cebf2a557d82f5e1657a *./jarvis_lvm/text.py
|
| 9 |
+
45377d1a44ba15c954f3e62a71e73726d3903197acdb2926055828fbd69541cf *./manifest.json
|
| 10 |
+
6e742170d309016e5891a994e1ce1559c702a2ccd0075e67ef7157974f6406cb *./models/kokoro-v1.0.int8.onnx
|
| 11 |
+
ea6f4fab0e9913ebe4a8b93a28013a7446a18b162815e4136cb8e1c0398fd811 *./pyproject.toml
|
| 12 |
+
b9e5cad68e9396c91160eb241d707e9ce699fe7429654626161a39e2b0ecadd5 *./requirements.txt
|
| 13 |
+
57ee12f24a44e6905712a90ceefb43f0a225771dad8d466998976bfeb51218be *./samples/jarvis-classic-briefing.wav
|
| 14 |
+
e2d8e07a6f8fc4974ae2af583a3864e915d0805ca8ef46a5023bc8b50599abf3 *./samples/jarvis-classic-greeting.wav
|
| 15 |
+
0799ab489d716f4e9de165a1ff29a4fca5584aafbdce395e330c58e1af7213b3 *./samples/jarvis-classic-status.wav
|
| 16 |
+
89b794919c592f39c5a3cf63391bc785b33bd00d71f98afb92324fb22c43c026 *./samples/jarvis-deep-briefing.wav
|
| 17 |
+
553209a3df15e45cecf476d4de3da2f16ef30c1b51d49b3feb0328a39a01e603 *./samples/jarvis-deep-greeting.wav
|
| 18 |
+
d1aec293acc728b62f954be1a4f379bd55af8e59f664ad0d8f81bed1b12c546d *./samples/jarvis-deep-status.wav
|
| 19 |
+
927d3708700350efa9e3fedb1aac6cdf9dff17b24c68ac0cbc05b968fa9d5998 *./scripts/build_styles.py
|
| 20 |
+
ee7928a253b6b3f92e42345348140743855d1ca798167f051e1a0ca2006b7a7c *./voices/README.md
|
| 21 |
+
3dfb704fed377720ae0c75c8f3122330a3973181ed7cfb5494d7fbe69a2bff50 *./voices/jarvis-classic.npy
|
| 22 |
+
13b1e8f3c82d1ed28c59ad0490ccf509c2d41ada576f8fef70f49cb64d0f7050 *./voices/jarvis-deep.npy
|
| 23 |
+
bca610b8308e8d99f32e6fe4197e7ec01679264efed0cac9140fe9c29f1fbf7d *./voices/voices-v1.0.bin
|
jarvis_lvm/__init__.py
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Jarvis LVM: a local, CPU-first British-butler voice model."""
|
| 2 |
+
|
| 3 |
+
from .engine import DEFAULT_SPEED, DEFAULT_VOICE, JarvisLVM, SynthResult
|
| 4 |
+
from .text import normalize_text
|
| 5 |
+
|
| 6 |
+
__version__ = "1.0.0"
|
| 7 |
+
__all__ = [
|
| 8 |
+
"DEFAULT_SPEED",
|
| 9 |
+
"DEFAULT_VOICE",
|
| 10 |
+
"JarvisLVM",
|
| 11 |
+
"SynthResult",
|
| 12 |
+
"normalize_text",
|
| 13 |
+
"__version__",
|
| 14 |
+
]
|
jarvis_lvm/__main__.py
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Command-line interface for the Jarvis local voice model."""
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
import argparse
|
| 6 |
+
import sys
|
| 7 |
+
from pathlib import Path
|
| 8 |
+
|
| 9 |
+
from .engine import DEFAULT_SPEED, DEFAULT_VOICE, JarvisLVM
|
| 10 |
+
from .text import normalize_text
|
| 11 |
+
|
| 12 |
+
|
| 13 |
+
def build_parser() -> argparse.ArgumentParser:
|
| 14 |
+
parser = argparse.ArgumentParser(
|
| 15 |
+
prog="jarvis-lvm",
|
| 16 |
+
description=(
|
| 17 |
+
"Synthesize speech locally with the Jarvis LVM Kokoro voice. "
|
| 18 |
+
"No API key and no network access are used."
|
| 19 |
+
),
|
| 20 |
+
)
|
| 21 |
+
parser.add_argument("--text", help="text to speak")
|
| 22 |
+
parser.add_argument(
|
| 23 |
+
"--text-file",
|
| 24 |
+
type=Path,
|
| 25 |
+
help="read text from a UTF-8 file instead of --text",
|
| 26 |
+
)
|
| 27 |
+
parser.add_argument(
|
| 28 |
+
"--out",
|
| 29 |
+
type=Path,
|
| 30 |
+
default=Path("jarvis.wav"),
|
| 31 |
+
help="output WAV path (default: jarvis.wav)",
|
| 32 |
+
)
|
| 33 |
+
parser.add_argument(
|
| 34 |
+
"--voice",
|
| 35 |
+
default=DEFAULT_VOICE,
|
| 36 |
+
help=f"voice preset (default: {DEFAULT_VOICE})",
|
| 37 |
+
)
|
| 38 |
+
parser.add_argument(
|
| 39 |
+
"--speed",
|
| 40 |
+
type=float,
|
| 41 |
+
default=DEFAULT_SPEED,
|
| 42 |
+
help=f"speech speed, 0.5-2.0 (default: {DEFAULT_SPEED})",
|
| 43 |
+
)
|
| 44 |
+
parser.add_argument(
|
| 45 |
+
"--lang",
|
| 46 |
+
default="en-gb",
|
| 47 |
+
help="Kokoro language code (default: en-gb)",
|
| 48 |
+
)
|
| 49 |
+
parser.add_argument(
|
| 50 |
+
"--model-dir",
|
| 51 |
+
type=Path,
|
| 52 |
+
help=(
|
| 53 |
+
"directory containing models/ and voices/ "
|
| 54 |
+
"(default: package root or JARVIS_LVM_ROOT)"
|
| 55 |
+
),
|
| 56 |
+
)
|
| 57 |
+
parser.add_argument(
|
| 58 |
+
"--intra-threads",
|
| 59 |
+
type=int,
|
| 60 |
+
default=0,
|
| 61 |
+
help="ONNX CPU threads (0 = one per physical core)",
|
| 62 |
+
)
|
| 63 |
+
parser.add_argument(
|
| 64 |
+
"--raw",
|
| 65 |
+
action="store_true",
|
| 66 |
+
help="skip Markdown/acronym normalization",
|
| 67 |
+
)
|
| 68 |
+
parser.add_argument(
|
| 69 |
+
"--list-voices",
|
| 70 |
+
action="store_true",
|
| 71 |
+
help="list packaged and Kokoro voices, then exit",
|
| 72 |
+
)
|
| 73 |
+
return parser
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
def main(argv: list[str] | None = None) -> int:
|
| 77 |
+
parser = build_parser()
|
| 78 |
+
args = parser.parse_args(argv)
|
| 79 |
+
|
| 80 |
+
try:
|
| 81 |
+
model = JarvisLVM(
|
| 82 |
+
root=args.model_dir,
|
| 83 |
+
intra_threads=args.intra_threads,
|
| 84 |
+
)
|
| 85 |
+
except Exception as exc:
|
| 86 |
+
parser.error(str(exc))
|
| 87 |
+
|
| 88 |
+
if args.list_voices:
|
| 89 |
+
for voice in model.voices:
|
| 90 |
+
marker = "*" if voice == DEFAULT_VOICE else " "
|
| 91 |
+
print(f"{marker} {voice}")
|
| 92 |
+
return 0
|
| 93 |
+
|
| 94 |
+
if bool(args.text) == bool(args.text_file):
|
| 95 |
+
parser.error("provide exactly one of --text or --text-file")
|
| 96 |
+
text = args.text
|
| 97 |
+
if args.text_file:
|
| 98 |
+
try:
|
| 99 |
+
text = args.text_file.read_text(encoding="utf-8")
|
| 100 |
+
except OSError as exc:
|
| 101 |
+
parser.error(f"could not read {args.text_file}: {exc}")
|
| 102 |
+
if not args.raw:
|
| 103 |
+
text = normalize_text(text)
|
| 104 |
+
if not text:
|
| 105 |
+
parser.error("text is empty after normalization")
|
| 106 |
+
|
| 107 |
+
try:
|
| 108 |
+
result = model.synthesize(
|
| 109 |
+
text,
|
| 110 |
+
voice=args.voice,
|
| 111 |
+
speed=args.speed,
|
| 112 |
+
lang=args.lang,
|
| 113 |
+
)
|
| 114 |
+
except Exception as exc:
|
| 115 |
+
parser.error(str(exc))
|
| 116 |
+
|
| 117 |
+
try:
|
| 118 |
+
args.out.parent.mkdir(parents=True, exist_ok=True)
|
| 119 |
+
args.out.write_bytes(result.wav)
|
| 120 |
+
except OSError as exc:
|
| 121 |
+
parser.error(f"could not write {args.out}: {exc}")
|
| 122 |
+
|
| 123 |
+
print(
|
| 124 |
+
f"wrote {args.out} voice={result.voice} "
|
| 125 |
+
f"rate={result.sample_rate}Hz duration={result.seconds}s "
|
| 126 |
+
f"threads={model.intra_threads}"
|
| 127 |
+
)
|
| 128 |
+
return 0
|
| 129 |
+
|
| 130 |
+
|
| 131 |
+
if __name__ == "__main__":
|
| 132 |
+
sys.exit(main())
|
jarvis_lvm/engine.py
ADDED
|
@@ -0,0 +1,194 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""CPU-first Kokoro engine for the Jarvis LVM package."""
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
import io
|
| 6 |
+
import os
|
| 7 |
+
import threading
|
| 8 |
+
import wave
|
| 9 |
+
from dataclasses import dataclass
|
| 10 |
+
from pathlib import Path
|
| 11 |
+
|
| 12 |
+
import numpy as np
|
| 13 |
+
import onnxruntime as ort
|
| 14 |
+
import psutil
|
| 15 |
+
from kokoro_onnx import Kokoro
|
| 16 |
+
|
| 17 |
+
DEFAULT_VOICE = "jarvis-classic"
|
| 18 |
+
DEFAULT_SPEED = 0.95
|
| 19 |
+
DEFAULT_LANG = "en-gb"
|
| 20 |
+
STYLE_DIM = 256
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
def default_root() -> Path:
|
| 24 |
+
"""Return the package root containing models/, voices/, and samples/."""
|
| 25 |
+
configured = os.environ.get("JARVIS_LVM_ROOT")
|
| 26 |
+
if configured:
|
| 27 |
+
return Path(configured).expanduser().resolve()
|
| 28 |
+
return Path(__file__).resolve().parent.parent
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
def physical_cores() -> int:
|
| 32 |
+
try:
|
| 33 |
+
count = psutil.cpu_count(logical=False)
|
| 34 |
+
except Exception:
|
| 35 |
+
count = None
|
| 36 |
+
return max(1, count or os.cpu_count() or 1)
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
def load_styles(directory: str | Path) -> dict[str, np.ndarray]:
|
| 40 |
+
"""Load and validate Kokoro style vectors from *directory*."""
|
| 41 |
+
root = Path(directory)
|
| 42 |
+
styles: dict[str, np.ndarray] = {}
|
| 43 |
+
if not root.is_dir():
|
| 44 |
+
return styles
|
| 45 |
+
for path in sorted(root.glob("*.npy")):
|
| 46 |
+
try:
|
| 47 |
+
style = np.load(path, allow_pickle=False)
|
| 48 |
+
except Exception as exc:
|
| 49 |
+
raise ValueError(f"could not read {path.name}: {exc}") from exc
|
| 50 |
+
if style.ndim == 2 and style.shape[-1] == STYLE_DIM:
|
| 51 |
+
style = style[:, None, :]
|
| 52 |
+
if (
|
| 53 |
+
style.ndim != 3
|
| 54 |
+
or style.shape[1] != 1
|
| 55 |
+
or style.shape[2] != STYLE_DIM
|
| 56 |
+
or style.shape[0] < 1
|
| 57 |
+
):
|
| 58 |
+
raise ValueError(
|
| 59 |
+
f"{path.name}: expected (frames, 1, {STYLE_DIM}) or "
|
| 60 |
+
f"(frames, {STYLE_DIM}), got {style.shape}"
|
| 61 |
+
)
|
| 62 |
+
style = np.asarray(style, dtype=np.float32)
|
| 63 |
+
if not np.isfinite(style).all():
|
| 64 |
+
raise ValueError(f"{path.name}: contains non-finite values")
|
| 65 |
+
styles[path.stem] = style
|
| 66 |
+
return styles
|
| 67 |
+
|
| 68 |
+
|
| 69 |
+
@dataclass(frozen=True)
|
| 70 |
+
class SynthResult:
|
| 71 |
+
wav: bytes
|
| 72 |
+
sample_rate: int
|
| 73 |
+
voice: str
|
| 74 |
+
seconds: float
|
| 75 |
+
|
| 76 |
+
|
| 77 |
+
class JarvisLVM:
|
| 78 |
+
"""Load Kokoro once and synthesize with the packaged Jarvis style vectors."""
|
| 79 |
+
|
| 80 |
+
def __init__(
|
| 81 |
+
self,
|
| 82 |
+
root: str | Path | None = None,
|
| 83 |
+
*,
|
| 84 |
+
model_path: str | Path | None = None,
|
| 85 |
+
voices_path: str | Path | None = None,
|
| 86 |
+
voices_dir: str | Path | None = None,
|
| 87 |
+
intra_threads: int = 0,
|
| 88 |
+
) -> None:
|
| 89 |
+
self.root = Path(root).resolve() if root else default_root()
|
| 90 |
+
self.model_path = Path(
|
| 91 |
+
model_path or self.root / "models" / "kokoro-v1.0.int8.onnx"
|
| 92 |
+
)
|
| 93 |
+
self.voices_path = Path(
|
| 94 |
+
voices_path or self.root / "voices" / "voices-v1.0.bin"
|
| 95 |
+
)
|
| 96 |
+
self.voices_dir = Path(voices_dir or self.root / "voices")
|
| 97 |
+
for label, path in (
|
| 98 |
+
("model", self.model_path),
|
| 99 |
+
("voices", self.voices_path),
|
| 100 |
+
):
|
| 101 |
+
if not path.is_file():
|
| 102 |
+
raise FileNotFoundError(
|
| 103 |
+
f"{label} not found: {path}. Set JARVIS_LVM_ROOT to the "
|
| 104 |
+
"directory containing models/ and voices/."
|
| 105 |
+
)
|
| 106 |
+
|
| 107 |
+
count = physical_cores() if intra_threads <= 0 else intra_threads
|
| 108 |
+
options = ort.SessionOptions()
|
| 109 |
+
options.intra_op_num_threads = count
|
| 110 |
+
options.inter_op_num_threads = 1
|
| 111 |
+
options.graph_optimization_level = (
|
| 112 |
+
ort.GraphOptimizationLevel.ORT_ENABLE_ALL
|
| 113 |
+
)
|
| 114 |
+
session = ort.InferenceSession(
|
| 115 |
+
str(self.model_path),
|
| 116 |
+
sess_options=options,
|
| 117 |
+
providers=["CPUExecutionProvider"],
|
| 118 |
+
)
|
| 119 |
+
|
| 120 |
+
# kokoro-onnx constructs its own session. Inject the tuned session only
|
| 121 |
+
# for construction, then restore the module factory.
|
| 122 |
+
import kokoro_onnx
|
| 123 |
+
|
| 124 |
+
original = kokoro_onnx.create_session
|
| 125 |
+
kokoro_onnx.create_session = lambda _path: session
|
| 126 |
+
try:
|
| 127 |
+
self._kokoro = Kokoro(str(self.model_path), str(self.voices_path))
|
| 128 |
+
finally:
|
| 129 |
+
kokoro_onnx.create_session = original
|
| 130 |
+
|
| 131 |
+
self._styles = load_styles(self.voices_dir)
|
| 132 |
+
self._voices = sorted(set(self._kokoro.get_voices()) | set(self._styles))
|
| 133 |
+
self._lock = threading.Lock()
|
| 134 |
+
self._intra_threads = count
|
| 135 |
+
|
| 136 |
+
@property
|
| 137 |
+
def voices(self) -> list[str]:
|
| 138 |
+
return list(self._voices)
|
| 139 |
+
|
| 140 |
+
@property
|
| 141 |
+
def custom_voices(self) -> list[str]:
|
| 142 |
+
return sorted(self._styles)
|
| 143 |
+
|
| 144 |
+
@property
|
| 145 |
+
def intra_threads(self) -> int:
|
| 146 |
+
return self._intra_threads
|
| 147 |
+
|
| 148 |
+
def synthesize(
|
| 149 |
+
self,
|
| 150 |
+
text: str,
|
| 151 |
+
*,
|
| 152 |
+
voice: str = DEFAULT_VOICE,
|
| 153 |
+
speed: float = DEFAULT_SPEED,
|
| 154 |
+
lang: str = DEFAULT_LANG,
|
| 155 |
+
) -> SynthResult:
|
| 156 |
+
text = text.strip()
|
| 157 |
+
if not text:
|
| 158 |
+
raise ValueError("text is empty")
|
| 159 |
+
if len(text) > 5000:
|
| 160 |
+
raise ValueError("text exceeds 5000 characters")
|
| 161 |
+
if voice not in self._voices:
|
| 162 |
+
raise ValueError(
|
| 163 |
+
f"unknown voice {voice!r}; available: {', '.join(self._voices)}"
|
| 164 |
+
)
|
| 165 |
+
if not 0.5 <= speed <= 2.0:
|
| 166 |
+
raise ValueError("speed must be between 0.5 and 2.0")
|
| 167 |
+
selected: str | np.ndarray = self._styles.get(voice, voice)
|
| 168 |
+
with self._lock:
|
| 169 |
+
samples, sample_rate = self._kokoro.create(
|
| 170 |
+
text,
|
| 171 |
+
voice=selected,
|
| 172 |
+
speed=speed,
|
| 173 |
+
lang=lang,
|
| 174 |
+
)
|
| 175 |
+
audio = np.asarray(samples, dtype=np.float32)
|
| 176 |
+
return SynthResult(
|
| 177 |
+
wav=wav_bytes(audio, int(sample_rate)),
|
| 178 |
+
sample_rate=int(sample_rate),
|
| 179 |
+
voice=voice,
|
| 180 |
+
seconds=round(len(audio) / int(sample_rate), 3),
|
| 181 |
+
)
|
| 182 |
+
|
| 183 |
+
|
| 184 |
+
def wav_bytes(samples: np.ndarray, sample_rate: int) -> bytes:
|
| 185 |
+
"""Encode mono float32 samples as a 16-bit PCM WAV."""
|
| 186 |
+
clipped = np.clip(np.asarray(samples, dtype=np.float32), -1.0, 1.0)
|
| 187 |
+
pcm = (clipped * 32767.0).astype("<i2").tobytes()
|
| 188 |
+
buffer = io.BytesIO()
|
| 189 |
+
with wave.open(buffer, "wb") as handle:
|
| 190 |
+
handle.setnchannels(1)
|
| 191 |
+
handle.setsampwidth(2)
|
| 192 |
+
handle.setframerate(sample_rate)
|
| 193 |
+
handle.writeframes(pcm)
|
| 194 |
+
return buffer.getvalue()
|
jarvis_lvm/text.py
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Small, predictable text cleanup for spoken assistant output."""
|
| 2 |
+
|
| 3 |
+
from __future__ import annotations
|
| 4 |
+
|
| 5 |
+
import re
|
| 6 |
+
|
| 7 |
+
_LEXICON = (
|
| 8 |
+
(re.compile(r"\bJARVIS\b"), "Jarvis"),
|
| 9 |
+
(re.compile(r"\bAI\b"), "A.I."),
|
| 10 |
+
(re.compile(r"\bAPI\b"), "A.P.I."),
|
| 11 |
+
(re.compile(r"\bGPU\b"), "G.P.U."),
|
| 12 |
+
(re.compile(r"\bCPU\b"), "C.P.U."),
|
| 13 |
+
(re.compile(r"\bSQL\b"), "sequel"),
|
| 14 |
+
)
|
| 15 |
+
|
| 16 |
+
_FENCED_CODE = re.compile(r"```.*?```", re.DOTALL)
|
| 17 |
+
_INLINE_CODE = re.compile(r"`([^`]+)`")
|
| 18 |
+
_MARKDOWN_LINK = re.compile(r"\[([^\]]+)\]\([^)]+\)")
|
| 19 |
+
_EMPHASIS = re.compile(r"[*_]{1,3}([^*_]+)[*_]{1,3}")
|
| 20 |
+
_WHITESPACE = re.compile(r"\s+")
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
def normalize_text(text: str) -> str:
|
| 24 |
+
"""Remove non-spoken markup and normalize a few acronyms.
|
| 25 |
+
|
| 26 |
+
This is deliberately conservative: it does not rewrite numbers, dates, or
|
| 27 |
+
arbitrary prose. Use ``--raw`` to pass text through untouched.
|
| 28 |
+
"""
|
| 29 |
+
text = _FENCED_CODE.sub(" ", text)
|
| 30 |
+
text = _INLINE_CODE.sub(r"\1", text)
|
| 31 |
+
text = _MARKDOWN_LINK.sub(r"\1", text)
|
| 32 |
+
text = _EMPHASIS.sub(r"\1", text)
|
| 33 |
+
for pattern, replacement in _LEXICON:
|
| 34 |
+
text = pattern.sub(replacement, text)
|
| 35 |
+
return _WHITESPACE.sub(" ", text).strip()
|
manifest.json
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"schema_version": 1,
|
| 3 |
+
"name": "Jarvis LVM",
|
| 4 |
+
"version": "1.0.0",
|
| 5 |
+
"description": "Local, CPU-first JARVIS-inspired British butler voice built on Kokoro-82M.",
|
| 6 |
+
"license": "Apache-2.0",
|
| 7 |
+
"created_at": "2026-11-25T22:02:25.981197+00:00",
|
| 8 |
+
"engine": {
|
| 9 |
+
"package": "kokoro-onnx",
|
| 10 |
+
"package_version": "0.6.1",
|
| 11 |
+
"runtime": "onnxruntime",
|
| 12 |
+
"provider": "CPUExecutionProvider",
|
| 13 |
+
"model_format": "onnx-int8",
|
| 14 |
+
"language": "en-gb",
|
| 15 |
+
"sample_rate": 24000
|
| 16 |
+
},
|
| 17 |
+
"defaults": {
|
| 18 |
+
"voice": "jarvis-classic",
|
| 19 |
+
"speed": 0.95,
|
| 20 |
+
"lang": "en-gb"
|
| 21 |
+
},
|
| 22 |
+
"presets": {
|
| 23 |
+
"jarvis-classic": {
|
| 24 |
+
"file": "voices/jarvis-classic.npy",
|
| 25 |
+
"recipe": {
|
| 26 |
+
"bm_george": 0.25,
|
| 27 |
+
"bm_daniel": 0.35,
|
| 28 |
+
"bm_lewis": 0.4
|
| 29 |
+
},
|
| 30 |
+
"median_f0_hz": 113.0,
|
| 31 |
+
"median_f1_hz": 589,
|
| 32 |
+
"median_f2_hz": 1928
|
| 33 |
+
},
|
| 34 |
+
"jarvis-deep": {
|
| 35 |
+
"file": "voices/jarvis-deep.npy",
|
| 36 |
+
"recipe": {
|
| 37 |
+
"bm_lewis": 0.5,
|
| 38 |
+
"bm_daniel": 0.5
|
| 39 |
+
},
|
| 40 |
+
"median_f0_hz": 105.0,
|
| 41 |
+
"median_f1_hz": 589,
|
| 42 |
+
"median_f2_hz": 1810
|
| 43 |
+
}
|
| 44 |
+
},
|
| 45 |
+
"assets": {
|
| 46 |
+
"model": "models/kokoro-v1.0.int8.onnx",
|
| 47 |
+
"voices": "voices/voices-v1.0.bin"
|
| 48 |
+
},
|
| 49 |
+
"performance": {
|
| 50 |
+
"host": "Windows 11, 6 physical CPU cores, ONNX Runtime 1.32",
|
| 51 |
+
"load_seconds": 0.77,
|
| 52 |
+
"synthesis_seconds": 3.9,
|
| 53 |
+
"audio_seconds": 8.789,
|
| 54 |
+
"real_time_factor": 0.44,
|
| 55 |
+
"rss_mib": 574,
|
| 56 |
+
"intra_threads": 6
|
| 57 |
+
},
|
| 58 |
+
"files": {
|
| 59 |
+
".gitattributes": {
|
| 60 |
+
"bytes": 169,
|
| 61 |
+
"sha256": "7a892777977f2cda519c5c575539d3890139af497499f152e8e09269cd106184"
|
| 62 |
+
},
|
| 63 |
+
"jarvis_lvm/__init__.py": {
|
| 64 |
+
"bytes": 328,
|
| 65 |
+
"sha256": "d04b272cc667ae658cf47975908c95dcfaa545373e436d92902d2aa28d9e3a2a"
|
| 66 |
+
},
|
| 67 |
+
"jarvis_lvm/__main__.py": {
|
| 68 |
+
"bytes": 3575,
|
| 69 |
+
"sha256": "283e043af8c3d644f91a6f375765e4654de922a16691f3912512408742794613"
|
| 70 |
+
},
|
| 71 |
+
"jarvis_lvm/engine.py": {
|
| 72 |
+
"bytes": 6233,
|
| 73 |
+
"sha256": "15782731ad2fb94202789d4ac5366a43f04eba9205cd4a8283adcf28f0981fc6"
|
| 74 |
+
},
|
| 75 |
+
"jarvis_lvm/text.py": {
|
| 76 |
+
"bytes": 1154,
|
| 77 |
+
"sha256": "683807cba857233c45722858d56ace49c529fd9125b5cebf2a557d82f5e1657a"
|
| 78 |
+
},
|
| 79 |
+
"LICENSE": {
|
| 80 |
+
"bytes": 11358,
|
| 81 |
+
"sha256": "cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30"
|
| 82 |
+
},
|
| 83 |
+
"models/kokoro-v1.0.int8.onnx": {
|
| 84 |
+
"bytes": 92361271,
|
| 85 |
+
"sha256": "6e742170d309016e5891a994e1ce1559c702a2ccd0075e67ef7157974f6406cb"
|
| 86 |
+
},
|
| 87 |
+
"NOTICE": {
|
| 88 |
+
"bytes": 1063,
|
| 89 |
+
"sha256": "d1157c1c7d7c64381fe945354181f8e2f249e6d8339db4e2ccae2820285eef23"
|
| 90 |
+
},
|
| 91 |
+
"pyproject.toml": {
|
| 92 |
+
"bytes": 659,
|
| 93 |
+
"sha256": "ea6f4fab0e9913ebe4a8b93a28013a7446a18b162815e4136cb8e1c0398fd811"
|
| 94 |
+
},
|
| 95 |
+
"README.md": {
|
| 96 |
+
"bytes": 9671,
|
| 97 |
+
"sha256": "8a498491c7cd1e768a90194265c544da0f1d1825865c059a1c02d3e872792665"
|
| 98 |
+
},
|
| 99 |
+
"requirements.txt": {
|
| 100 |
+
"bytes": 61,
|
| 101 |
+
"sha256": "b9e5cad68e9396c91160eb241d707e9ce699fe7429654626161a39e2b0ecadd5"
|
| 102 |
+
},
|
| 103 |
+
"samples/jarvis-classic-briefing.wav": {
|
| 104 |
+
"bytes": 333868,
|
| 105 |
+
"sha256": "57ee12f24a44e6905712a90ceefb43f0a225771dad8d466998976bfeb51218be"
|
| 106 |
+
},
|
| 107 |
+
"samples/jarvis-classic-greeting.wav": {
|
| 108 |
+
"bytes": 210988,
|
| 109 |
+
"sha256": "e2d8e07a6f8fc4974ae2af583a3864e915d0805ca8ef46a5023bc8b50599abf3"
|
| 110 |
+
},
|
| 111 |
+
"samples/jarvis-classic-status.wav": {
|
| 112 |
+
"bytes": 244780,
|
| 113 |
+
"sha256": "0799ab489d716f4e9de165a1ff29a4fca5584aafbdce395e330c58e1af7213b3"
|
| 114 |
+
},
|
| 115 |
+
"samples/jarvis-deep-briefing.wav": {
|
| 116 |
+
"bytes": 326700,
|
| 117 |
+
"sha256": "89b794919c592f39c5a3cf63391bc785b33bd00d71f98afb92324fb22c43c026"
|
| 118 |
+
},
|
| 119 |
+
"samples/jarvis-deep-greeting.wav": {
|
| 120 |
+
"bytes": 206892,
|
| 121 |
+
"sha256": "553209a3df15e45cecf476d4de3da2f16ef30c1b51d49b3feb0328a39a01e603"
|
| 122 |
+
},
|
| 123 |
+
"samples/jarvis-deep-status.wav": {
|
| 124 |
+
"bytes": 238636,
|
| 125 |
+
"sha256": "d1aec293acc728b62f954be1a4f379bd55af8e59f664ad0d8f81bed1b12c546d"
|
| 126 |
+
},
|
| 127 |
+
"scripts/build_styles.py": {
|
| 128 |
+
"bytes": 1719,
|
| 129 |
+
"sha256": "927d3708700350efa9e3fedb1aac6cdf9dff17b24c68ac0cbc05b968fa9d5998"
|
| 130 |
+
},
|
| 131 |
+
"voices/jarvis-classic.npy": {
|
| 132 |
+
"bytes": 522368,
|
| 133 |
+
"sha256": "3dfb704fed377720ae0c75c8f3122330a3973181ed7cfb5494d7fbe69a2bff50"
|
| 134 |
+
},
|
| 135 |
+
"voices/jarvis-deep.npy": {
|
| 136 |
+
"bytes": 522368,
|
| 137 |
+
"sha256": "13b1e8f3c82d1ed28c59ad0490ccf509c2d41ada576f8fef70f49cb64d0f7050"
|
| 138 |
+
},
|
| 139 |
+
"voices/README.md": {
|
| 140 |
+
"bytes": 1112,
|
| 141 |
+
"sha256": "ee7928a253b6b3f92e42345348140743855d1ca798167f051e1a0ca2006b7a7c"
|
| 142 |
+
},
|
| 143 |
+
"voices/voices-v1.0.bin": {
|
| 144 |
+
"bytes": 28214398,
|
| 145 |
+
"sha256": "bca610b8308e8d99f32e6fe4197e7ec01679264efed0cac9140fe9c29f1fbf7d"
|
| 146 |
+
}
|
| 147 |
+
}
|
| 148 |
+
}
|
models/kokoro-v1.0.int8.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6e742170d309016e5891a994e1ce1559c702a2ccd0075e67ef7157974f6406cb
|
| 3 |
+
size 92361271
|
pyproject.toml
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[build-system]
|
| 2 |
+
requires = ["hatchling"]
|
| 3 |
+
build-backend = "hatchling.build"
|
| 4 |
+
|
| 5 |
+
[project]
|
| 6 |
+
name = "jarvis-lvm"
|
| 7 |
+
version = "1.0.0"
|
| 8 |
+
description = "Local, CPU-first JARVIS-inspired Kokoro voice model"
|
| 9 |
+
readme = "README.md"
|
| 10 |
+
requires-python = ">=3.10,<3.13"
|
| 11 |
+
license = { text = "Apache-2.0" }
|
| 12 |
+
authors = [{ name = "StealthAI" }]
|
| 13 |
+
keywords = ["tts", "voice", "kokoro", "local", "jarvis", "onnx"]
|
| 14 |
+
dependencies = [
|
| 15 |
+
"kokoro-onnx>=0.6.1",
|
| 16 |
+
"numpy>=1.24",
|
| 17 |
+
"onnxruntime>=1.18",
|
| 18 |
+
"psutil>=5.9",
|
| 19 |
+
]
|
| 20 |
+
|
| 21 |
+
[project.optional-dependencies]
|
| 22 |
+
dev = ["pytest>=8"]
|
| 23 |
+
|
| 24 |
+
[project.scripts]
|
| 25 |
+
jarvis-lvm = "jarvis_lvm.__main__:main"
|
| 26 |
+
|
| 27 |
+
[tool.hatch.build.targets.wheel]
|
| 28 |
+
packages = ["jarvis_lvm"]
|
requirements.txt
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
kokoro-onnx>=0.6.1
|
| 2 |
+
numpy>=1.24
|
| 3 |
+
onnxruntime>=1.18
|
| 4 |
+
psutil>=5.9
|
samples/jarvis-classic-briefing.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:57ee12f24a44e6905712a90ceefb43f0a225771dad8d466998976bfeb51218be
|
| 3 |
+
size 333868
|
samples/jarvis-classic-greeting.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e2d8e07a6f8fc4974ae2af583a3864e915d0805ca8ef46a5023bc8b50599abf3
|
| 3 |
+
size 210988
|
samples/jarvis-classic-status.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0799ab489d716f4e9de165a1ff29a4fca5584aafbdce395e330c58e1af7213b3
|
| 3 |
+
size 244780
|
samples/jarvis-deep-briefing.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:89b794919c592f39c5a3cf63391bc785b33bd00d71f98afb92324fb22c43c026
|
| 3 |
+
size 326700
|
samples/jarvis-deep-greeting.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:553209a3df15e45cecf476d4de3da2f16ef30c1b51d49b3feb0328a39a01e603
|
| 3 |
+
size 206892
|
samples/jarvis-deep-status.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d1aec293acc728b62f954be1a4f379bd55af8e59f664ad0d8f81bed1b12c546d
|
| 3 |
+
size 238636
|
scripts/build_styles.py
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Rebuild the Jarvis LVM style vectors from Kokoro's built-in voices.
|
| 3 |
+
|
| 4 |
+
The package ships the resulting .npy files. This script documents exactly how
|
| 5 |
+
they were derived and can be rerun after a Kokoro voices update:
|
| 6 |
+
|
| 7 |
+
python scripts/build_styles.py --voices voices/voices-v1.0.bin --out voices
|
| 8 |
+
"""
|
| 9 |
+
|
| 10 |
+
from __future__ import annotations
|
| 11 |
+
|
| 12 |
+
import argparse
|
| 13 |
+
from pathlib import Path
|
| 14 |
+
|
| 15 |
+
import numpy as np
|
| 16 |
+
|
| 17 |
+
RECIPES = {
|
| 18 |
+
"jarvis-classic": {
|
| 19 |
+
"bm_george": 0.25,
|
| 20 |
+
"bm_daniel": 0.35,
|
| 21 |
+
"bm_lewis": 0.40,
|
| 22 |
+
},
|
| 23 |
+
"jarvis-deep": {
|
| 24 |
+
"bm_lewis": 0.50,
|
| 25 |
+
"bm_daniel": 0.50,
|
| 26 |
+
},
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
def build(voices_path: Path, out_dir: Path) -> None:
|
| 31 |
+
source = np.load(voices_path)
|
| 32 |
+
out_dir.mkdir(parents=True, exist_ok=True)
|
| 33 |
+
for name, weights in RECIPES.items():
|
| 34 |
+
missing = set(weights) - set(source.files)
|
| 35 |
+
if missing:
|
| 36 |
+
raise SystemExit(f"{voices_path} is missing: {sorted(missing)}")
|
| 37 |
+
total = sum(weights.values())
|
| 38 |
+
style = sum(
|
| 39 |
+
source[voice] * (weight / total)
|
| 40 |
+
for voice, weight in weights.items()
|
| 41 |
+
).astype(np.float32)
|
| 42 |
+
destination = out_dir / f"{name}.npy"
|
| 43 |
+
np.save(destination, style)
|
| 44 |
+
print(
|
| 45 |
+
f"{destination} shape={style.shape} dtype={style.dtype} "
|
| 46 |
+
f"weights={weights}"
|
| 47 |
+
)
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
def main() -> None:
|
| 51 |
+
parser = argparse.ArgumentParser(description=__doc__)
|
| 52 |
+
parser.add_argument(
|
| 53 |
+
"--voices",
|
| 54 |
+
type=Path,
|
| 55 |
+
default=Path("voices/voices-v1.0.bin"),
|
| 56 |
+
)
|
| 57 |
+
parser.add_argument("--out", type=Path, default=Path("voices"))
|
| 58 |
+
args = parser.parse_args()
|
| 59 |
+
build(args.voices, args.out)
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
if __name__ == "__main__":
|
| 63 |
+
main()
|
voices/README.md
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Voice presets
|
| 2 |
+
|
| 3 |
+
These are Kokoro style vectors, not cloned actor voices.
|
| 4 |
+
|
| 5 |
+
| File | Preset | Recipe | Median F0 |
|
| 6 |
+
|------|--------|--------|-----------|
|
| 7 |
+
| `jarvis-classic.npy` | `jarvis-classic` | 25% `bm_george` + 35% `bm_daniel` + 40% `bm_lewis` | ~113 Hz |
|
| 8 |
+
| `jarvis-deep.npy` | `jarvis-deep` | 50% `bm_lewis` + 50% `bm_daniel` | ~105 Hz |
|
| 9 |
+
|
| 10 |
+
Both vectors were generated from the permissively licensed Kokoro
|
| 11 |
+
`voices-v1.0.bin` bundle. `jarvis-classic` is the default: a lower, measured
|
| 12 |
+
British male timbre than stock `bm_george`, while retaining clear diction.
|
| 13 |
+
`jarvis-deep` is available for a slower, heavier delivery.
|
| 14 |
+
|
| 15 |
+
The exact recipe is in `../scripts/build_styles.py`. The source voices are
|
| 16 |
+
Kokoro's built-ins:
|
| 17 |
+
|
| 18 |
+
- `bm_george` — authoritative British male
|
| 19 |
+
- `bm_daniel` — formal British male
|
| 20 |
+
- `bm_lewis` — deeper, darker British male
|
| 21 |
+
|
| 22 |
+
`voices-v1.0.bin` is included so the package is self-contained. It contains all
|
| 23 |
+
54 Kokoro v1.0 voices.
|
| 24 |
+
|
| 25 |
+
This is a synthetic, JARVIS-inspired butler voice. It is not Paul Bettany, is
|
| 26 |
+
not trained on any Marvel film audio, and is not affiliated with Marvel or
|
| 27 |
+
Disney.
|
voices/jarvis-classic.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3dfb704fed377720ae0c75c8f3122330a3973181ed7cfb5494d7fbe69a2bff50
|
| 3 |
+
size 522368
|
voices/jarvis-deep.npy
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:13b1e8f3c82d1ed28c59ad0490ccf509c2d41ada576f8fef70f49cb64d0f7050
|
| 3 |
+
size 522368
|
voices/voices-v1.0.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bca610b8308e8d99f32e6fe4197e7ec01679264efed0cac9140fe9c29f1fbf7d
|
| 3 |
+
size 28214398
|