Skip to content

Commit b955b9d

Browse files
authored
feat: supertonic tts plugin (#45)
* feat: supertonic tts plugin * fix: add missing license header
1 parent 603583e commit b955b9d

File tree

16 files changed

+3265
-2
lines changed

16 files changed

+3265
-2
lines changed

justfile

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ lint-plugins:
261261
@cd plugins/native/matcha && cargo fmt -- --check && cargo clippy -- -D warnings
262262
@cd plugins/native/pocket-tts && cargo fmt -- --check && cargo clippy -- -D warnings
263263
@cd plugins/native/nllb && cargo fmt -- --check && CMAKE_ARGS="-DCMAKE_INSTALL_PREFIX=$$(pwd)/target/cmake-install" cargo clippy -- -D warnings
264+
@cd plugins/native/supertonic && cargo fmt -- --check && cargo clippy -- -D warnings
264265
@echo "✓ All native plugins passed linting"
265266

266267
# Auto-fix formatting and linting issues in native plugins
@@ -274,6 +275,7 @@ fix-plugins:
274275
@cd plugins/native/matcha && cargo fmt && cargo clippy --fix --allow-dirty --allow-staged -- -D warnings
275276
@cd plugins/native/pocket-tts && cargo fmt && cargo clippy --fix --allow-dirty --allow-staged -- -D warnings
276277
@cd plugins/native/nllb && cargo fmt && CMAKE_ARGS="-DCMAKE_INSTALL_PREFIX=$$(pwd)/target/cmake-install" cargo clippy --fix --allow-dirty --allow-staged -- -D warnings
278+
@cd plugins/native/supertonic && cargo fmt && cargo clippy --fix --allow-dirty --allow-staged -- -D warnings
277279
@echo "✓ All native plugins fixed"
278280

279281
# --- Profiling ---
@@ -801,12 +803,49 @@ upload-helsinki-plugin: build-plugin-native-helsinki
801803
@curl -X POST -F plugin=@target/release/libhelsinki.so \
802804
http://127.0.0.1:4545/api/v1/plugins
803805

806+
# Download Supertonic TTS models
807+
download-supertonic-models:
808+
@echo "Downloading Supertonic TTS models..."
809+
@mkdir -p models
810+
@if [ -f models/supertonic-v2-onnx.tar.bz2 ]; then \
811+
echo "✓ Supertonic archive already exists at models/supertonic-v2-onnx.tar.bz2"; \
812+
else \
813+
echo "Downloading supertonic-v2-onnx.tar.bz2..." && \
814+
curl -L -o models/supertonic-v2-onnx.tar.bz2 \
815+
https://huggingface.co/streamkit/supertonic-models/resolve/main/supertonic-v2-onnx.tar.bz2 && \
816+
echo "✓ Supertonic archive downloaded"; \
817+
fi
818+
@if [ -d models/supertonic-v2-onnx ]; then \
819+
echo "✓ Supertonic models already extracted at models/supertonic-v2-onnx"; \
820+
else \
821+
echo "Extracting models..." && \
822+
cd models && tar xf supertonic-v2-onnx.tar.bz2 && \
823+
echo "✓ Supertonic v2 models ready at models/supertonic-v2-onnx (5 languages, 10 voices)"; \
824+
fi
825+
826+
# Setup Supertonic TTS (download models)
827+
setup-supertonic: download-supertonic-models
828+
@echo "✓ Supertonic TTS setup complete!"
829+
830+
# Build native Supertonic TTS plugin
831+
[working-directory: 'plugins/native/supertonic']
832+
build-plugin-native-supertonic:
833+
@echo "Building native Supertonic TTS plugin..."
834+
@cargo build --release
835+
836+
# Upload Supertonic plugin to running server
837+
[working-directory: 'plugins/native/supertonic']
838+
upload-supertonic-plugin: build-plugin-native-supertonic
839+
@echo "Uploading Supertonic plugin to server..."
840+
@curl -X POST -F plugin=@target/release/libsupertonic.so \
841+
http://127.0.0.1:4545/api/v1/plugins
842+
804843
# Build specific native plugin by name
805844
build-plugin-native name:
806845
@just build-plugin-native-{{name}}
807846

808847
# Build all native plugin examples
809-
build-plugins-native: build-plugin-native-gain build-plugin-native-whisper build-plugin-native-kokoro build-plugin-native-piper build-plugin-native-matcha build-plugin-native-pocket-tts build-plugin-native-sensevoice build-plugin-native-nllb build-plugin-native-vad build-plugin-native-helsinki
848+
build-plugins-native: build-plugin-native-gain build-plugin-native-whisper build-plugin-native-kokoro build-plugin-native-piper build-plugin-native-matcha build-plugin-native-pocket-tts build-plugin-native-sensevoice build-plugin-native-nllb build-plugin-native-vad build-plugin-native-helsinki build-plugin-native-supertonic
810849

811850
## Combined
812851

@@ -840,7 +879,7 @@ copy-plugins-native:
840879
cp examples/plugins/gain-native/target/release/libgain_plugin_native.* .plugins/native/ 2>/dev/null || true
841880

842881
# Official native plugins (repo-local)
843-
for name in whisper kokoro piper matcha vad sensevoice nllb helsinki; do
882+
for name in whisper kokoro piper matcha vad sensevoice nllb helsinki supertonic; do
844883
for f in \
845884
plugins/native/"$name"/target/release/lib"$name".so \
846885
plugins/native/"$name"/target/release/lib"$name".so.* \

marketplace/official-plugins.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,34 @@
238238
}
239239
]
240240
},
241+
{
242+
"id": "supertonic",
243+
"name": "Supertonic",
244+
"version": "0.1.0",
245+
"node_kind": "supertonic",
246+
"kind": "native",
247+
"entrypoint": "libsupertonic.so",
248+
"artifact": "plugins/native/supertonic/target/release/libsupertonic.so",
249+
"description": "Multilingual TTS using Supertonic (66M params, 5 languages, up to 167x real-time)",
250+
"license": "MPL-2.0",
251+
"models": [
252+
{
253+
"id": "supertonic-v2-onnx",
254+
"name": "Supertonic v2 ONNX models",
255+
"default": true,
256+
"source": "huggingface",
257+
"repo_id": "streamkit/supertonic-models",
258+
"revision": "main",
259+
"files": [
260+
"supertonic-v2-onnx.tar.bz2"
261+
],
262+
"expected_size_bytes": 244451376,
263+
"license": "MIT",
264+
"license_url": "https://github.com/supertone-inc/supertonic/blob/main/LICENSE",
265+
"sha256": "29e18bfdcbfbdd8bef25204b19be21d13fda36d4e66fe31c74e2a01dad457cec"
266+
}
267+
]
268+
},
241269
{
242270
"id": "vad",
243271
"name": "VAD",

0 commit comments

Comments
 (0)