This project sends one text prompt to the same Audio8 TTS model on Modal and Beam, returns WAV audio from each provider, and displays comparable latency instrumentation. It also includes an independent Beam runner for ResembleAI/chatterbox.
The model is configured as Audio8/Audio8-TTS-Preview-0.6b. It is a 0.6B multilingual TTS checkpoint with a bundled 44.1 kHz codec. The model card recommends Python 3.10+ and a CUDA-capable GPU, and documents native Transformers inference with trust_remote_code=True.
/./api/synthesize route that calls Modal and Beam concurrently./api/chatterbox route for the Chatterbox Beam endpoint.@modal.enter, model warmup, HF Volume caching, CPU/GPU memory snapshot support, and configurable warm containers.on_start, persistent Hugging Face caches, checkpoint restore, and keep-warm behavior.npm install
cp .env.example .env.local
npm run dev
Open http://localhost:3000. Until provider URLs and tokens are configured, the UI intentionally shows each provider as unavailable instead of silently returning fake audio.
Set these values in .env.local or the deployment platform's secret store:
AUDIO8_MODEL_ID=Audio8/Audio8-TTS-Preview-0.6b
CHATTERBOX_MODEL_ID=ResembleAI/chatterbox
MODAL_GPU=A100
BEAM_GPU=RTX4090
CHATTERBOX_BEAM_GPU=RTX4090
BEAM_CHECKPOINT_ENABLED=1
CHATTERBOX_BEAM_CHECKPOINT_ENABLED=1
BEAM_MIN_CONTAINERS=0
BEAM_MAX_CONTAINERS=3
BEAM_TASKS_PER_CONTAINER=1
CHATTERBOX_BEAM_MIN_CONTAINERS=0
CHATTERBOX_BEAM_MAX_CONTAINERS=3
CHATTERBOX_BEAM_TASKS_PER_CONTAINER=1
MODAL_ENDPOINT_URL=https://...
MODAL_PROXY_TOKEN=wk-<id>.ws-<secret>
BEAM_ENDPOINT_URL=https://...
CHATTERBOX_BEAM_ENDPOINT_URL=https://...
BEAM_TOKEN=...
The browser only calls /api/synthesize; none of these credentials are exposed to client JavaScript.
Install and authenticate with the Modal CLI, then deploy from the repository root:
python3 -m pip install modal
modal setup
modal deploy providers/modal/app.py
The endpoint URL printed by Modal becomes MODAL_ENDPOINT_URL. The runtime expects the combined Modal proxy bearer token format wk-<id>.ws-<secret> as MODAL_PROXY_TOKEN.
Useful optional environment variables when deploying:
MODAL_GPU=A100
MODAL_ENABLE_GPU_SNAPSHOT=1
MODAL_MIN_CONTAINERS=0
MODAL_MAX_CONTAINERS=3
MODAL_SCALEDOWN_WINDOW_SECONDS=300
If GPU memory snapshots are incompatible with the final model image or GPU, redeploy with MODAL_ENABLE_GPU_SNAPSHOT=0; CPU memory snapshots and warm-container controls remain available.
Install and authenticate with Beam, then deploy from the repository root:
python3 -m pip install beam-client
beam configure default --token "$BEAM_TOKEN"
beam deploy providers/beam/app.py:predict
beam deploy providers/beam/chatterbox_app.py:predict
The Audio8 endpoint URL becomes BEAM_ENDPOINT_URL; the Chatterbox endpoint URL becomes CHATTERBOX_BEAM_ENDPOINT_URL. Both endpoints are private and the app sends the same Beam bearer token server-side.
Beam checkpoint restore is enabled for both RTX 4090 endpoints. Beam captures the container after on_start has loaded and warmed the model, then restores that state for later scale-from-zero boots. The initial capture can take up to three minutes and distribution can take up to five minutes; redeploy after changing the GPU or model image. Set the two *_MIN_CONTAINERS values to 1 when the goal is near-zero latency at the cost of continuously billed idle GPUs.
If Beam reports that no RTX 4090 capacity is available, the deployment may still be created but requests will fail before a container starts. Reserve an RTX 4090 pool with beam machine reserve --gpu RTX4090 --ttl 2h --yes only when the spend is acceptable, or use another supported GPU with available capacity.
Chatterbox installs its runtime dependencies without the package’s older pinned PyTorch 2.6 build. The endpoint instead uses PyTorch 2.7.1 with CUDA 12.8, which supports the RTX 4090 deployment.
The provider containers return timings from a monotonic clock. coldStart is true for the first user request handled by a newly initialized container. containerStartToAudioMs measures from the provider process start to WAV bytes being ready. modelLoadMs measures model initialization during container startup; on snapshot/checkpoint restores it represents the initialization cost captured for the restored deployment. gatewayRoundTripMs includes the network path between the Next.js server and the provider. networkOverheadMs is an approximation: gateway round trip minus provider-reported server time.
The first deployment should be benchmarked with at least two runs per provider: one after scale-to-zero and one while the container is warm. Provider scheduling, GPU availability, and network distance can change these measurements.
7 commits
TypeScript
47.7%
Python
34.1%
CSS
18.0%
This project sends one text prompt to the same Audio8 TTS model on Modal and Beam, returns WAV audio from each provider, and displays comparable latency instrumentation. It also includes an independent Beam runner for ResembleAI/chatterbox.
The model is configured as Audio8/Audio8-TTS-Preview-0.6b. It is a 0.6B multilingual TTS checkpoint with a bundled 44.1 kHz codec. The model card recommends Python 3.10+ and a CUDA-capable GPU, and documents native Transformers inference with trust_remote_code=True.
/./api/synthesize route that calls Modal and Beam concurrently./api/chatterbox route for the Chatterbox Beam endpoint.@modal.enter, model warmup, HF Volume caching, CPU/GPU memory snapshot support, and configurable warm containers.on_start, persistent Hugging Face caches, checkpoint restore, and keep-warm behavior.npm install
cp .env.example .env.local
npm run dev
Open http://localhost:3000. Until provider URLs and tokens are configured, the UI intentionally shows each provider as unavailable instead of silently returning fake audio.
Set these values in .env.local or the deployment platform's secret store:
AUDIO8_MODEL_ID=Audio8/Audio8-TTS-Preview-0.6b
CHATTERBOX_MODEL_ID=ResembleAI/chatterbox
MODAL_GPU=A100
BEAM_GPU=RTX4090
CHATTERBOX_BEAM_GPU=RTX4090
BEAM_CHECKPOINT_ENABLED=1
CHATTERBOX_BEAM_CHECKPOINT_ENABLED=1
BEAM_MIN_CONTAINERS=0
BEAM_MAX_CONTAINERS=3
BEAM_TASKS_PER_CONTAINER=1
CHATTERBOX_BEAM_MIN_CONTAINERS=0
CHATTERBOX_BEAM_MAX_CONTAINERS=3
CHATTERBOX_BEAM_TASKS_PER_CONTAINER=1
MODAL_ENDPOINT_URL=https://...
MODAL_PROXY_TOKEN=wk-<id>.ws-<secret>
BEAM_ENDPOINT_URL=https://...
CHATTERBOX_BEAM_ENDPOINT_URL=https://...
BEAM_TOKEN=...
The browser only calls /api/synthesize; none of these credentials are exposed to client JavaScript.
Install and authenticate with the Modal CLI, then deploy from the repository root:
python3 -m pip install modal
modal setup
modal deploy providers/modal/app.py
The endpoint URL printed by Modal becomes MODAL_ENDPOINT_URL. The runtime expects the combined Modal proxy bearer token format wk-<id>.ws-<secret> as MODAL_PROXY_TOKEN.
Useful optional environment variables when deploying:
MODAL_GPU=A100
MODAL_ENABLE_GPU_SNAPSHOT=1
MODAL_MIN_CONTAINERS=0
MODAL_MAX_CONTAINERS=3
MODAL_SCALEDOWN_WINDOW_SECONDS=300
If GPU memory snapshots are incompatible with the final model image or GPU, redeploy with MODAL_ENABLE_GPU_SNAPSHOT=0; CPU memory snapshots and warm-container controls remain available.
Install and authenticate with Beam, then deploy from the repository root:
python3 -m pip install beam-client
beam configure default --token "$BEAM_TOKEN"
beam deploy providers/beam/app.py:predict
beam deploy providers/beam/chatterbox_app.py:predict
The Audio8 endpoint URL becomes BEAM_ENDPOINT_URL; the Chatterbox endpoint URL becomes CHATTERBOX_BEAM_ENDPOINT_URL. Both endpoints are private and the app sends the same Beam bearer token server-side.
Beam checkpoint restore is enabled for both RTX 4090 endpoints. Beam captures the container after on_start has loaded and warmed the model, then restores that state for later scale-from-zero boots. The initial capture can take up to three minutes and distribution can take up to five minutes; redeploy after changing the GPU or model image. Set the two *_MIN_CONTAINERS values to 1 when the goal is near-zero latency at the cost of continuously billed idle GPUs.
If Beam reports that no RTX 4090 capacity is available, the deployment may still be created but requests will fail before a container starts. Reserve an RTX 4090 pool with beam machine reserve --gpu RTX4090 --ttl 2h --yes only when the spend is acceptable, or use another supported GPU with available capacity.
Chatterbox installs its runtime dependencies without the package’s older pinned PyTorch 2.6 build. The endpoint instead uses PyTorch 2.7.1 with CUDA 12.8, which supports the RTX 4090 deployment.
The provider containers return timings from a monotonic clock. coldStart is true for the first user request handled by a newly initialized container. containerStartToAudioMs measures from the provider process start to WAV bytes being ready. modelLoadMs measures model initialization during container startup; on snapshot/checkpoint restores it represents the initialization cost captured for the restored deployment. gatewayRoundTripMs includes the network path between the Next.js server and the provider. networkOverheadMs is an approximation: gateway round trip minus provider-reported server time.
The first deployment should be benchmarked with at least two runs per provider: one after scale-to-zero and one while the container is warm. Provider scheduling, GPU availability, and network distance can change these measurements.
7 commits
TypeScript
47.7%
Python
34.1%
CSS
18.0%