Configure a Deepgram Modal Deployment
Configure Deepgram
Modal Deepgram deployments are managed by labels. Each label specifies a set of Deepgram TOML files and models. Keep in mind that Deepgram models, such as Flux and Aura-2, must be deployed on independent Modal stacks, and cannot be co-hosted with any other models.
Set the label by exporting an environment variable.
These resources are stored on Modal Volumes when you run
This will
- Download the Deepgram model weights to a Modal Volume
- Pull the appropriate config files from Deepgram’s repo
- Patch the config files
- Use
localhostwith the desired ports - Specify the Modal Volume mount point for model weights
- Use
When calling modal run -m modal_deepgram.deepgram_resources, note that
- the models
.txtfilepath should be local - the config file names should match one of those found in the Deepgram self-hosted resources repo
- the
--deploy-typeargument takes eitherlicense-proxyorstandardand will choose the appropriate directory to pull the configs (default islicense-proxy)
Edit a Deepgram TOML config
Update config files for a deployment after the initial modal_deepgram.deepgram_resources run by pulling them from the Volume, editing, and uploading back to the Volume.
-
Pull the file locally:
-
Edit
./api.tomlin your editor. -
Push the change back:
-
Redeploy with
DEPLOY_LABEL={label} modal deploy -m modal_deepgram.appto apply.
Update models
Passing --model-links-path wipes /models/{label}/ and re-downloads every URL in the file.
TTS deployment example
The end-to-end flow for an Aura-2 TTS deployment:
-
Save your Aura-2 model links to
./tts-model-links.txt. -
Run
prepare_resourceswith thettslabel and Aura-2 config files. For language-specific deployments, swap the polyglot configs for variants likeapi.aura-2-en.toml/engine.aura-2-en.toml. -
Update the hardware literals in
modal_deepgram/app.pyto TTS-recommended values — see Compute and Autoscaling → Configure hardware. -
Deploy:
Set Deepgram release version
To change the Deepgram release, edit DEEPGRAM_IMAGE_TAG in modal_deepgram/deepgram.py and redeploy the app. This will rebuild the container image.