Metadata-Version: 2.4
Name: lmux-bedrock-shared
Version: 0.2.0
Summary: Shared AWS Bedrock internals (SigV4 signing, event-stream decoding, Anthropic pricing) for lmux
Keywords: llm,ai,aws,bedrock,language-model
Author: Connor Luebbehusen
Author-email: Connor Luebbehusen <connor@luebbehusen.dev>
License-Expression: MIT
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Typing :: Typed
Requires-Dist: lmux~=0.11
Requires-Dist: boto3>=1.42.31,<2
Requires-Python: >=3.13
Project-URL: Homepage, https://github.com/cluebbehusen/lmux
Project-URL: Source, https://github.com/cluebbehusen/lmux/tree/main/packages/lmux-bedrock-shared
Project-URL: Issues, https://github.com/cluebbehusen/lmux/issues
Description-Content-Type: text/markdown

# lmux-bedrock-shared

Shared internals for the two lmux providers that talk to Amazon Bedrock:

- [`lmux-aws-bedrock`](https://pypi.org/project/lmux-aws-bedrock/) — the Converse-API provider (all Bedrock vendors + embeddings).
- [`lmux-anthropic`](https://pypi.org/project/lmux-anthropic/) `[bedrock]` — the native Anthropic Messages API provider (`AnthropicBedrockProvider`).

It exists so those two packages don't duplicate the AWS-specific transport code or the Anthropic-on-Bedrock pricing table, while keeping core `lmux` free of any AWS-specific code.

## Contents

| Module           | Purpose                                                                                                                                                                                                    |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `sigv4.py`       | `sign()` — minimal, stdlib-only AWS Signature Version 4 signer (unit-tested for byte-parity against `botocore.auth.SigV4Auth`).                                                                            |
| `eventstream.py` | `EventStreamDecoder` / `decode_messages` — stdlib-only decoder for AWS's binary `vnd.amazon.eventstream` framing.                                                                                          |
| `pricing.py`     | `ANTHROPIC_PRICING` + `calculate_bedrock_anthropic_cost()` — the Anthropic-on-Bedrock pricing subset, generated by `scripts/update_bedrock_pricing.py`. Shared so both providers price Claude identically. |

`sigv4`/`eventstream` are pure stdlib. `pricing` depends only on `lmux` (for the pricing types). This package is an internal building block; its API is not intended for direct use outside the lmux Bedrock providers.
