Amazon Bedrock基础指南:参考资料、模型特点、价格、使用方法及运行时API执行示例

这次我整理了2023年9月28日正式发布的Amazon Bedrock的基本信息和Runtime API的执行示例。此外,还在文中插入了最基本的术语解释,以帮助理解令牌和参数的概念。

※本文及其他由本文作者发表的文章中所包含的源代码均为自主研究活动的一部分。如需使用,请自行承担责任。另外,代码可能会在没有预告的情况下进行修改,敬请谅解。

Amazon Bedrock的基本情報

Amazon Bedrock 的参考资料与学习资源

有助于理解 Amazon Bedrock 的主要参考资料和学习资源如下:

本文内容基于这些参考资料和学习资源中的信息。

Amazon Bedrock是什么?

Amazon Bedrock 是一项服务,提供通过 API 访问基础模型(Foundation Models, FMs)和使用独有数据对这些模型进行私有化定制的功能。它支持多种基础模型,包括 AI21 Labs 的 Jurassic-2、Amazon 的 Titan、Anthropic 的 Claude、Cohere 的 Command、Meta 的 Llama 2 和 Stability AI 的 Stable Diffusion。用户可以根据不同的使用场景,如文本生成、聊天机器人、搜索、文本摘要、图像生成和个性化推荐等,选择适合的基础模型来构建和扩展生成式 AI 应用。

在处理文本的生成型AI中,"令牌(tokens)"是什么?

在查看 Amazon Bedrock 的模型列表和价格表之前,我们先简要说明一下作为限制和计费单位的"令牌(tokens)"。

请注意,为了便于理解,这里提供的定义可能与严格的定义有所不同。

在处理文本的生成型AI中,"令牌(tokens)"是指将文本分割成有意义部分的单位。令牌可以是单词,但不一定完全等同于单词,也可能是字符、子词等。

例如,将字符串Amazon Bedrock is amazing!按单词进行令牌化,结果如下:

"Amazon", "Bedrock", "is", "amazing", "!"

然而,如果使用不是基于单词的其他令牌化方法(Tokenization),可能会将空格也包括在内进行分割,结果如下:

["Amazon", " ", "Bedrock", " ", "is", " ", "amazing", "!"]

令牌化方法除了基于单词外,还有如 Unigram Tokenization、WordPiece、SentencePiece、Byte Pair Encoding(BPE)等高级方法。不同的模型采用不同的令牌化手法,因此在使用时需要注意这一点。

特别是在进行基于令牌的费用计算时,最好根据目标模型的令牌化手法,在接近实际使用条件的场景中计算令牌数。然而,个人来说,在考虑 Generative AI 服务的月度预算时,如果不想花费过多时间和精力在详细的令牌数预测上,我会使用 Generative AI 本身进行计算,或者为了方便计算,将 1 个字符估算为 1 个令牌,略高估费用。

准备好的模型列表

本文是根据产品页面的 Amazon Bedrock -- AWSAWS Management Console 中的 Amazon Bedrock Model Providers 在撰写本文时的数据进行总结的。

※支持嵌入(Embed)的模型能够将文本输入(如单词、短语或较大的文本单位)转换为包含文本意义的数值表示(嵌入)。

