How can I enable entity detection or redaction in my self-hosted deployment?
Deepgram's entity detection feature is a powerful tool for audio intelligence that is capable of identifying and extracting key entities from both pre-recorded and streaming audio content. This feature is available in both our hosted API and your own self-hosted deployment.
Our redaction feature is also built upon entity detection, and you may similarly enable it in your self-hosted deployment following these instructions.
The streaming STT redaction works the same way as for pre-recorded audio, with the addition that:
Interim streaming results may show a generic [REDACTED] placeholder.
Final streaming results replace the placeholder with the specific redacted entity label (e.g., [PHONE_NUMBER_1]) once Deepgram is confident in the entity category/label.
Streaming redaction supports the same set of 50+ entities as pre-recorded redaction (see Supported Entity Types).
Example
Below is an example showing the difference between an interim and a final streaming transcription result when redaction is enabled:
JSON dump from deepgram response
// Interim streaming result{ "channel": { "alternatives": [ { "transcript": "My number is [REDACTED]" } ] }, "is_final": false}// Final streaming result{ "channel": { "alternatives": [ { "transcript": "My number is [PHONE_NUMBER_1]" } ] }, "is_final": true}
Updating your self-hosted deployment
Request an entity detection model from your Deepgram Account Representative.
Place the entity detection model in your models directory, accessible to your Deepgram Engine containers.
Update your configuration based on your container orchestrator.
Docker/Podman
Update your api.toml configuration file to enable the entity detection feature flag, as seen in the api.toml Configuration Update code block below.
Update your Compose file to use a supported release. Update the image tag for API and Engine containers to release-240725 or later.
Restart the API and Engine containers.
Kubernetes
Using a v0.4.0+ release of the deepgram-self-hosted Helm chart, set api.features.entityDetection to true in your values.yaml file.
If you have overridden the default values for api.image.tag or engine.image.tag, make sure to use release-240725 or later.
If your configuration file is valid, check the API container logs to verify the configuration file is being found. If you see a log line warning you about not finding your configuration file, check your Compose file or other configuration to verify all volume paths are correct.
Entity detection model not present
You may receive a 400 Bad Request response where the requested model is defined as Some("latest"). If so, the entity detection model is not currently available to your Engine container.
Verify the model is present in your models directory, restart the Engine container(s), and check the logs to see if the model is being loaded. You should see a line like the following in the startup section of the Engine logs:
Invalid Engine container version
If you receive a 400 Bad Request response where the requested model is defined as Semantic Tagging Key .... If so, your Deepgram Engine container is an old version that does not support entity detection. Please update your container to release-240725 or later.
WARN stem::config: Configuration file not found at user-specified path. Falling back to default/bundled configuration. path=Some("/api.toml")
{
"err_code": "Bad Request",
"err_msg": "Bad Request: The requested model (Some(\"latest\")) was not found.",
"request_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
INFO new: impeller::model_suppliers: Adding model key=SemanticTaggingKey
{
"err_code": "Bad Request",
"err_msg": "Bad Request: The requested model (SemanticTaggingKey { version: \"XXXX-XX-XX.X\", uuid: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx }) was not found.",
"request_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}