Bedrock Mantle LocalStack Extension
Emulates Bedrock Mantle by exposing the
OpenAI-compatible API provided by Ollama through LocalStack endpoints. The extension
uses LocalStack Bedrock's Ollama backend, so Ollama is started and managed by
LocalStack.
Install
To install the extension, add to your environment
EXTENSION_AUTO_INSTALL=git+https://github.com/thrau/localstack-extension-bedrock-mantle/#egg=localstack-extension-bedrock-mantle
or run
localstack extensions install "git+https://github.com/thrau/localstack-extension-bedrock-mantle/#egg=localstack-extension-bedrock-mantle"
Usage
To connect to AWS bedrock mantle, your OpenAI code might look as simple as this.
client = OpenAI(
provider=bedrock(
endpoint="mantle",
api_key=None, # Force IAM/SigV4 authentication
)
)
The extension automatically configures your Lambda containers to connect to localstack.
How it works
Requests to either of these endpoint forms are proxied directly to Ollama:
http://bedrock-mantle.<region>.localhost.localstack.cloud:4566/v1/...http://bedrock-mantle.<region>.api.aws/v1/...
For example, use https://bedrock-mantle.us-east-1.localhost.localstack.cloud/v1
as an OpenAI base URL.
On load, the extension appends the following Docker flag to
LAMBDA_DOCKER_FLAGS, making the emulator available to Docker Lambda functions:
-e AWS_BEDROCK_BASE_URL=http://bedrock-mantle.us-east-1.localhost.localstack.cloud:4566/v1
Local development
Install development dependencies with make install. Run make lint to check lint
rules, import ordering, and formatting with Ruff, or make format to apply automatic
fixes and format the code.
Build the source distribution and wheel with make dist (using Hatch and the
Hatchling build backend). Artifacts are written to dist/.
localstack extensions dev enable .
EXTENSION_DEV_MODE=1 localstack start
Metadata
Release files for localstack-extension-bedrock-mantle 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| localstack_extension_bedrock_mantle-0.2.0.tar.gz | 4.9 kB | Without provenance | Details for localstack_extension_bedrock_mantle-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| localstack_extension_bedrock_mantle-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for localstack_extension_bedrock_mantle-0.2.0-py3-none-any.whl |
Total release size: 9.8 kB
Release files / localstack_extension_bedrock_mantle-0.2.0.tar.gz
| Download URL | localstack_extension_bedrock_mantle-0.2.0.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
69dd74f934e110856983cd05202eed183bc35a65d94ba0ff787145a7d9683526
|
|
BLAKE2b-256 checksum How to use checksums |
10af30865d21445443422cf52b9a58765d37d561befd3f2bda75fdacafd49656
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.12
|
Release files / localstack_extension_bedrock_mantle-0.2.0-py3-none-any.whl
| Download URL | localstack_extension_bedrock_mantle-0.2.0-py3-none-any.whl |
|---|---|
| Size | 4.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6358b954ffc95bb6afc392cb16d629e2e7dd565b311df3eac646347206279ec3
|
|
BLAKE2b-256 checksum How to use checksums |
ac312ea6428725b8c0af1be2e03d4caf1da9f843a297cfc326cb4c849f3ce673
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.12
|
Security for localstack-extension-bedrock-mantle 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.