Skip to main content

SageMaker transport for the Deepgram Python SDK

Project description

Deepgram SageMaker Transport

PyPI version Python 3.12+ MIT License

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

deepgram_sagemaker-0.2.1.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deepgram_sagemaker-0.2.1-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file deepgram_sagemaker-0.2.1.tar.gz.

File metadata

  • Download URL: deepgram_sagemaker-0.2.1.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for deepgram_sagemaker-0.2.1.tar.gz
Algorithm Hash digest
SHA256 5e42e188d04508c4ab7d59bbc9592f2991a2c124d56926118c48eeac93ef8156
MD5 a15b4d5b6da502c9a0efaee6ee5fed6c
BLAKE2b-256 2b71f2ea57c371004dd22451f3b407c585f29af2975d9338c63ba1331ce62363

See more details on using hashes here.

Provenance

The following attestation bundles were made for deepgram_sagemaker-0.2.1.tar.gz:

Publisher: release-please.yml on deepgram/deepgram-python-sdk-transport-sagemaker

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file deepgram_sagemaker-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for deepgram_sagemaker-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b471f4429679be7421772e6655d816be5827d4ee5c149ba370cca9328898e0ea
MD5 05d8391b5300865034874db555a97a78
BLAKE2b-256 854fbc2486bb18428a77f6d08661bc47f5c2f9fd1ee90267943da73fb0133644

See more details on using hashes here.

Provenance

The following attestation bundles were made for deepgram_sagemaker-0.2.1-py3-none-any.whl:

Publisher: release-please.yml on deepgram/deepgram-python-sdk-transport-sagemaker

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page