Skip to main content

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.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for localstack-extension-bedrock-mantle 0.1.0
File Size Uploaded Provenance Actions
localstack_extension_bedrock_mantle-0.1.0.tar.gz 4.9 kB Without provenance Details for localstack_extension_bedrock_mantle-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for localstack-extension-bedrock-mantle 0.1.0
File Interpreter ABI Platform Actions
localstack_extension_bedrock_mantle-0.1.0-py3-none-any.whl Python 3 none any Details for localstack_extension_bedrock_mantle-0.1.0-py3-none-any.whl

Total release size: 9.8 kB

Release files / localstack_extension_bedrock_mantle-0.1.0.tar.gz

Download URL localstack_extension_bedrock_mantle-0.1.0.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9027b0127f17d065cdc5caf3a9bad8b891f3823a33ce4858bbbc10947ac7ab85
BLAKE2b-256 checksum
How to use checksums
829e7c4453ae044b2fbd53f9b6434b8c1758d9e5e573f39b42910cc500ac995f
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.1.0-py3-none-any.whl

Download URL localstack_extension_bedrock_mantle-0.1.0-py3-none-any.whl
Size 4.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e93332501c7dce3b2eb9400783776dcb90df4385039dbde3ac2100d867ceac47
BLAKE2b-256 checksum
How to use checksums
fd19db6aeae26dcccd73240e962ddcc7e57d51b035a3f3cd25d0dfc734c8031f
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.1.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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page