AWS: Bedrock: Knowlege Base

仕組み

RAG:

  • データストアから情報を取得して、大規模言語モデル (LLM) によって生成されるレスポンスを拡張する一般的な手法です。

リージョンとモデル

リージョン:

  • 米国東部 (バージニア北部)
  • 米国西部 (オレゴン)

埋め込み:

  • Titan G1 埋め込み - テキスト
  • Cohere Embed 英語
  • Cohere Embed 多言語

生成:

  • Anthropic Claude Instant v1
  • Anthropic Claude v2.0
  • Anthropic Claude v2.1

Vector Store

4種:

  • Amazon OpenSearch Serverless
  • Amazon Aurora
  • Pinecone
  • Redis Enterprise Cloud

Aurora:Aurora Serverless v2

  • Aurora は、ストレージや Data API の利用料などコストがかかる点は複数ありますが、 主に発生する ACU 時間あたりのコストを以下に記載します。
  • ACU 時間あたり、USD 0.12 の利用料が発生
  • 最低 0.5ACU で作成することができるため、 月額$43.2(0.12 _ 0.5(ACU) _ 24(時間) * 30(日))、1 ドル 150 円換算で月額 6480 円

S3

  • ストレージサイズ

S3 -> Vector Store

  • Bedrock から基盤モデルを利用

埋め込みモデル:

  • Amazon Titan Embeddings G1 - Text v1.2
  • Corhere Embed English v3
  • Corhere Embed Multilingual v3

Cohere 料金:

Cohere モデル入力トークン 1,000 個あたりの価格出力トークン 1,000 個あたりの価格
Command0.0015 USD0.0020 USD
コマンドライト0.0003 USD0.0006 USD
埋め込み — 英語0.0001 USD該当なし
埋め込み — 多言語0.0001 USD該当なし

Tital 料金(テキストモデルのオンデマンドおよびバッチ価格):

Amazon Titan モデル入力トークン 1,000 個あたりの価格出力トークン 1,000 個あたりの価格
Titan Text – LiteUSD 0.0003USD 0.0004
Titan Text – ExpressUSD 0.0008USD 0.0016
Titan Text 埋め込みUSD 0.0001N/A

1000 ファイル -> 1M トークン -> 0.0001 * 1000 = 1 ドル

生成(Claude3 (Oregon, virginia))

100K トークン == 約 10 万文字分 1000 文字/doc とすると 100 ファイル

note:

  • Tokyo だと (Claude2.1, Tital)
Anthropic モデル入力トークン 1,000 個あたりの価格出力トークン 1,000 個あたりの価格
Claude Instant0.00080 USD0.00240 USD
Claude0.00800 USD0.02400 USD

1000 ファイル -> 1M トークン -> 0.008 * 1000 = 80 ドル