Expose request compression in the new SDK and coordinate Bedrock support
Maintainer thường phản hồi trong vòng 3 ngày
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- aws, python
- Lĩnh vực
- backend, cloud, documentation
Hướng nghiên cứu
Read the companion implementation in PR #111 and the Smithy Python issue #854 and PR #855 to understand the shared compression contract and generation workflow. Then inspect the generated Bedrock Runtime client, its client-level tests, and integration guidance mentioned in the issue. Done means adopting the released Smithy behavior through the normal dependency and generation workflow, testing the client configuration, and documenting the service capability requirement; Bedrock and Mantle support also needs coordination.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the feature
I'd like the new async Python SDK to expose request-body compression through its generated client configuration, and to establish how Bedrock and Mantle can support it.
We use AWS-hosted models for conversation-heavy agents. As conversations and tool results grow, uploading the next request becomes part of the wait before the first token. Giving applications an explicit compression choice would be a useful product capability for AWS-hosted inference.
Use Case
Anthropic announced gzip in Claude Code, and its changelog documents compression for large requests to api.anthropic.com. OpenAI documents zstd request bodies for the Responses API.
AWS offers models from these providers through Bedrock and its Mantle endpoint. I'd like AWS applications to be able to use supported compression capabilities too, without maintaining custom HTTP transports. Compression can reduce upload time; the benefit depends on payload size and the network. It doesn't reduce model tokens.
In checks on October 18, 2026 in us-east-1, matched requests using Anthropic Haiku succeeded uncompressed through Bedrock Converse/ConverseStream and Mantle Messages, including streaming responses. Gzip and zstd requests returned HTTP 400; Bedrock reported Unable to parse request body. This needs service coordination alongside the SDK implementation.
Proposed Solution
The companion PR adopts Smithy Python's shared compression implementation through the usual generated client configuration. An explicit request_compression_encoding="gzip" choice applies to supported requests without a size threshold, alongside an automatic mode. Unsupported explicit choices and conflicting disable settings fail before sending. The companion implementation supports gzip under the current Smithy contract; zstd needs a coordinated follow-up covering the contract and service support.
The explicit choice makes compression a requirement. A zero automatic threshold would still allow operations without compression metadata to send uncompressed requests; explicit gzip should fail before sending in that case.
The shared runtime and generator changes belong in Smithy Python. This repository should adopt that behavior through its normal generation and dependency workflow, with client-level tests and guidance explaining the service capability requirement. Adoption depends on a Smithy release containing the implementation. We should not manually advertise compression on Bedrock operations that don't accept it.
This generated client covers modeled Bedrock Runtime operations. Mantle's provider-compatible APIs need a separate API/client integration.
The diff includes client tests and guidance for this integration. I'd appreciate feedback on the generation and release process, and help connecting with the Bedrock/Mantle service owners. The checks above cover only the named Haiku routes; they include no OpenAI-route test or latency measurement.
Other Information
Companion implementation: PR.
- Smithy Python: shared runtime and code generation — issue, PR.
- Botocore: explicit compression choice for the existing SDK — issue, PR.
Acknowledgements
- I may be able to implement this feature request
- This feature might incur a breaking change
Affected area
service client (generated client under clients/), code generation, documentation
Relevant package(s)
aws-sdk-bedrock-runtime; shared compression implementation in smithy-python.
Source reviewed at 8f209d245501792c7b18ce197c194170ca4d6564.
Python version used
Python 3.12.13 for the companion implementation's local tests. See the companion PR for validation details.
- Ngôn ngữ chính
- Python
- Star
- 176
- Fork
- 25
- Merge trung bình
- 3 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 8
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của aws/aws-sdk-python
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
aws/aws-sdk-python#13 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
aws/aws-sdk-python#99 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Support Python 3.11Đang mởfeature-request p3 queued
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
aws/aws-sdk-python#92 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
announcement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
aws/aws-sdk-python#90 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
announcement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
aws/aws-sdk-python#84 ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của aws/aws-sdk-python
Issue tương tự
-
Use mhctools predictor_required=False for saved-result rescoringCó thể đã có người làm @iskandr đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 79/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
521xueweihan/HelloGitHub#4051 · 1 bình luận ·
-
bug documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
awslabs/visual-asset-management-system#514 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
backend bug spec:REQ-053
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
nolte/kamerplanter#2547 ·
Maintainer thường phản hồi trong vòng 1 ngày