Model Provider Model Model ID Max tokens Modality (Data Type) Languages Supported use cases
AI21 Labs Jurassic-2 Ultra (v1) ai21.j2-ultra-v1 8191 Text English Spanish French German Portuguese Italian Dutch Open book question answering summarization draft generation information extraction ideation
AI21 Labs Jurassic-2 Mid (v1) ai21.j2-mid-v1 8191 Text English Spanish French German Portuguese Italian Dutch Open book question answering summarization draft generation information extraction ideation
Amazon Titan Embeddings G1 - Text (v1.2) amazon.titan-embed-text-v1 8k Embedding English, Arabic, Chinese (Sim.), French, German, Hindi, Japanese, Spanish, Czech, Filipino, Hebrew, Italian, Korean, Portuguese, Russian, Swedish, Turkish, Chinese (trad), Dutch, Kannada, Malayalam, Marathi, Polish, Tamil, Telugu and others. Translate text inputs (words, phrases or possibly large units of text) into numerical representations (known as embeddings) that contain the semantic meaning of the text.
Amazon Titan Text G1 - Lite amazon.titan-text-lite-v1 4k Text English Summarization and copywriting.
Amazon Titan Text G1 - Express amazon.titan-text-express-v1 8k Text English (GA), Multilingual in 100+ languages (Preview) Open ended text generation brainstorming summarization code generation table creation data formatting paraphrasing chain of though rewrite extraction Q&A chat
Amazon Titan Image Generator G1 amazon.titan-image-generator-v1 77 Image English Text to image generation image editing image variations
Amazon Titan Multimodal Embeddings G1 amazon.titan-embed-image-v1 128 Embedding English Search recommendation personalization
Anthropic Claude 3.5 Sonnet anthropic.claude-3-5-sonnet-20240620-v1:0 200k Text English and multiple other languages Complex tasks like customer support Coding Data Analysis and Visual Processing. Streamlining of Workflows Generation of Insights and Production of High-Quality Natural-Sounding Content.
Anthropic Claude 3 Opus anthropic.claude-3-opus-20240229-v1:0 200k Text English and multiple other languages Task automation: plan and execute complex actions across APIs and databases, interactive coding R&D: research review, brainstorming and hypothesis generation, drug discovery Strategy: advanced analysis of charts & graphs, financials and market trends, forecasting
Anthropic Claude 3 Sonnet anthropic.claude-3-sonnet-20240229-v1:0 200k Text English and multiple other languages Data processing: RAG or search & retrieval over vast amounts of knowledge Sales: product recommendations, forecasting, targeted marketing Time-saving tasks: code generation, quality control, parse text from images
Anthropic Claude 3 Haiku anthropic.claude-3-haiku-20240307-v1:0 200k Text English and multiple other languages Customer interactions: quick and accurate support in live interactions, translations Content moderation: catch risky behavior or customer requests Cost-saving tasks: optimized logistics, inventory management, extract knowledge from unstructured data
Anthropic Claude v2.1 anthropic.claude-v2:1 200k Text English and multiple other languages Question answering information extraction removing PII content generation multiple choice classification Roleplay comparing text summarization document Q&A with citation
Anthropic Claude v2 anthropic.claude-v2 100k Text English and multiple other languages Question answering information extraction removing PII content generation multiple choice classification Roleplay comparing text summarization document Q&A with citation
Anthropic [Legacy version] Claude v1.3 anthropic.claude-v1 100k Text English and multiple other languages Question answering information extraction removing PII content generation multiple choice classification Roleplay comparing text summarization document Q&A with citation
Anthropic Claude Instant v1.2 anthropic.claude-instant-v1 100k Text English and multiple other languages Question answering information extraction removing PII content generation multiple choice classification Roleplay comparing text summarization document Q&A with citation
Cohere Command R+ (v1) cohere.command-r-plus-v1:0 128k Text English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Arabic, and Chinese Complex RAG on large amounts of data Q&A Multi-step tool use chat text generation text summarization
Cohere Command R (v1) cohere.command-r-v1:0 128k Text English, French, Spanish, Italian, German, Portuguese, Japanese, Korean, Arabic, and Chinese Chat text generation text summarization RAG on large amounts of data Q&A function calling
Cohere Command (v14.7) cohere.command-text-v14 4000 Text English Summarization copywriting dialogue extraction question answering
Cohere Command Light (v14.7) cohere.command-light-text-v14 4000 Text English Summarization copywriting dialogue extraction question answering
Cohere Embed English (v3) cohere.embed-english-v3 512 Embedding English Semantic search retrieval-augmented generation (RAG) classification clustering
Cohere Embed Multilingual (v3) cohere.embed-multilingual-v3 512 Embedding 108 Languages Semantic search retrieval-augmented generation (RAG) classification clustering
Meta Llama 3 70B Instruct meta.llama3-70b-instruct-v1:0 8k Text English Language modeling Dialog systems Code generation Following instructions Sentiment analysis with nuances in reasoning Text classification with improved accuracy and nuance Text summarization with accuracy and nuance
Meta Llama 3 8B Instruct meta.llama3-8b-instruct-v1:0 8k Text English Text summarization Text classification Sentiment analysis
Meta Llama 2 Chat 13B meta.llama2-13b-chat-v1 4096 Text English Text generation Conversation Chat based applications
Meta Llama 2 Chat 70B meta.llama2-70b-chat-v1 4096 Text English Text generation Conversation Chat based applications
Mistral AI Mistral 7B Instruct mistral.mistral-7b-instruct-v0:2 32K Text English Classification Text generation Code generation
Mistral AI Mixtral 8x7B Instruct mistral.mixtral-8x7b-instruct-v0:1 32K Text English, French, Italian, German and Spanish Complex reasoning & analysis Text generation Code generation
Mistral AI Mistral Large mistral.mistral-large-2402-v1:0 32K Text English, French, Italian, German and Spanish Complex reasoning & analysis Text generation Code generation RAG Agents
Mistral AI Mistral Small mistral.mistral-small-2402-v1:0 32K Text English, French, Italian, German and Spanish Text generation Code generation Classification RAG Conversation
Stability AI [Legacy version] Stable Diffusion XL (v0.8) stability.stable-diffusion-xl-v0 77 Image English image generation image editing
Stability AI Stable Diffusion XL (v1.0) stability.stable-diffusion-xl-v1 77 Image English image generation image editing

