Overview
SageMaker Jumpstart deployment offers:- Managed Infrastructure: AWS handles server provisioning and maintenance
- Automatic Scaling: Built-in auto-scaling based on demand
- Integrated Monitoring: CloudWatch integration for metrics and logging
- Pay-per-use: Cost optimization through on-demand resource allocation
- Quick Setup: Deploy in minutes using pre-configured notebooks
Prerequisites
AWS Account Requirements
- AWS account with SageMaker access
- Sufficient service limits for GPU instances (ml.g6e.xlarge)
- IAM role with Sagemaker Full Access and Marketplace Subscription Access (ViewSubscriptions, Unsubscribe, Subscribe)
- VPC configuration (optional, for private deployment)
Getting Started
To get started with deploying an inference endpoint for Sonic 3 on Sagemaker, please refer to the steps in this notebookInference Setup
Sonic 3 supports only real time inference on Sagemaker. Please selectml.g6e.xlarge as your inference endpoint instance type. Each instance is capable of serving 8 concurrent requests. In order to get the best performance, Sagemaker suggests that you reuse the client-to-SageMaker connection, as it can save the time to re-establish the connection. In boto3, you can configure max_pool_connections . Multiple requests will reuse the connections, which avoids the cost of establishing new TCP/TLS connections for each request.
Inputs and Outputs
Input Summary
The response streaming endpoint takes in a JSON object as the input that specifies the transcript, voice, language, and output format for the generationInput Parameters
Data Sample
Output Details
Output Events
Sagemaker sends back the response events in a Response Stream. The payload is sent to you as base 64 encoded blobs. Due to Sagemaker limitation, it may truncate one event into several segements. Or API always attach a linebreak to the end of each complete event, such that you can reconciliate them on client side. Each event we send back is a json object that contains the generated audio chunk and some metadatas. The event can be one of the following types, identified byevent.type:
Chunk Event
A chunk event always contains at most 20 ms worth of audio chunk in the output format and sample rate you specified.Done Event
A done event signals the completion of the generation. Done events are identified byevent.type == "done" and event.done == True.
Timestamp Event
A timestamp event provides timing information for recognized words or tokens.Phoneme Timestamp Event
A phoneme timestamp event provides timing data at the phoneme level, typically for detailed speech analysis.Error Handling
If an error occurs during the generation type, Sagemaker will send back the error as a Model Error. To handle the error, you may inspect theOriginalStatusCode field of the error object (See examples for error handling in python).
422 Errors
A 422 error indicates that your input is not of the correct format. You may see more details in theMessage field.
429 Errors
A 429 error indicates that the model container you are hitting does not have capacity to serve requests at the point. Our models serve at most 4 concurrent generation requests at a time. If you are running multiple inference container replicas, we suggest that you use load-aware routing in sagemaker by configuring the parametersRoutingConfig inside the ProductionVariants configuration, Set it to LEAST_OUTSTANDING_REQUESTS for optimal load distribution.
Container Logs
You should be able to see container logs in cloudwatch. Most logs should be emitted with a request id. The server side request id is of the format{uuid}-{client supplied context id}.