{"id":26756,"library":"aws-sdk-bedrock-runtime","title":"AWS SDK for Bedrock Runtime","description":"The aws-sdk-bedrock-runtime library provides a Python client for Amazon Bedrock Runtime, enabling inference with foundation models via the AWS SDK. Version 0.5.0 supports Python 3.12+ and is under active development. Release cadence is monthly or patch-as-needed.","status":"active","version":"0.5.0","language":"python","source_language":"en","source_url":"https://github.com/awslabs/aws-sdk-python","tags":["aws","bedrock","sdk","ai","llm"],"install":[{"cmd":"pip install aws-sdk-bedrock-runtime","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"The package name contains hyphens but the module uses underscores.","wrong":"from bedrock_runtime import BedrockRuntimeClient","symbol":"BedrockRuntimeClient","correct":"from aws_sdk_bedrock_runtime import BedrockRuntimeClient"},{"note":"Wrong top-level package name.","wrong":"from bedrock_runtime.models import InvokeModelCommand","symbol":"InvokeModelCommand","correct":"from aws_sdk_bedrock_runtime.models import InvokeModelCommand"}],"quickstart":{"code":"import os\nfrom aws_sdk_bedrock_runtime import BedrockRuntimeClient\nfrom aws_sdk_bedrock_runtime.models import InvokeModelCommand\nclient = BedrockRuntimeClient(region=os.environ.get('AWS_REGION', 'us-east-1'))\nresp = client.invoke_model(InvokeModelCommand(modelId='amazon.titan-text-lite-v1', contentType='application/json', accept='application/json', body='{\"inputText\":\"Hello\"}'))\nprint(resp.body)","lang":"python","description":"Initialize the Bedrock Runtime client, invoke a model via InvokeModelCommand, and print the response."},"warnings":[{"fix":"Migrate from boto3 to this SDK. Replace 'boto3.client(\"bedrock-runtime\")' with 'BedrockRuntimeClient'.","message":"The package 'aws-sdk-bedrock-runtime' is distinct from the older 'boto3' Bedrock Runtime client and requires Python >=3.12. Existing code using boto3 bedrock-runtime will need rewriting.","severity":"breaking","affected_versions":">=0.5.0"},{"fix":"Use 'from aws_sdk_bedrock_runtime import ...' not 'from aws-sdk-bedrock-runtime'.","message":"The import path uses underscores, not hyphens. The package name on PyPI contains hyphens (aws-sdk-bedrock-runtime) but the Python module uses underscores (aws_sdk_bedrock_runtime).","severity":"gotcha","affected_versions":"all"},{"fix":"Monitor release notes and update imports when the naming stabilizes.","message":"As of version 0.5.0, the 'InvokeModelCommand' class may be renamed in future releases. Check the latest documentation for command class names.","severity":"deprecated","affected_versions":"0.5.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Install the package: 'pip install aws-sdk-bedrock-runtime'. Then use underscore in import: 'from aws_sdk_bedrock_runtime import ...'.","cause":"The package is not installed or the import uses the wrong name (e.g., hyphen instead of underscore).","error":"ModuleNotFoundError: No module named 'aws_sdk_bedrock_runtime'"},{"fix":"Provide 'modelId' as a keyword argument: InvokeModelCommand(modelId='amazon.titan-text-lite-v1', ...).","cause":"The 'InvokeModelCommand' expects 'modelId' as a required argument, not just in the body.","error":"TypeError: Missing required keyword argument 'modelId'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}