Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

This article is a Private article. Only a writer and users who know the URL can access it.
Please change open range to public in publish setting if you want to share this article with other users.

AWS Certified AI Practitioner(AIF)対策:Bedrockとは

Last updated at Posted at 2024-12-09

Bedrockの特徴

『ユーザーが複数の人気基盤モデルにアクセスできるサービス』

モデルのトレーニングやホスティング、管理を行う必要がありません。

基盤モデルを選ぶ基準

特定のタスク(例:テキスト生成、翻訳、画像分類)に対して、どのモデルが最も適しているかを考慮します。

統一されたAPI

『ユーザーは簡単にAPIを通じてモデルを利用できる』

Bedrockでは、さまざまな基盤モデルを 統一されたAPI を通じて呼び出す仕組みが提供されています。

  • 異なるベンダーのモデルを利用する際にも同じコードベースを使用できるため、新しいモデルの導入が容易です。
  • 新たなAPIを学習したり構築したりする負担が軽減されます。

生成モデルの出力

明確なプロンプトを設計 し、期待されるフォーマットや出力形式を具体的に指定することが最も効果的です。

プロンプト管理

Bedrockが提供する機能で、

『ユーザーが独自のプロンプトを作成・保存し、異なるワークフローで再利用する』

ことを可能にします。

Bedrockのエージェント

Bedrockのエージェントは、ユーザーからの問い合わせやリクエストに応答するために、アクションを実行できます。

このアクションの実態は

『AWS Lambda関数』

です。

InvokeModel

InvokeModelは、

『Bedrock での、生成 AI モデルを利用する際に使用する主要な API 呼び出す』

ための方法です。

このメソッドを使って、テキストや画像などの入力データをモデルに渡し、生成された結果を取得します。

*# Convert the native request to JSON.*

request = json.dumps(native_request)

try:

*# Invoke the model with the request.*

response = brt.invoke_model(modelId=model_id, body=request)

except (ClientError, Exception) as e:
    print(f"ERROR: Can't invoke '{model_id}'. Reason: {e}")
    exit(1)

抜粋:モデルにテキストプロンプトを送信し、 を使用してテキストレスポンスを生成する InvokeModel

Amazon Nova

2024年12月、AWS に Amazon が新しい基盤モデルが追加されました。

テキストのみのモデルである micro やマルチモーダルにも対応する Lite 、Pro といったシリーズが展開されています。

他の基盤と比べて低コストで利用できる。マルチモーダルに対応している。

0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?