Skip to Content
生成AIデザインパターン ―AIエージェント構築、アプリケーション開発のベストプラクティス
book

生成AIデザインパターン ―AIエージェント構築、アプリケーション開発のベストプラクティス

by Valliappa Lakshmanan, Hannes Hapke, 中田 秀基
May 2026
Intermediate
520 pages
8h 21m
Japanese
O'Reilly Japan, Inc.
Content preview from 生成AIデザインパターン ―AIエージェント構築、アプリケーション開発のベストプラクティス

8章制約への対応

単にLLMを動作させるのではなく、実運用環境にデプロイするには、独特の困難が伴う。LLMは驚くべき機能を提供するが、かなりの計算資源を必要とするし、遅延も考慮しなければならない。また、規模が大きくなるとすぐにコストが問題になる。1つのクエリに対してだけ動作すればいい概念実証と、数千のユーザにサービスを提供する実運用システムとの間には大きなギャップがあるが、しばしば見落とされる。

本章では、LLMを実運用システムにデプロイする際に直面する困難に対処するパターンを紹介する。例えば、ハードウェアの制約、予算の制約、厳しい遅延要件などだ。本章で紹介するパターンは、最適なLLMデプロイを実現できる実証済みの戦略だ。

本章では、実運用環境でのさまざまな制約に対処する5つのパターンについて説明する。小規模言語モデル[パターン24]では、モデルの蒸留と量子化によって計算オーバーヘッドを削減する方法を示す。プロンプトキャッシュ[パターン25]では、冗長性を排除し、コストと遅延の両方を削減する方法を示す。推論最適化[パターン26]では、連続バッチ処理や投機的デコードなどの高度なテクニックを取り上げ、ハードウェアの利用率を最大化する。デグレデーションテスト[パターン27]では、LLMベースのアプリケーションの性能が良好であることを検証するための評価指標を示し、一部の点で性能が不足している場合に取るべき対処法について説明する。最後の長期記憶[パターン28]は、セッションにまたがってユーザの履歴を保持することで、ユーザのリクエストを記憶してパーソナライゼーションを行う方法を示す。

本章で示すパターンは全体として、資源集約的な作業であったLLMデプロイを、効率的でスケーラブルな実運用システムに変えるための、包括的なツールキットを提供する。 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

大規模データ管理 ―エンタープライズアーキテクチャのベストプラクティス

大規模データ管理 ―エンタープライズアーキテクチャのベストプラクティス

Piethein Strengholt, 村上 列

Publisher Resources

ISBN: 9784814401635Publisher Website