准备好的模型价格

本文参考了 Amazon Bedrock Pricing 页面中的数据进行总结。

未标注价格的模型表示尚未提供该价格选项,或者该模型不支持定制功能。

处理文本的模型价格

处理文本的模型价格如下所示:

按需定价

按需定价是根据每1,000个输入令牌和每1,000个输出令牌的数量进行计算的(不是基于时间的支付)。

预置吞吐量

预置吞吐量通过承诺在指定期间内按时间支付来提供充足的吞吐量,以满足大规模使用的需求。承诺的时间有无期限、1个月和6个月,承诺时间越长,折扣越大。

模型定制(微调)

如果使用微调来创建定制模型,则会产生每1,000个令牌的训练费用以及每个定制模型的月度存储费用。

Model Provider Model On-Demand (per 1000 input tokens) On-Demand (per 1000 output tokens) Provisioned Throughput (per hour per model) Model customization through Fine-tuning
AI21 Labs Jurassic-2 Ultra 0.0188 USD 0.0188 USD - -
AI21 Labs Jurassic-2 Mid 0.0125 USD 0.0125 USD - -
Amazon Titan Text Lite(Titan Text G1 - Lite) 0.0003 USD 0.0004 USD no commitment: 7.10 USD 1-month commitment: 6.40 USD 6-month commitment: 5.10 USD Train(per 1000 tokens): 0.0004 USD Store each custom model(per month): 1.95 USD
Amazon Titan Text Express(Titan Text G1 - Express) 0.0008 USD 0.0016 USD no commitment: 20.50 USD 1-month commitment: 18.40 USD 6-month commitment: 14.80 USD Train(per 1000 tokens): 0.008 USD Store each custom model(per month): 1.95 USD
Amazon Titan Embeddings(Titan Embeddings G1 - Text) 0.0001 USD N/A no commitment: N/A 1-month commitment: 6.40 USD 6-month commitment: 5.10 USD -
Anthropic Claude 3.5 Sonnet 0.00300 USD 0.01500 USD no commitment: N/A 1-month commitment: N/A 6-month commitment: N/A -
Anthropic Claude 3 Opus 0.01500 USD 0.07500 USD no commitment: N/A 1-month commitment: N/A 6-month commitment: N/A -
Anthropic Claude 3 Sonnet 0.00300 USD 0.01500 USD no commitment: N/A 1-month commitment: N/A 6-month commitment: N/A -
Anthropic Claude 3 Haiku 0.00025 USD 0.00125 USD no commitment: N/A 1-month commitment: N/A 6-month commitment: N/A -
Anthropic Claude(v2.0, v2.1) 0.00800 USD 0.02400 USD no commitment: N/A 1-month commitment: 63.00 USD 6-month commitment: 35.00 USD -
Anthropic Claude Instant(v1.2) 0.00080 USD 0.00240 USD no commitment: N/A 1-month commitment: 39.60 USD 6-month commitment: 22.00 USD -
Cohere Command R+ 0.0030 USD 0.0150 USD - -
Cohere Command R 0.0005 USD 0.0015 USD - -
Cohere Command 0.0015 USD 0.0020 USD no commitment: 49.50 USD 1-month commitment: 39.60 USD 6-month commitment: 23.77 USD Train(per 1000 tokens): 0.004 USD Store each custom model(per month): 1.95 USD
Cohere Command-Light 0.0003 USD 0.0006 USD no commitment: 8.56 USD 1-month commitment: 6.85 USD 6-month commitment: 4.11 USD Train(per 1000 tokens): 0.001 USD Store each custom model(per month): 1.95 USD
Cohere Embed -- English 0.0001 USD N/A no commitment: 7.12 USD 1-month commitment: 6.76 USD 6-month commitment: 6.41 USD -
Cohere Embed -- Multilingual 0.0001 USD N/A no commitment: 7.12 USD 1-month commitment: 6.76 USD 6-month commitment: 6.41 USD -
Meta Llama 3 Instruct 8B 0.0003 USD 0.0006 USD - -
Meta Llama 3 Instruct 70B 0.00265 USD 0.0035 USD - -
Meta Llama 2 Chat 13B 0.00075 USD 0.00100 USD no commitment: N/A 1-month commitment: 21.18 USD 6-month commitment: 13.08 USD Train(per 1000 tokens): 0.00149 USD Store each custom model(per month): 1.95 USD
Meta Llama 2 Chat 70B 0.00195 USD 0.00256 USD no commitment: N/A 1-month commitment: 21.18 USD 6-month commitment: 13.08 USD Train(per 1000 tokens): 0.00799 USD Store each custom model(per month): 1.95 USD
Mistral AI Mistral 7B Instruct 0.00015 USD 0.0002 USD - -
Mistral AI Mixtral 8x7B Instruct 0.00045 USD 0.0007 USD - -
Mistral AI Mistral Small 0.001 USD 0.003 USD - -
Mistral AI Mistral Large 0.004 USD 0.012 USD - -

多模态模型的价格

处理图像和其他媒体的多模态模型的定价基于图像数量、分辨率等多个标准,针对每个模型进行了总结。

Model Provider Model Standard quality(<51 steps) (per image) Premium quality(>51 steps) (per image) Provisioned Throughput (per hour per model) Model customization through Fine-tuning
Stability AI Stable Diffusion XL (v0.8) 512x512 or smaller: 0.018 USD Larger than 512x512: 0.036 USD 512x512 or smaller: 0.036 USD Larger than 512x512: 0.072 USD - -
Stability AI Stable Diffusion XL (v1.0) Up to 1024 x 1024: 0.04 USD Up to 1024 x 1024: 0.08 USD no commitment: N/A 1-month commitment: 49.86 USD 6-month commitment: 46.18 USD -
Model Provider Model Standard quality (per image) Premium quality (per image) Provisioned Throughput (per hour per model) Model customization through Fine-tuning
Amazon Titan Image Generator 512x512: 0.008 USD 1024X1024: 0.01 USD 512x512: 0.01 USD 1024X1024: 0.012 USD no commitment: N/A 1-month commitment: 16.20 USD 6-month commitment: 13.00 USD Train(per image seen): 0.005 USD Store each custom model(per month): 1.95 USD
Amazon Titan Image Generator(custom models) 512x512: 0.018 USD 1024X1024: 0.02 USD 512x512: 0.02 USD 1024X1024: 0.022 USD no commitment: 23.40 USD 1-month commitment: 21.00 USD 6-month commitment: 16.85 USD -
Model Provider Model On-Demand (per 1000 input tokens) On-Demand (per 1000 input image) Provisioned Throughput (per hour per model) Model customization through Fine-tuning
Amazon Titan Multimodal Embeddings 0.0008 USD 0.00006 USD no commitment: 9.38 USD 1-month commitment: 8.45 USD 6-month commitment: 6.75 USD Train(per image seen): 0.0002 USD Store each custom model(per month): 1.95 USD

Amazon Bedrock的基本使用方法

Amazon Bedrock的入门和准备

要开始使用Amazon Bedrock,请在AWS Management Console中导航到Amazon Bedrock的Model access页面,点击Edit,选择要使用的模型,然后点击Save changes请求访问该模型。
Amazon Bedrock > Model access - AWS Management Console

※使用Anthropic的模型时,需填写公司信息和使用目的等内容并提交请求。

请求被批准后,模型的访问权限将被激活,并可开始使用。

Amazon Bedrock Runtime API的InvokeModel和InvokeModelWithResponseStream方法及其参数

介绍实际使用Amazon Bedrock的API。

与Amazon Bedrock相关的API主要分为Bedrock API和Bedrock Runtime API。

Bedrock API用于通过微调创建自定义模型以及购买模型的预置吞吐量等操作AWS资源。

另一方面,Bedrock Runtime API用于指定基础模型或自定义模型,发送输入数据(Prompt)的请求,并从响应中获取输出数据(Completions),用于实际的执行。

在Amazon Bedrock Runtime API中,有InvokeModel和InvokeModelWithResponseStream用于实际调用和使用模型。

Amazon Bedrock Runtime API的InvokeModel是一种API,可以一次性获取请求的响应内容。

而Amazon Bedrock Runtime API的InvokeModelWithResponseStream是一种API,可以逐步地以流的形式获取响应内容的一部分字符。如果您已经使用过类似于聊天形式的生成式AI服务,可能见过Prompt的结果逐字显示的界面,InvokeModelWithResponseStream就可以用于这种显示方式。

Amazon Bedrock Runtime API的InvokeModel和InvokeModelWithResponseStream的请求中指定的参数是通用的,具体如下。

复制代码
accept: 响应推理内容的MIME类型。(默认值: application/json)
contentType: 请求输入数据的MIME类型。(默认值: application/json)
modelId: [必填] 模型的标识符。(例如: ai21.j2-ultra-v1)
body: [必填] 以contentType指定的格式提供的输入数据。根据每个模型支持的推理参数指定body字段的格式。

一般推理参数的含义

接下来将介绍Amazon Bedrock Runtime API的实际使用例子,但在此之前,我们先简单说明一下在模型请求的Body中经常使用的一般推理参数。不过,为了便于理解,这里提供的定义可能与严格的定义有所不同。

temperature

这是一个用于调整模型输出概率分布的随机性和多样性的参数。值越大,生成的回答倾向于更随机和多样化;值越小,生成的回答倾向于更高概率的预估答案。temperature的通常范围是0到1之间,但有些模型可以设置超过1的值。例如,temperature=1.0时会生成更随机和多样化的回答,而temperature=0.1时则更可能生成高概率的预估答案。

topK

这是一个通过限制模型考虑的前K个令牌来调整随机性和多样性的参数。topK的最佳范围因使用的模型而异。设置此值后,输出令牌将从这些前K个令牌中选择。例如,topK=10表示模型在生成回答时只考虑概率最高的前10个令牌。简而言之,topK通过限制可选令牌的数量来调整多样性。

topP

这是一个通过从累积概率未超过指定P的令牌集合中采样来调整随机性和多样性的参数。通常的topP范围是0到1之间。例如,topP=0.9表示模型在生成回答时只考虑从概率最高的令牌到累积概率未超过0.9的令牌。简而言之,topP通过限制可选令牌的累积概率来调整多样性。

maxTokens

这是一个限制生成的令牌最大数量的参数,用于控制生成文本的长度。例如,maxTokens=800表示模型生成的文本不会超过800个令牌。

在API请求中,可以组合使用temperature、topK、topP参数来平衡信心度和多样性,并使用maxTokens限制输出的令牌数量。

关于Amazon Bedrock中各个模型的详细推理参数,请参考《Inference parameters for foundation models - Amazon Bedrock》。

使用AWS SDK for Python (Boto3) 调用Amazon Bedrock Runtime的invoke_model示例

这里介绍了使用AWS SDK for Python (Boto3)在AWS Lambda函数中调用Amazon Bedrock Runtime的invoke_model的示例。

在撰写本文时,AWS Lambda函数的默认AWS SDK for Python (Boto3)尚不支持调用bedrock和bedrock-runtime的Client。

因此,以下是添加了最新的AWS SDK for Python (Boto3)到Lambda Layer中,并使用bedrock-runtime的Client的示例。

  • 示例代码(AWS Lambda函数)

    import boto3
    import json
    import os
    region = os.environ.get('AWS_REGION')
    bedrock_runtime_client = boto3.client('bedrock-runtime', region_name=region)
    def lambda_handler(event, context):
    modelId = 'ai21.j2-ultra-v1'
    contentType = 'application/json'
    accept = 'application/json'
    body = json.dumps({
    "prompt": "Please tell us all the states in the U.S.",
    "maxTokens": 800,
    "temperature": 0.7,
    "topP": 0.95
    })
    response = bedrock_runtime_client.invoke_model(
    modelId=modelId,
    contentType=contentType,
    accept=accept,
    body=body
    )
    response_body = json.loads(response.get('body').read())
    return response_body

  • 执行结果示例(上述AWS Lambda函数的返回值)

    {
    "id": 1234,
    "prompt": {
    "text": "Please tell us all the states in the U.S.",
    "tokens": [
    〜省略〜
    ]
    },
    "completions": [
    {
    "data": {
    "text": "\nUnited States of America is a federal republic consisting of 50 states, a federal district (Washington, D.C., the capital city of the United States), five major territories, and various minor islands. The 50 states are Alabama, Alaska, Arizona, Arkansas, California, Colorado, Connecticut, Delaware, Florida, Georgia, Hawaii, Idaho, Illinois, Indiana, Iowa, Kansas, Kentucky, Louisiana, Maine, Maryland, Massachusetts, Michigan, Minnesota, Mississippi, Missouri, Montana, Nebraska, Nevada, New Hampshire, New Jersey, New Mexico, New York, North Carolina, North Dakota, Ohio, Oklahoma, Oregon, Pennsylvania, Rhode Island, South Carolina, South Dakota, Tennessee, Texas, Utah, Vermont, Virginia, Washington, West Virginia, Wisconsin, and Wyoming.",
    "tokens": [
    〜省略〜
    ]
    },
    "finishReason": {
    "reason": "endoftext"
    }
    }
    ]
    }

※本文撰写时,最新的AWS SDK for Python (Boto3) 提供了Amazon Bedrock Runtime的invoke_model_with_response_stream命令。不过,由于计划在另一篇文章中详细说明,因此这篇文章中将不详细讨论。

使用AWS CLI调用Amazon Bedrock Runtime的invoke-model示例

这里介绍了使用AWS CLI调用Amazon Bedrock Runtime的invoke-model示例。

在撰写本文时,Amazon Bedrock Runtime API尚未支持AWS CLI的版本2。

