← Back
AWS ML Blog

Structured outputs for Anthropic Claude models on Amazon Bedrock

•11 min read•
#bedrock#anthropic#llm
Level:Advanced
For:AI Engineers
✦TL;DR

Amazon Bedrock now adds native structured‑output support for all Anthropic Claude models on both the bedrock‑runtime and bedrock‑mantle endpoints, delivering schema‑compliant JSON via constrained decoding. The service validates JSON Schema Draft 2020‑12, compiles a grammar artifact (cached for 24 hours), and streams typed events for real‑time use, eliminating post‑generation parsing and retries. This deterministic output reduces token usage and inference cost, making Claude‑based pipelines production‑ready at scale.

⚡ Key Takeaways

  • Structured outputs are available for **all Anthropic Claude models** on **bedrock‑runtime** and **bedrock‑mantle** endpoints.
  • Constrained decoding enforces a **JSON Schema Draft 2020‑12** subset during token generation.
  • First request with a new schema incurs extra latency for **grammar compilation**, but subsequent calls are faster thanks to a **24‑hour cache**.
  • Supports **batch inference**, **cross‑Region inference**, and **streaming typed events** for real‑time responses.
  • Outputs are **type‑safe**, always include required fields, and reduce token count, lowering inference cost for high‑volume workloads.
💡 Why It Matters

Engineers can integrate Claude models without custom JSON parsing or retry loops, achieving reliable, cost‑effective data extraction and automation pipelines that scale across AWS regions.

✅ Practical Steps

  1. Include a **JSON schema** (conforming to Draft 2020‑12) in your Bedrock request payload when calling Claude via **Boto3** or the **Messages API**.
  2. For high‑throughput jobs, use **batch inference** on the bedrock‑runtime endpoint and enable **cross‑Region inference** to distribute load without extra setup.
  3. To receive real‑time results, enable **streaming** and handle the returned **typed events** in your application.

Want the full story? Read the original article.

Read on AWS ML Blog ↗

More like this

Introducing Gemini 4 Neon

Google DeepMind•#llm

DaisyRose-27B: Pushing the Frontier of Post-Training Efficiency

Hugging Face Blog•#llm

NVIDIA RTX Spark Compact Desktops Out Now

NVIDIA Blog•#compute

Helping AI text detectors keep up with changing conditions

MIT News AI•#llm

EXPLORE AI NEWS

Daily hand-picked stories on LLMs, RAG, agents and production AI — curated for engineers who ship.

BROWSE NEWS

GET THE WEEKLY DIGEST

Join engineers getting the Monday signal-over-noise AI breakdown. No spam, unsubscribe anytime.

LEARN AI ENGINEERING

Curated courses, research papers, repos and tutorials built for engineers leveling up in AI.

START LEARNING