[HTML payload içeriği buraya]
28 C
Jakarta
Sunday, May 17, 2026

Llama 4 fashions from Meta now obtainable in Amazon Bedrock serverless


Voiced by Polly

The most recent AI fashions from Meta, Llama 4 Scout 17B and Llama 4 Maverick 17B, at the moment are obtainable as a completely managed, serverless choice in Amazon Bedrock. These new basis fashions (FMs) ship natively multimodal capabilities with early fusion expertise that you should use for exact picture grounding and prolonged context processing in your purposes.

Llama 4 makes use of an modern mixture-of-experts (MoE) structure that gives enhanced efficiency throughout reasoning and picture understanding duties whereas optimizing for each value and pace. This architectural method permits Llama 4 to supply improved efficiency at decrease value in comparison with Llama 3, with expanded language assist for international purposes.

The fashions had been already obtainable on Amazon SageMaker JumpStart, and now you can use them in Amazon Bedrock to streamline constructing and scaling generative AI purposes with enterprise-grade safety and privateness.

Llama 4 Maverick 17B – A natively multimodal mannequin that includes 128 consultants and 400 billion whole parameters. It excels in picture and textual content understanding, making it appropriate for versatile assistant and chat purposes. The mannequin helps a 1 million token context window, providing you with the flexibleness to course of prolonged paperwork and sophisticated inputs.

Llama 4 Scout 17B – A general-purpose multimodal mannequin with 16 consultants, 17 billion lively parameters, and 109 billion whole parameters that delivers superior efficiency in comparison with all earlier Llama fashions. Amazon Bedrock presently helps a 3.5 million token context window for Llama 4 Scout, with plans to develop within the close to future.

Use circumstances for Llama 4 fashions
You should use the superior capabilities of Llama 4 fashions for a variety of use circumstances throughout industries:

Enterprise purposes – Construct clever brokers that may motive throughout instruments and workflows, course of multimodal inputs, and ship high-quality responses for enterprise purposes.

Multilingual assistants – Create chat purposes that perceive photographs and supply high-quality responses throughout a number of languages, making them accessible to international audiences.

Code and doc intelligence – Develop purposes that may perceive code, extract structured information from paperwork, and supply insightful evaluation throughout massive volumes of textual content and code.

Buyer assist – Improve assist techniques with picture evaluation capabilities, enabling simpler drawback decision when prospects share screenshots or images.

Content material creation – Generate artistic content material throughout a number of languages, with the power to know and reply to visible inputs.

Analysis – Construct analysis purposes that may combine and analyze multimodal information, offering insights throughout textual content and pictures.

Utilizing Llama 4 fashions in Amazon Bedrock
To make use of these new serverless fashions in Amazon Bedrock, I first have to request entry. Within the Amazon Bedrock console, I select Mannequin entry from the navigation pane to toggle entry to Llama 4 Maverick 17B and Llama 4 Scout 17B fashions.

Console screenshot.

The Llama 4 fashions will be simply built-in into your purposes utilizing the Amazon Bedrock Converse API, which supplies a unified interface for conversational AI interactions.

Right here’s an instance of find out how to use the AWS SDK for Python (Boto3) with Llama 4 Maverick for a multimodal dialog:

import boto3
import json
import os

AWS_REGION = "us-west-2"
MODEL_ID = "us.meta.llama4-maverick-17b-instruct-v1:0"
IMAGE_PATH = "picture.jpg"


def get_file_extension(filename: str) -> str:
    """Get the file extension."""
    extension = os.path.splitext(filename)[1].decrease()[1:] or 'txt'
    if extension == 'jpg':
        extension = 'jpeg'
    return extension


def read_file(file_path: str) -> bytes:
    """Learn a file in binary mode."""
    attempt:
        with open(file_path, 'rb') as file:
            return file.learn()
    besides Exception as e:
        elevate Exception(f"Error studying file {file_path}: {str(e)}")

bedrock_runtime = boto3.consumer(
    service_name="bedrock-runtime",
    region_name=AWS_REGION
)

request_body = {
    "messages": [
        {
            "role": "user",
            "content": [
                {
                    "text": "What can you tell me about this image?"
                },
                {
                    "image": {
                        "format": get_file_extension(IMAGE_PATH),
                        "source": {"bytes": read_file(IMAGE_PATH)},
                    }
                },
            ],
        }
    ]
}

response = bedrock_runtime.converse(
    modelId=MODEL_ID,
    messages=request_body["messages"]
)

print(response["output"]["message"]["content"][-1]["text"])

This instance demonstrates find out how to ship each textual content and picture inputs to the mannequin and obtain a conversational response. The Converse API abstracts away the complexity of working with completely different mannequin enter codecs, offering a constant interface throughout fashions in Amazon Bedrock.

For extra interactive use circumstances, you too can use the streaming capabilities of the Converse API:

response_stream = bedrock_runtime.converse_stream(
    modelId=MODEL_ID,
    messages=request_body['messages']
)

stream = response_stream.get('stream')
if stream:
    for occasion in stream:

        if 'messageStart' in occasion:
            print(f"nRole: {occasion['messageStart']['role']}")

        if 'contentBlockDelta' in occasion:
            print(occasion['contentBlockDelta']['delta']['text'], finish="")

        if 'messageStop' in occasion:
            print(f"nStop motive: {occasion['messageStop']['stopReason']}")

        if 'metadata' in occasion:
            metadata = occasion['metadata']
            if 'utilization' in metadata:
                print(f"Utilization: {json.dumps(metadata['usage'], indent=4)}")
            if 'metrics' in metadata:
                print(f"Metrics: {json.dumps(metadata['metrics'], indent=4)}")

With streaming, your purposes can present a extra responsive expertise by displaying mannequin outputs as they’re generated.

Issues to know
The Llama 4 fashions can be found immediately with a completely managed, serverless expertise in Amazon Bedrock within the US East (N. Virginia) and US West (Oregon) AWS Areas. It’s also possible to entry Llama 4 in US East (Ohio) by way of cross-region inference.

As standard with Amazon Bedrock, you pay for what you utilize. For extra data, see Amazon Bedrock pricing.

These fashions assist 12 languages for textual content (English, French, German, Hindi, Italian, Portuguese, Spanish, Thai, Arabic, Indonesian, Tagalog, and Vietnamese) and English when processing photographs.

To start out utilizing these new fashions immediately, go to the Meta Llama fashions part within the Amazon Bedrock Person Information. It’s also possible to discover how our Builder communities are utilizing Amazon Bedrock of their options within the generative AI part of our neighborhood.aws web site.

Danilo


How is the Information Weblog doing? Take this 1 minute survey!

(This survey is hosted by an exterior firm. AWS handles your data as described within the AWS Privateness Discover. AWS will personal the info gathered by way of this survey and won’t share the knowledge collected with survey respondents.)

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles