Deploy Deepgram on Amazon SageMaker
This guide deploys a Deepgram AWS Marketplace Model Package as a SageMaker AI Endpoint using the AWS CLI or the AWS SDK for Python (Boto3). The SageMaker Endpoint resource represents the compute instances that run the Deepgram Voice AI services. For an overview of running Deepgram on SageMaker, including benefits, tradeoffs, and pricing, see Amazon SageMaker.
Prefer to have an AI coding assistant run these steps for you? Install the Deepgram SageMaker skill — see Agent-assisted setup.
You need a Model Package ARN before you start. Subscribe to a Deepgram product on the AWS Marketplace and copy the ARN for your product version and AWS Region — see Find the Model Package ARN.
Prerequisites
- An AWS account
- AWS IAM permissions to SageMaker and Marketplace
- IAM Policy: AWSMarketplaceManageSubscriptions
- IAM Policy: AmazonSageMakerFullAccess
- The AWS CLI v2 or Boto3, configured with credentials for the target account
- An active AWS Marketplace subscription to a Deepgram SageMaker product and its Model Package ARN. See Subscribe on AWS Marketplace.
- Service quota for the GPU instance type you plan to use. See Requesting SageMaker Quota.
AWS field employees: you can access Deepgram models through the AWS Marketplace Field Demonstration Program. Deepgram is an eligible provider. Refer to your internal AWS documentation for enrollment details, and reach out to a Deepgram representative if you need assistance activating the program.
Choose an endpoint type
Deploy a real-time endpoint. It serves both live streaming (InvokeEndpointWithBidirectionalStream) and synchronous single-file transcription (InvokeEndpoint, up to 25 MB per request).
Asynchronous endpoints are temporarily not supported. Asynchronous inference (AsyncInferenceConfig / InvokeEndpointAsync) is temporarily unavailable for Marketplace-hosted Deepgram, so this page covers real-time endpoints only. Need asynchronous processing? Contact a Deepgram representative.
Choose instance types
Deploy on an ordered instance pool rather than a single instance type. A single type has no fallback: when AWS is short of that GPU in the Availability Zone, the endpoint goes Failed with Request to service failed a few minutes in, or InsufficientInstanceCapacity, and this happens routinely for popular GPU types. With instance pools, SageMaker tries each type in priority order and falls back to the next when one is capacity-constrained.
Order the pool as follows:
- The listing’s recommended type first (for example
ml.g6.2xlargefor Speech-to-Text). It is the type Deepgram validated the model on and the best price/performance. - Same-or-newer generation with similar per-instance capacity next (
g6→g6e→g7). Keeping capacity similar matters if you auto-scale, because the predefined scaling metrics are per instance and do not account for a mixed fleet. - Older generations last, as insurance (
g5, andg4dnwhere supported). - Never include a type the product does not support:
g4dnfor Flux,g5/g4dnfor Flux TTS, or any single-GPU type for Aura-2. See Instance types. - Up to 5 types. Three is the sweet spot.
VariantInstanceProvisionTimeoutInSeconds is the per-type wait: SageMaker tries each type for that long before moving to the next. 300 is recommended (AWS allows 60–3600), so a three-type pool can stay in Creating for up to about 15 minutes before it fails.
Quota does not fall back — capacity does. SageMaker validates the quota of every type in the pool when the endpoint is created. Every type in the pool needs a quota of at least 1 in the region, otherwise CreateEndpoint fails with ResourceLimitExceeded regardless of which type would have been used. Check and request quota for each type first; see Requesting SageMaker Quota.
Prefer a single instance type only for a stated reason: a Machine Learning Savings Plan or reservation on that type, or an auto-scaling concurrency target you measured on a specific GPU.
Create an IAM execution role
SageMaker assumes an execution role to run the Model Package on your behalf. You only need to create a single SageMaker execution role, and can reuse this IAM Role to deploy multiple SageMaker Endpoints.
AWS CLI
Boto3
A newly created IAM role can take around 10 seconds to become assumable. If CreateModel fails with Could not assume role immediately after create-role, the error is transient — wait a few seconds and retry.
Deploy with the AWS CLI or Boto3
Set variables
Choose names for the three SageMaker resources, and set the Model Package ARN and execution role ARN.
MODEL_PACKAGE_ARNidentifies the Deepgram product version and AWS Region you subscribed to. It is region-specific, so copy the ARN for the Region you deploy in. To find it, open the AWS Marketplace Manage subscriptions console, click Configure on your Deepgram subscription, choose AWS command line interface (CLI) under Service, select the product version, and copy the ARN for your Region from the Model ARNs list. See Find the Model Package ARN for the full steps.EXECUTION_ROLE_ARNis the role you created in Create an IAM execution role.- The instance pool is set in the Endpoint Configuration step.
ml.g6.2xlargeis the recommended first type for Speech-to-Text; see Choose instance types and Instance types for Text-to-Speech and the other supported families.
AWS CLI
Boto3
Create the Model
The SageMaker Model wraps the Marketplace Model Package and the execution role.
AWS CLI
Boto3
EnableNetworkIsolation=true is mandatory for AWS Marketplace model packages — SageMaker rejects the Model otherwise. Network isolation is also why the container cannot reach external services; see Limitations.
To pass DEEPGRAM_API_* or DEEPGRAM_ENGINE_* configuration overrides, add an Environment map to the container definition. See Configure Amazon SageMaker Deployments.
Create the Endpoint Configuration
The Endpoint Configuration sets the instance pool, instance count, and — critically — the host inference AMI version the instances boot with.
InferenceAmiVersion is required. Current Deepgram model packages run a CUDA 13 runtime that needs NVIDIA driver 580 or later. Without InferenceAmiVersion=al2023-ami-sagemaker-inference-gpu-4-1, SageMaker boots the default AMI for the instance family (an older driver on g4dn and g5) and the container fails its CUDA preflight check. See Inference AMI Versions.
The examples use an ordered instance pool, as recommended in Choose instance types. Adjust the types and order for your product.
AWS CLI
Boto3
To deploy on a single instance type instead (see when to prefer a single type), replace InstancePools and VariantInstanceProvisionTimeoutInSeconds with InstanceType:
Keep VariantName=AllTraffic: the Update an Amazon SageMaker Endpoint procedure and the Terraform configuration use the same variant name.
ModelDataDownloadTimeoutInSeconds and ContainerStartupHealthCheckTimeoutInSeconds are ceilings, not fixed waits: they set how long SageMaker allows the model package to download and the container to load models before it marks the endpoint failed. 600 and 300 suit most products. Large multilingual Nova-3 bundles may need ModelDataDownloadTimeoutInSeconds of 1800.
Wait for InService
It takes several minutes for the endpoint to download the model package, start the container, and pass its health check.
AWS CLI
Boto3
If the endpoint moves to Failed or stays in Creating, see Troubleshooting.
Verify
Send a first request to confirm the endpoint transcribes audio — see Validate a Deepgram SageMaker Endpoint. For the streaming and synchronous invocation APIs and the Deepgram SDK SageMaker transport, see Invoke a Deepgram SageMaker Endpoint.
Inference AMI Versions
A SageMaker Endpoint Configuration can pin an inference AMI version — the SageMaker-managed host image supplying the NVIDIA driver and container runtime your instances boot with. It is independent of the Deepgram container: it determines which driver the container runs against. If you do not set it, SageMaker selects a default for your instance type, which on older GPU families is an older driver.
Deepgram recommends the latest available version, al2023-ami-sagemaker-inference-gpu-4-1, which provides the NVIDIA 580 driver. Deepgram containers select the correct CUDA compatibility layer at startup based on the host driver they detect, so a newer host driver requires no change to your deployment.
Support for older driver versions may be removed in the latest Deepgram Model Package. Pin an up-to-date inference AMI version rather than relying on the SageMaker default for your instance type.
For the full list of AMI versions and their driver and CUDA versions, see InferenceAmiVersion in the SageMaker API reference. For the driver each instance family runs by default, see the SageMaker GPU driver table.
The CLI and Boto3 steps above already pin InferenceAmiVersion to al2023-ami-sagemaker-inference-gpu-4-1 on the production variant. Terraform users set the same value through the inference_ami_version variable — see Deploy with Terraform. The SageMaker AI console does not expose this setting, which is why the console path below is not recommended.
Deploy with the SageMaker AI console (not recommended)
The SageMaker AI console cannot set InferenceAmiVersion. Endpoints created through the console boot the instance family’s default AMI, and current Deepgram model packages fail to start on the older NVIDIA driver it provides. Use the AWS CLI or Boto3 steps or Terraform instead. If you have already created an endpoint through the console, fix it by creating a new Endpoint Configuration with the CLI and updating the endpoint.
Console steps
In the AWS Management Console, navigate to the AWS Marketplace Manage subscriptions console
On the Active subscriptions tab, find the subscription for the Deepgram product you want to deploy (eg. Deepgram Voice AI- Nova-3 Monolingual Speech-to-Text (STT) Streaming)
Under the Version header, select the product version from the dropdown. If the listing has more than one version, read the version name and the release notes to understand the set of languages (or features) each version provides, and choose the version that matches your needs
Under IAM Role, select the SageMaker execution role that you created
Leave Async invocation config turned off. Asynchronous endpoints are temporarily not supported for Marketplace-hosted Deepgram.
After following these steps, you should see a new Endpoint in your AWS account.
If you don’t see the Endpoint, ensure that you have selected the correct AWS region in the AWS Management Console.
It may take several minutes for the Endpoint to change to status InService.
Once the Endpoint status has changed to InService, you can monitor the Amazon CloudWatch Logs for the Endpoint to ensure normal operation of the Deepgram services.
Tear down
Delete the three resources in reverse order. Billing for SageMaker compute and Deepgram usage stops when the endpoint is deleted; your AWS Marketplace subscription remains active and can be reused for the next deployment.