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.2.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.2-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

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

Hashes for deepgram_sagemaker-0.2.2.tar.gz
Algorithm Hash digest
SHA256 3ae3fa09a8b9d0b1a625d1334bd3638fe850fed5dcf4f285bf67bb76a871157c
MD5 05e080e1ff84d7d934f4b6f9a13dd216
BLAKE2b-256 76ff87cdaab22abcd9697b31bd0834f3170c817343c98930c51f5143c09cb339

See more details on using hashes here.

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

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.2-py3-none-any.whl.

File metadata

File hashes

Hashes for deepgram_sagemaker-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 75205c69047092695e09fe7478a9b59937224e67ab41592c2113916fa9ce8ef1
MD5 2e63374cd8272ac6dfccdac4d432d461
BLAKE2b-256 6d7f2974ac0f669e68b75fd92f558f16d904ccf235800d524cae0f8d2436b817

See more details on using hashes here.

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

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