Skip to content

feat(bedrock): support performance latency config#1514

Open
wilyan09007 wants to merge 1 commit into
anthropics:mainfrom
wilyan09007:issue-971-bedrock-low-latency
Open

feat(bedrock): support performance latency config#1514
wilyan09007 wants to merge 1 commit into
anthropics:mainfrom
wilyan09007:issue-971-bedrock-low-latency

Conversation

@wilyan09007
Copy link
Copy Markdown

@wilyan09007 wilyan09007 commented May 8, 2026

Summary:
Fixes #971 by adding Bedrock low-latency configuration support to the sync and async Bedrock clients. The option maps to the Bedrock performance latency request header for standard and streaming invocations.

Changes:

  • Add performance_config_latency to sync and async Bedrock clients.
  • Apply the Bedrock performance latency header during request preparation.
  • Preserve, override, or clear the latency option through copy().
  • Add focused tests for default, sync, async, streaming, and copy behavior.

Testing instructions:

  • Run uv run ruff check src\anthropic\lib\bedrock\_client.py tests\lib\test_bedrock.py.
  • Run uv run pyright src\anthropic\lib\bedrock\_client.py.
  • Run uv run --extra bedrock pytest tests\lib\test_bedrock.py -k "performance_config_latency or messages_retries or application_inference_profile or api_key_auth".
  • Confirm optimized clients send X-Amzn-Bedrock-PerformanceConfig-Latency.

@wilyan09007 wilyan09007 requested a review from a team as a code owner May 8, 2026 00:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bedrock: support low-latency configuration

1 participant