因此,以下示例是使用支持Amazon Bedrock Runtime API的AWS CLI版本1单独安装并执行的。

  • 格式

    aws bedrock-runtime invoke-model
    --region [Region]
    --model-id "[modelId]"
    --content-type "[contentType]"
    --accept "[accept]"
    --body "[body]" [Output FileName]

  • 执行示例

    aws bedrock-runtime invoke-model
    --region us-east-1
    --model-id "ai21.j2-ultra-v1"
    --content-type "application/json"
    --accept "application/json"
    --body "{"prompt": "Please tell us all the states in the U.S.", "maxTokens": 800,"temperature": 0.7,"topP": 0.95}" invoke-model-output.txt

  • 响应示例

    • 屏幕显示
      {"contentType": "application/json"}
    • 文件内容(invoke-model-output.txt)
      {"id": 1234,"prompt": {"text": "Please tell us all the states in the U.S.","tokens": [〜省略〜]},"completions": [{"data": {"text": "\nUnited States of America is a federal republic consisting of 50 states, a federal district (Washington, D.C., the capital city of the United States), five major territories, and various minor islands. The 50 states are Alabama, Alaska, Arizona, Arkansas, California, Colorado, Connecticut, Delaware, Florida, Georgia, Hawaii, Idaho, Illinois, Indiana, Iowa, Kansas, Kentucky, Louisiana, Maine, Maryland, Massachusetts, Michigan, Minnesota, Mississippi, Missouri, Montana, Nebraska, Nevada, New Hampshire, New Jersey, New Mexico, New York, North Carolina, North Dakota, Ohio, Oklahoma, Oregon, Pennsylvania, Rhode Island, South Carolina, South Dakota, Tennessee, Texas, Utah, Vermont, Virginia, Washington, West Virginia, Wisconsin, and Wyoming.","tokens": [〜省略〜]},"finishReason": {"reason": "endoftext"}}]}

※撰写本文时,AWS CLI中尚未提供用于Amazon Bedrock Runtime的invoke-model-with-response-stream命令。

参考:
Amazon Bedrock is now generally available
Amazon Bedrock Is Now Generally Available -- Build and Scale Generative AI Applications with Foundation Models
Amazon Bedrock Pricing
GitHub - aws-samples/amazon-bedrock-workshop: This is a workshop designed for Amazon Bedrock a foundational model service.
What is Amazon Bedrock? - Amazon Bedrock
Bedrock API Reference - Amazon Bedrock
Bedrock - Boto3 documentation
BedrockRuntime - Boto3 documentation
bedrock --- AWS CLI Command Reference
bedrock-runtime --- AWS CLI Command Reference
Amazon Bedrock Model Providers - AWS Management Console

总结

本次介绍了Amazon Bedrock的参考资料、模型列表、价格、使用方法、令牌和参数的术语解释,以及Runtime API的执行示例。通过整理这些信息,我们了解到Amazon Bedrock提供了多种模型,用户可以根据具体的使用场景进行选择,并且可以通过高度兼容的AWS SDK和AWS CLI接口调用。此外,Amazon Bedrock还与其他AWS服务具有很高的兼容性。今后,我们将继续关注Amazon Bedrock的更新、实现方法以及与其他服务的组合使用等方面。

相关推荐
AI量化投资实验室27 分钟前
十年年化50%+的策略如何进化?兼容机器学习流程的量化策略开发,附python代码
人工智能·python·机器学习
机器之心40 分钟前
天工不止造物,也能修bug:Skywork-SWE给代码智能体补上软件工程课
人工智能
程序员阿超的博客1 小时前
Java大模型开发入门 (13/15):拥抱官方标准 - Spring AI框架入门与实践
人工智能·langchain·大模型·spring ai·langchain4j
云资源服务商1 小时前
探秘阿里云EBS存储:云计算的存储基石
服务器·阿里云·云计算
鲲志说1 小时前
告别繁琐配置!用 Trae Remote-SSH 轻松远程开发和部署
人工智能·ai编程
鲲志说1 小时前
零代码开发者的狂欢:用Trae 3分钟复刻「2048」秀翻全场
人工智能·ai编程
中國龍在廣州1 小时前
ChatGPT上瘾,大脑萎缩47%!?
人工智能·科技·机器学习·chatgpt·机器人
新加坡内哥谈技术1 小时前
OpenAI 公布《走向理解与预防失准泛化:由“角色特征”驱动的突现性失准》研究总结
人工智能
云空1 小时前
《Whisper :说明书 》
人工智能·深度学习·神经网络·语音识别·机器翻译
小白狮ww2 小时前
VASP 教程:VASP 机器学习力场计算硅的声子谱
人工智能·深度学习·机器学习·大模型·vasp··声子谱