SageMaker transport for the Deepgram Python SDK
Project description
Deepgram SageMaker Transport
SageMaker transport for the Deepgram Python SDK. Uses AWS SageMaker's HTTP/2 bidirectional streaming API as an alternative to WebSocket, allowing transparent switching between Deepgram Cloud and Deepgram on SageMaker.
Requires Python 3.12+ (due to AWS SDK dependencies).
Installation
pip install deepgram-sagemaker
This installs aws-sdk-sagemaker-runtime-http2 and boto3 automatically.
Usage
The SageMaker transport is async-only and must be used with AsyncDeepgramClient:
import asyncio
from deepgram import AsyncDeepgramClient
from deepgram.core.events import EventType
from deepgram_sagemaker import SageMakerTransportFactory
factory = SageMakerTransportFactory(
endpoint_name="my-deepgram-endpoint",
region="us-west-2",
)
# SageMaker uses AWS credentials (not Deepgram API keys)
client = AsyncDeepgramClient(api_key="unused", transport_factory=factory)
async def main():
async with client.listen.v1.connect(model="nova-3") as connection:
connection.on(EventType.MESSAGE, lambda msg: print(msg))
await connection.start_listening()
asyncio.run(main())
AWS Credentials
The transport resolves AWS credentials using boto3's credential chain:
- Environment variables (
AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY) - Shared credentials file (
~/.aws/credentials) - IAM role (EC2, ECS, Lambda)
Links
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file deepgram_sagemaker-0.2.2.tar.gz.
File metadata
- Download URL: deepgram_sagemaker-0.2.2.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ae3fa09a8b9d0b1a625d1334bd3638fe850fed5dcf4f285bf67bb76a871157c
|
|
| MD5 |
05e080e1ff84d7d934f4b6f9a13dd216
|
|
| BLAKE2b-256 |
76ff87cdaab22abcd9697b31bd0834f3170c817343c98930c51f5143c09cb339
|
Provenance
The following attestation bundles were made for deepgram_sagemaker-0.2.2.tar.gz:
Publisher:
release-please.yml on deepgram/deepgram-python-sdk-transport-sagemaker
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
deepgram_sagemaker-0.2.2.tar.gz -
Subject digest:
3ae3fa09a8b9d0b1a625d1334bd3638fe850fed5dcf4f285bf67bb76a871157c - Sigstore transparency entry: 1261746168
- Sigstore integration time:
-
Permalink:
deepgram/deepgram-python-sdk-transport-sagemaker@9ef38c8afd548c59b5b7b60b7b67225329b88e7e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/deepgram
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-please.yml@9ef38c8afd548c59b5b7b60b7b67225329b88e7e -
Trigger Event:
push
-
Statement type:
File details
Details for the file deepgram_sagemaker-0.2.2-py3-none-any.whl.
File metadata
- Download URL: deepgram_sagemaker-0.2.2-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75205c69047092695e09fe7478a9b59937224e67ab41592c2113916fa9ce8ef1
|
|
| MD5 |
2e63374cd8272ac6dfccdac4d432d461
|
|
| BLAKE2b-256 |
6d7f2974ac0f669e68b75fd92f558f16d904ccf235800d524cae0f8d2436b817
|
Provenance
The following attestation bundles were made for deepgram_sagemaker-0.2.2-py3-none-any.whl:
Publisher:
release-please.yml on deepgram/deepgram-python-sdk-transport-sagemaker
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
deepgram_sagemaker-0.2.2-py3-none-any.whl -
Subject digest:
75205c69047092695e09fe7478a9b59937224e67ab41592c2113916fa9ce8ef1 - Sigstore transparency entry: 1261746217
- Sigstore integration time:
-
Permalink:
deepgram/deepgram-python-sdk-transport-sagemaker@9ef38c8afd548c59b5b7b60b7b67225329b88e7e -
Branch / Tag:
refs/heads/main - Owner: https://github.com/deepgram
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-please.yml@9ef38c8afd548c59b5b7b60b7b67225329b88e7e -
Trigger Event:
push
-
Statement type: