Skip to main content
Lesson 8 of 14 · Mistral Deployment: Cloud and Self-Hosting

AWS Bedrock

Lesson 8 of 14 Updated November 2, 2026 Advanced
On this page
  1. Mistral on Amazon Bedrock
  2. Prerequisites
  3. Calling via the Converse API
  4. The Native Mistral SDK, and Why to Avoid It Here
  5. Integration with the AWS Ecosystem
  6. Differences from the Direct Mistral API
  7. Key Takeaways

Mistral on Amazon Bedrock

Amazon Bedrock is AWS’s managed service for accessing foundation models through a unified API. Mistral AI offers a complete lineup here, ranging from the lightweight Mistral 7B to the powerful Mistral Large 3. The integration relies on the standard AWS SDK, boto3. This makes it an attractive option for teams already established on AWS: no extra vendor keys to circulate, no new contracts to approve, and an authentication model your administrators already master.

The Bedrock catalog is one of the most extensive for Mistral. You’ll find Mistral Large 3 for advanced reasoning and multimodal tasks, the lightweight Ministral 3B / 8B / 14B lineup, earlier versions like Mistral Large 24.07 and 24.02 (often kept to avoid breaking calibrated prompts), Mistral Small for fast and cost-effective processing, Mixtral 8x7B with its Mixture-of-Experts architecture, the foundational open-weight Mistral 7B model, and Pixtral Large for vision and multimodal capabilities. This depth allows you to run a cheap model for bulk classification alongside a high-end model for delicate summaries within the same application.

Prerequisites

Three conditions must be met before your first call. First, you need an AWS account in a region that supports Bedrock. Second, you need an IAM principal—user or role—granted the two required Bedrock permissions:

  • bedrock:InvokeModel
  • bedrock:InvokeModelWithResponseStream

Finally, Mistral models must be enabled in the Bedrock console for your specific region. This last step catches many teams off guard: your IAM permissions might be perfect, but if the model isn’t enabled in the region you’re calling, it remains out of reach. Enablement happens region by region, which explains failures after switching from us-west-2 to another zone.

On the workstation side, installation is limited to the AWS SDK:

pip install boto3>=1.34.131

Then configure your credentials as usual:

aws configure
# AWS Access Key ID: your-access-key
# AWS Secret Access Key: your-secret-key
# Default region name: us-west-2
# Default output format: json

Calling via the Converse API

Bedrock unifies access to different providers behind a single method: converse(). In practice, the same code calls a Mistral model or any other model in the catalog; only the identifier changes. Message content is not a simple string but a list of blocks, and generation settings are grouped under inferenceConfig rather than flattened at the top level.

import boto3

client = boto3.client("bedrock-runtime", region_name="us-west-2")

response = client.converse(
    modelId="mistral.mistral-large-2512-v1:0",
    messages=[
        {
            "role": "user",
            "content": [{"text": "Explain the concept of a VPC in AWS in 5 points."}]
        }
    ],
    inferenceConfig={
        "temperature": 0.3,
        "maxTokens": 1024
    }
)

# Extract the response
output = response["output"]["message"]["content"][0]["text"]
print(output)

Identifiers follow the format mistral.<model-name>-<version>:0. Since they are versioned, it’s best to centralize them in a constant rather than copying them into every call:

# Common models (versioned identifiers — check the Bedrock console for the current list)
MODELS = {
    "large_3":  "mistral.mistral-large-2512-v1:0",
    "small":       "mistral.mistral-small-2402-v1:0",
    "mixtral":     "mistral.mixtral-8x7b-instruct-v0:1",
    "mistral_7b":  "mistral.mistral-7b-instruct-v0:2",
}

For long responses, converse_stream returns an event stream that you iterate over as it arrives. This lets an interface display text while it’s being generated, instead of waiting several seconds with a frozen screen.

response = client.converse_stream(
    modelId="mistral.mistral-large-2512-v1:0",
    messages=[
        {
            "role": "user",
            "content": [{"text": "Generate a complete guide on Lambda functions."}]
        }
    ],
    inferenceConfig={"maxTokens": 2048}
)

for event in response["stream"]:
    if "contentBlockDelta" in event:
        text = event["contentBlockDelta"]["delta"].get("text", "")
        print(text, end="", flush=True)

The Native Mistral SDK, and Why to Avoid It Here

If you prefer the standard Mistral client, an adapter lets you point it to the Bedrock endpoint:

import os
from mistralai.client import Mistral

# Configuration for Bedrock
client = Mistral(
    api_key=os.environ.get("AWS_SECRET_ACCESS_KEY", ""),
    server_url=f"https://bedrock-runtime.us-west-2.amazonaws.com"
)

However, the boto3 approach is recommended on AWS because it integrates natively with IAM, CloudWatch, and other AWS services. In practice, choosing boto3 gives you automatic credential rotation via roles and observability without writing a single extra line of code.

Integration with the AWS Ecosystem

Bedrock automatically sends metrics to CloudWatch: Invocations for call count, InvocationLatency for request latency, and InputTokenCount and OutputTokenCount for token consumption. You get a cost and performance dashboard without instrumenting your application. A quick check from the command line is enough to verify volume for a given period:

# Check metrics via AWS CLI
aws cloudwatch get-metric-statistics \
    --namespace "AWS/Bedrock" \
    --metric-name "Invocations" \
    --start-time 2026-04-01T00:00:00Z \
    --end-time 2026-04-03T23:59:59Z \
    --period 3600 \
    --statistics Sum

AWS also offers its own guardrails, which supplement Mistral’s. These attach at the call level, letting you apply a consistent filtering policy across all models in the catalog, regardless of their provider:

response = client.converse(
    modelId="mistral.mistral-large-2512-v1:0",
    messages=[{"role": "user", "content": [{"text": "..."}]}],
    guardrailConfig={
        "guardrailIdentifier": "my-guardrail-id",
        "guardrailVersion": "1"
    }
)

Differences from the Direct Mistral API

AspectMistral APIAWS Bedrock
SDKmistralaiboto3
AuthAPI KeyIAM (SigV4)
APIchat.complete()converse()
Streamingchat.stream()converse_stream()
MonitoringManualNative CloudWatch
BillingMistralAWS

This table explains why porting from the Mistral API is never just a URL change: the message format, the method called, and the authentication mechanism all change at once. Plan for an abstraction layer in your code if you intend to serve both.

Key Takeaways

  • Bedrock uses boto3 and the converse() API—not the standard Mistral client
  • Authentication goes through IAM, not a Mistral API key
  • CloudWatch metrics are sent automatically (latency, tokens, invocations)
  • Enable models in the Bedrock console before using them
  • Bedrock identifiers are versioned (mistral.mistral-large-2512-v1:0) and change with each generation: verify the exact value in the Bedrock console before deploying
  • Streaming happens via converse_stream() with events