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.0.tar.gz (5.9 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.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: deepgram_sagemaker-0.2.0.tar.gz
  • Upload date:
  • Size: 5.9 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.0.tar.gz
Algorithm Hash digest
SHA256 87875ca9b43b001c9bcb5edb8d1917ad633e7d29bd553921d78cb72f41544674
MD5 26bee06bd918bbfd0e286f6e10016813
BLAKE2b-256 601354659a6c9cc227f585a8e54a9ee194c64b1dfb52b87decc785c5f66dcfc2

See more details on using hashes here.

Provenance

The following attestation bundles were made for deepgram_sagemaker-0.2.0.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.0-py3-none-any.whl.

File metadata

File hashes

Hashes for deepgram_sagemaker-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 249cc5927bd3f05d0e0d0e06bc1f778009ae33becd52cb71ec0a03cbd3a9897f
MD5 8517fdfb6abeab8575656774dc383e1e
BLAKE2b-256 05d020fa93ae91531f7c0769c5d7c175e909ef1f5fd4a0a6b457312e167705a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for deepgram_sagemaker-0.2.0-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