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.1.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.1.0-py3-none-any.whl (6.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: deepgram_sagemaker-0.1.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.13.5 Darwin/24.6.0

File hashes

Hashes for deepgram_sagemaker-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8e19628ca0469d8b8f3d7be5113144e6e769ee786b4d7390d125af3148eb03ea
MD5 0802f84974ca4176127635fbfaac00c6
BLAKE2b-256 34442e5cac8e933ebc1ba5d35231cca3de57da3eba6094dba44dc28993d37832

See more details on using hashes here.

File details

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

File metadata

  • Download URL: deepgram_sagemaker-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.13.5 Darwin/24.6.0

File hashes

Hashes for deepgram_sagemaker-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 99f34c0258ecafe2e4bfdfe2aa1991c3af8ae663e431024d1e70efc1ffbbe78a
MD5 f6bde5ab0eca3345ea8639db3c848a81
BLAKE2b-256 9d69bf84ad20f8423b07b5830bba443cb3fe03d2d96d2af217a9d04c48fe62ac

See more details on using hashes here.

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