Skip to content

API Reference parrot.clients.amazon.nova.mantle

github-actions[bot] edited this page Dec 2, 2026 · 4 revisions

parrot.clients.amazon.nova.mantle

View source

Amazon Bedrock Mantle client for AI-Parrot (FEAT-407; rebased FEAT-438).

Extends OpenAIBaseClient to route requests through Amazon Bedrock's Project Mantle — a distributed inference engine that exposes an OpenAI-compatible API for Bedrock-hosted models at https://bedrock-mantle.<region>.api.aws/v1, authenticated with a Bedrock API key (bearer token) rather than SigV4/boto credentials.

All completion, streaming, tool-calling, structured output, retry, and fallback machinery is inherited from OpenAIBaseClient unchanged — this module only resolves the endpoint (region-aware) and the API key before delegating to the parent's __init__. FEAT-438 rebases this client onto OpenAIBaseClient (not OpenAIClient) so it never inherits OpenAI-the-provider defaults (gpt-* model ids) — the root cause of the production DeepSeek V3.2 404 that motivated FEAT-438.

This client coexists with, and does not replace, the native BedrockConverseClient (FEAT-302) and NovaClient (FEAT-315), which use the boto/Converse API code path instead of the OpenAI SDK.

Alias AWS_NOVA_API_KEY

Re-exported from parrot.conf.AWS_NOVA_API_KEY.

Alias AWS_NOVA_REGION

Re-exported from parrot.conf.AWS_NOVA_REGION.

Alias AWS_REGION_NAME

Re-exported from parrot.conf.AWS_REGION_NAME.

Alias AmazonModel

Re-exported from parrot.clients.amazon.models.AmazonModel.

Alias BEDROCK_AWS_REGION

Re-exported from parrot.conf.BEDROCK_AWS_REGION.

Alias BEDROCK_MANTLE_API_KEY

Re-exported from parrot.conf.BEDROCK_MANTLE_API_KEY.

Alias BEDROCK_MANTLE_BASE_URL

Re-exported from parrot.conf.BEDROCK_MANTLE_BASE_URL.

Class BedrockMantleClient

Client for Amazon Bedrock Mantle's OpenAI-compatible API.

Resolves the Bedrock Mantle endpoint and API key, then delegates all completion/streaming/tool-calling behavior to the inherited OpenAIBaseClient machinery — no OpenAI machinery is reimplemented or overridden here.

Endpoint resolution (first match wins): 1. explicit base_url kwarg; 2. BEDROCK_MANTLE_BASE_URL conf var; 3. constructed as https://bedrock-mantle.{region}.api.aws/v1, where region resolves (first match wins) from the explicit region kwarg, BEDROCK_AWS_REGION, AWS_NOVA_REGION, AWS_REGION_NAME, or "us-east-1".

API-key resolution (first match wins): 1. explicit api_key kwarg; 2. BEDROCK_MANTLE_API_KEY conf var; 3. AWS_NOVA_API_KEY conf var (existing Bedrock API key shared with NovaClient / BedrockConverseBase).

A misconfigured region yields a DNS/connection failure rather than an auth error — since Mantle is not available in every AWS region, check the resolved base_url first when debugging connectivity issues.

Example::

from parrot.clients.amazon.nova import BedrockMantleClient

client = BedrockMantleClient(region="us-east-1")
async with client:
    response = await client.ask(
        "Explain quantum entanglement simply.",
        model="anthropic.claude-mythos-preview",
    )
Parameter Type Default Description
api_key str | None None Bedrock API key (bearer token). Falls back to BEDROCK_MANTLE_API_KEY then AWS_NOVA_API_KEY.
base_url str | None None Explicit Mantle endpoint override. Falls back to BEDROCK_MANTLE_BASE_URL then a region-constructed URL.
region str | None None AWS region used to construct the default base URL when neither base_url nor BEDROCK_MANTLE_BASE_URL is set. Falls back to BEDROCK_AWS_REGION then AWS_NOVA_REGION then AWS_REGION_NAME then "us-east-1".
**kwargs {} Additional arguments passed to OpenAIClient / AbstractClient.

Attributes:

Attribute Type Description
client_type str
client_name str
provider_keys tuple[str, ...]
models type[Enum]

Method BedrockMantleClient.budget_adapter_factory

budget_adapter_factory()

Alias OpenAIBaseClient

Re-exported from parrot.clients.openai_base.OpenAIBaseClient.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally