<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>LLMOps - 東東 GCP 教學 - GCP 實戰講師</title>
	<atom:link href="https://dongdonggcp.com/tag/llmops/feed/" rel="self" type="application/rss+xml" />
	<link>https://dongdonggcp.com</link>
	<description>助你考取證照，轉職成功</description>
	<lastBuildDate>Sat, 28 Nov 2026 02:44:59 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.5</generator>

<image>
	<url>https://dongdonggcp.com/wp-content/uploads/2025/04/cropped-340838097_121391010914395_5443948698124160121_n-32x32.jpg</url>
	<title>LLMOps - 東東 GCP 教學 - GCP 實戰講師</title>
	<link>https://dongdonggcp.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>MLOps、LLMOps、AgentOps、AIOps 差在哪？AI 時代的 Ops 一次看懂</title>
		<link>https://dongdonggcp.com/2026/11/28/mlops-llmops-agentops-aiops-differences/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mlops-llmops-agentops-aiops-differences</link>
					<comments>https://dongdonggcp.com/2026/11/28/mlops-llmops-agentops-aiops-differences/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sat, 28 Nov 2026 02:09:09 +0000</pubDate>
				<category><![CDATA[AI 和機器學習]]></category>
		<category><![CDATA[DevOps]]></category>
		<category><![CDATA[AI Agent]]></category>
		<category><![CDATA[GCP 證照]]></category>
		<category><![CDATA[Gemini]]></category>
		<category><![CDATA[LLMOps]]></category>
		<category><![CDATA[Vertex AI]]></category>
		<category><![CDATA[生成式 AI]]></category>
		<guid isPermaLink="false">https://dongdonggcp.com/?p=13886</guid>

					<description><![CDATA[<p>LLMOps 是什麼？白話比較 MLOps、LLMOps、AgentOps、AIOps：前三個顧 AI，AIOps 拿 AI 做維運。實測呼叫 Gemini 看 token 用量，思考等級一調費用差 15 倍，附新版考綱對應。</p>
<p>The post <a href="https://dongdonggcp.com/2026/11/28/mlops-llmops-agentops-aiops-differences/">MLOps、LLMOps、AgentOps、AIOps 差在哪？AI 時代的 Ops 一次看懂</a> first appeared on <a href="https://dongdonggcp.com">東東 GCP 教學 - GCP 實戰講師</a>.</p>]]></description>
										<content:encoded><![CDATA[<p class="wp-block-paragraph"><strong>MLOps、LLMOps、AgentOps、AIOps 差在哪？前三個是維運 AI 系統，AIOps 反過來拿 AI 做維運。</strong></p>



<p class="wp-block-paragraph">這四個詞都是「某某 Ops」，看起來像一家人，其實分成兩邊：<strong>MLOps、LLMOps、AgentOps 是「顧 AI」</strong>，被照顧的是 AI 模型和 AI 應用，三個的差別在顧的對象越來越新（機器學習模型 → 大型語言模型 → 會自己動手的 agent）；<strong>AIOps 是「用 AI 來顧系統」</strong>，被照顧的是你整套系統，AI 只是幫手。</p>



<p class="wp-block-paragraph">光講定義太抽象，所以這篇也會實際做一次：在 Google Cloud 上用 Cloud Shell 呼叫一次 Gemini 模型，看回應裡記錄的 <strong>token 用量</strong>，再到 Cloud Monitoring 找到同一批呼叫。結果很直接：這一次實測，同一個問題、同一個模型，只是把「思考等級」從預設的 MEDIUM 改成 LOW，<strong>token 從 833 個降到 68 個、費用差了約 15 倍</strong>（各跑一次的結果，不是固定比例）。這就是 LLMOps 為什麼要盯 token。所有輸出都是 2026 年 11 月 28 日早上在測試專案實際跑出來的，五次模型呼叫加起來不到 0.01 美元。</p>



<p class="wp-block-paragraph">這篇寫給聽過這些名詞但分不清楚的人、正在考慮轉職雲端的人，或準備 GCP DevOps 證照的人，不用先會寫程式。這是「DevOps 證照＋Ops 名詞」系列第 8 篇。</p>



<p class="wp-block-paragraph">先看這張圖的四個標題和最下面那條色帶，名詞下面會一個一個講：</p>



<figure class="wp-block-image aligncenter size-full"><img fetchpriority="high" decoding="async" width="1200" height="675" src="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-cards-01-four-ops.png" alt="MLOps、LLMOps、AgentOps、AIOps 差在哪：MLOps 管預測模型、盯準確率和資料漂移；LLMOps 管大型語言模型應用、盯回答品質、token 和延遲；AgentOps 管會自己呼叫工具的 agent、盯每一步做了什麼；AIOps 方向相反，是拿 AI 幫忙做維運，GCP 例子是 Gemini Cloud Assist" class="wp-image-13861" srcset="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-cards-01-four-ops.png 1200w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-cards-01-four-ops-300x169.png 300w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-cards-01-four-ops-1024x576.png 1024w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-cards-01-four-ops-768x432.png 768w" sizes="(max-width: 1200px) 100vw, 1200px" /></figure>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">為什麼你需要知道</h2>


<ul class="wp-block-list">
<li><strong>AI 應用是按 token 收錢的</strong>：一般網站多一個使用者，伺服器費用多一點點；AI 應用每回答一次都在跳錶。這篇實測同一個問題，設定不同，這一次差了約 15 倍。沒人盯，帳單會在你不知道的地方長大</li>

<li><strong>四個名詞很容易講錯</strong>：最常見的錯是把 AIOps 當成「管 AI 的 Ops」。在 Google 的定義裡剛好相反，它是拿 AI 來幫 IT 維運。面試或跟廠商開會講錯，對方會聽出來</li>

<li><strong>跟 DevOps、SRE 是同一套功夫</strong>：監控、控制成本、安全上線，這些維運的基本功搬到 AI 應用上一樣要做。會 DevOps、SRE 的人，轉過去顧 AI 應用會比較容易上手</li>

<li><strong>證照有考</strong>：Professional Cloud DevOps Engineer 新版考綱（2026 年 11 月 23 日起）把 <strong>agent</strong> 寫進了考試定義，還點名 Provisioned Throughput、token 消耗、GKE Agent Sandbox、從 agent 送出 log 和指標。沒打算考證照也看得懂這篇，證照段落可以跳過</li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">先認識四個基本名詞：模型、LLM、agent、token</h2>



<p class="wp-block-paragraph">後面每一段都會用到這四個詞，先用一句話講清楚：</p>


<ul class="wp-block-list">
<li><strong>模型</strong>（model）：從大量資料裡學出規則的程式。例如看過幾百萬筆交易後，學會判斷「這筆刷卡像不像詐騙」。像一位看過很多案例的老師傅，新案子來了靠經驗判斷</li>

<li><strong>大型語言模型</strong>（Large Language Model，LLM）：專門處理文字、而且非常大的模型，能聊天、寫摘要、翻譯、回答問題。Google 的 Gemini 就是一種 LLM</li>

<li><strong>Agent</strong>（AI 代理）：拿 LLM 當大腦、<strong>會自己決定下一步、自己呼叫工具</strong>的程式。例如你說「幫我訂下週二的會議室」，它會自己查行事曆、查空房間、送出預約。LLM 只會「回答」，agent 會「動手做」</li>

<li><strong>Token</strong>（詞元）：LLM 計算文字量的單位，可以想成<strong>計程車的跳錶單位</strong>。模型讀進去的字（輸入）和寫出來的字（輸出）都換算成 token 收費。一個 token 不等於一個字，同一句話換算成幾個 token，要看模型怎麼切（後面會實測）</li>
</ul>



<p class="wp-block-paragraph"><strong>Ops</strong>（Operations，維運）則是讓系統上線之後持續正常運作的工作：監控、處理故障、控制成本、更新版本。DevOps 是讓開發和維運一起對上線結果負責的文化和做法，像餐廳的廚房（開發）和外場（維運）一起對客人吃得好不好負責，而不是菜端出去就不管（第 2 篇有完整解釋）。下面四個名詞，都是 DevOps 這套想法延伸到 AI 的結果。</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">MLOps 是什麼：顧「會隨時間變笨」的模型</h2>



<p class="wp-block-paragraph"><strong>MLOps（Machine Learning Operations，機器學習維運）是管理機器學習模型整個生命週期的做法，從開發、部署到上線後的監控和重新訓練。</strong> Google Cloud 的〈<a href="https://cloud.google.com/discover/what-is-mlops">What is MLOps?</a>〉列了四件主要工作：追蹤實驗、部署模型、監控模型、用新資料重新訓練（2026 年 11 月查）。</p>



<p class="wp-block-paragraph"><strong>生活比喻</strong>：一家早餐店用「過去一年的銷量」訂出每天要備多少料。剛開始很準，但附近開了一間補習班、天氣變冷，客人的習慣變了，同一套算法就開始備錯量。MLOps 就是<strong>定期檢查算法還準不準、不準就用新資料重算</strong>，而且整套流程自動化。</p>



<p class="wp-block-paragraph"><strong>來龍去脈</strong>：模型跟一般程式最大的不同是<strong>程式碼沒改，它也會變差</strong>，因為外面的世界在變。這叫<strong>資料漂移</strong>（data drift）。DevOps 原本只管「程式碼改了怎麼安全上線」，管不到「資料變了模型怎麼辦」，所以多了 MLOps。</p>



<p class="wp-block-paragraph"><strong>為什麼要學</strong>：只會把模型做出來、不會讓它在正式環境穩定跑的團隊，模型上線幾個月後準確率掉了也不知道。</p>



<p class="wp-block-paragraph">MLOps 這篇只講到夠比較的程度。完整的 MLOps 等級、Vertex AI Pipelines、Kubeflow、TFX 在站上 ML 系列〈<a href="https://dongdonggcp.com/2026/10/25/what-is-mlops-vertex-ai-pipelines-kubeflow-tfx/">MLOps 是什麼？Vertex AI Pipelines、Kubeflow、TFX 介紹</a>〉，模型變笨怎麼抓在〈<a href="https://dongdonggcp.com/2026/10/25/model-monitoring-drift-training-serving-skew/">模型上線後會變笨？Drift 與 Training-Serving Skew 監控</a>〉。</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">LLMOps 是什麼：顧「按字計費、每次回答都不太一樣」的大型語言模型</h2>



<p class="wp-block-paragraph"><strong>LLMOps（Large Language Model Operations，大型語言模型維運）是管理及操作大型語言模型時採用的做法和程序。</strong> 這是 Google Cloud〈<a href="https://cloud.google.com/discover/what-is-llmops?hl=zh-TW">什麼是 LLMOps？</a>〉的定義，頁面列了五類工作：部署和維護、資料管理、訓練和微調（拿自己的資料把現成模型再調一下）、監控和評估、安全和法規遵循（2026 年 11 月查）。</p>



<figure class="wp-block-image aligncenter size-full"><img decoding="async" width="1600" height="572" src="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-16a-llmops-hero.png" alt="Google Cloud 官方〈什麼是 LLMOps（大型語言模型營運）？〉繁中頁面：LLMOps 是指管理及操作大型語言模型時所採用的做法和程序（2026 年 11 月畫面）" class="wp-image-13862" srcset="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-16a-llmops-hero.png 1600w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-16a-llmops-hero-300x107.png 300w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-16a-llmops-hero-1024x366.png 1024w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-16a-llmops-hero-768x275.png 768w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-16a-llmops-hero-1536x549.png 1536w" sizes="(max-width: 1600px) 100vw, 1600px" /></figure>



<p class="wp-block-paragraph"><strong>跟 MLOps 的關係</strong>：Google 的英文頁寫「LLMOps is a specialized subset of MLOps」，也就是 <strong>LLMOps 是 MLOps 的一支</strong>，專門處理 LLM 的特性：模型很大、訓練很複雜、運算需求很高。</p>



<figure class="wp-block-image aligncenter size-full"><img decoding="async" width="1600" height="365" src="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-16b-llmops-vs-mlops.png" alt="Google Cloud〈什麼是 LLMOps？〉的「LLMOps 和 MLOps 有何不同？」段落：中文版寫成「LLM 是 MLOps 的一個專業部分」，英文原文是 LLMOps is a specialized subset of MLOps" class="wp-image-13863" srcset="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-16b-llmops-vs-mlops.png 1600w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-16b-llmops-vs-mlops-300x68.png 300w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-16b-llmops-vs-mlops-1024x234.png 1024w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-16b-llmops-vs-mlops-768x175.png 768w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-16b-llmops-vs-mlops-1536x350.png 1536w" sizes="(max-width: 1600px) 100vw, 1600px" /></figure>



<p class="wp-block-paragraph">順便講一個小地方：上圖的繁中翻譯寫成「<strong>LLM</strong> 是 MLOps 的一個專業部分」，少了 Ops 三個字母，英文原文是「<strong>LLMOps</strong> is a specialized subset of MLOps」。讀官方中文頁時，句子怪怪的就切到英文版對一下。</p>



<h3 class="wp-block-heading">生活比喻：請一位按字計費的翻譯</h3>



<p class="wp-block-paragraph">LLM 像一位<strong>按字計費、很聰明但每次說法不太一樣的外包翻譯</strong>。你要管的事會變成：</p>


<ol class="wp-block-list">
<li><strong>給的指示</strong>（提示詞，prompt）寫得好不好：同一份稿子，指示寫清楚，翻得就比較好</li>

<li><strong>翻得對不對</strong>（評估）：沒有標準答案可以對，要另外找方法打分數</li>

<li><strong>每次收多少錢</strong>（token）：他每讀一個字、寫一個字都在計費，連「打草稿」的字也算錢</li>

<li><strong>他哪天退休</strong>（模型版本）：合作的翻譯會換人，換人之後要重新確認品質</li>
</ol>



<p class="wp-block-paragraph"><strong>來龍去脈</strong>：MLOps 的流程是「收資料 → 自己訓練 → 部署 → 監控準確率」。大型語言模型被大量接進產品之後，很多團隊根本不訓練模型，而是呼叫別人的模型，要管的東西變成提示詞、回答品質和用量帳單，原本那套不夠用，才分出 LLMOps 這個說法。</p>



<p class="wp-block-paragraph"><strong>為什麼要學</strong>：LLM 應用上線後，最常出事的不是「當機」，而是「回答變怪了」和「帳單變大了」，這兩件都不會讓伺服器報錯，沒有 LLMOps 的習慣就不會發現。</p>



<h3 class="wp-block-heading">實際上多管了什麼</h3>



<p class="wp-block-paragraph">Google 那一頁講的重點偏向「自己訓練和部署大模型」。但多數公司是<strong>直接呼叫 Gemini 這類現成模型的 API</strong>，不會自己訓練。這種情況下，LLMOps 比 MLOps 多出來的工作，各家整理得不太一樣，下表是整理 Red Hat、Oracle 的說明，加上這篇實測看到的（Google 那頁沒有逐條列）：</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>工作</th><th>白話</th><th>MLOps 有沒有</th></tr></thead><tbody><tr><td><strong>提示詞管理</strong></td><td>提示詞也要版本控制，改一個字可能讓回答變很多</td><td>沒有，傳統模型不吃提示詞</td></tr><tr><td><strong>評估</strong></td><td>回答是一段文字，沒有「對或錯」可以直接比，要用人工、規則或另一個模型打分數</td><td>有，但傳統模型可以直接算準確率</td></tr><tr><td><strong>Token 和成本</strong></td><td>每次呼叫都依 token 收費，要看誰用了多少、哪裡可以省</td><td>比較少，傳統模型回答問題（推論）的成本通常是機器費用</td></tr><tr><td><strong>安全</strong></td><td>提示詞注入（有人在輸入裡下指令騙模型）、回答夾帶個資（站上〈<a href="https://dongdonggcp.com/2026/11/24/model-armor-ai-agent-data-leak/">Model Armor 是什麼？</a>〉有實測）</td><td>比較少</td></tr><tr><td><strong>換模型</strong></td><td>雲端模型會退休，要換新版本，換之前要重測提示詞</td><td>自己訓練的模型自己決定什麼時候換</td></tr></tbody></table></figure>



<h3 class="wp-block-heading">說法不一：LLMOps、GenAIOps、GenOps</h3>



<p class="wp-block-paragraph">同一件事有好幾個名字。Google 在 Kaggle 發布的白皮書《<a href="https://www.kaggle.com/whitepaper-agent-companion">Agents Companion</a>》（2025 年 2 月）列出 MLOps for GenAI、LLMOps、FMOps（FM 是基礎模型 Foundation Model）、GenAIOps 都是在講「生成式 AI 的維運」；Google Cloud 部落格則用過 <strong>GenOps</strong>（MLOps for Gen AI）這個說法（〈<a href="https://cloud.google.com/blog/products/ai-machine-learning/learn-how-to-build-and-scale-generative-ai-solutions-with-genops">GenOps</a>〉）。看到這幾個詞，當成同一類事情就好。</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">AgentOps 是什麼：顧「會自己動手做事」的 agent</h2>



<p class="wp-block-paragraph"><strong>AgentOps（Agent Operations，agent 維運）是管理 AI agent 整個生命週期的做法，重點是看得到 agent 每一步做了什麼、花了多少、有沒有越權。</strong> IBM 的說法是「一套新興的做法，專注在自主 AI agent 的生命週期管理」（2026 年 11 月查 <a href="https://www.ibm.com/think/topics/agentops">IBM〈What is AgentOps?〉</a>）。</p>



<p class="wp-block-paragraph"><strong>生活比喻</strong>：LLM 像坐在辦公室回答問題的顧問，agent 像<strong>派出去幫你跑腿辦事的實習生</strong>。顧問答錯，你看到答案就知道；實習生出去跑了十個地方、簽了三份文件，哪一步出錯，你需要他每一步的<strong>行車記錄器</strong>和收據才查得到。AgentOps 就是幫 agent 裝行車記錄器、定好他能去哪些地方、能花多少錢。</p>



<p class="wp-block-paragraph"><strong>來龍去脈</strong>：這個詞在學術界最早見於 2024 年 11 月的論文〈<a href="https://arxiv.org/abs/2411.05285">AgentOps: Enabling Observability of LLM Agents</a>〉（Liming Dong、Qinghua Lu、Liming Zhu），重點是「agent 整個生命週期要追蹤哪些東西」。Google 的《Agents Companion》白皮書則把 AgentOps 放在 GenAIOps 底下，當成它的一個子類。</p>



<p class="wp-block-paragraph"><strong>為什麼要學</strong>：agent 會呼叫工具、改資料、花錢，一個任務背後可能是十幾次模型呼叫。出事時只看最後的回答，根本不知道它中間做了什麼。</p>



<h3 class="wp-block-heading">AgentOps 比 LLMOps 多管的事</h3>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>多管的事</th><th>白話</th><th>Google Cloud 上的例子</th></tr></thead><tbody><tr><td><strong>追蹤每一步</strong></td><td>一個任務拆成很多步，每一步呼叫了哪個工具、花多久都要記下來</td><td>用 ADK（Google 的 agent 開發工具）寫的 agent，可以把每一步的紀錄送到 Cloud Trace 看（<a href="https://docs.cloud.google.com/stackdriver/docs/instrumentation/ai-agent-adk">官方文件</a>，ADK 1.17.0 起）</td></tr><tr><td><strong>權限和隔離</strong></td><td>agent 能動哪些資料、能不能執行它自己寫的程式</td><td>GKE Agent Sandbox：每個 agent 關在自己的隔離空間裡跑，它自己寫的程式就算有問題也跑不出來（<a href="https://docs.cloud.google.com/kubernetes-engine/docs/concepts/machine-learning/agent-sandbox">官方概覽</a>，細節在考綱那段）</td></tr><tr><td><strong>一個任務花多少</strong></td><td>不是一次呼叫多少錢，是「完成一件事」總共多少錢</td><td>每次呼叫的 token 加總（下面動手做會看到單次呼叫的數字）</td></tr><tr><td><strong>評估整段流程</strong></td><td>不只看答案對不對，也看路線合不合理</td><td>Agent Platform 的「評估」</td></tr></tbody></table></figure>



<p class="wp-block-paragraph">Google Cloud Console 的 Agent Platform 總覽頁，下半部就是一張 agent 工具地圖，分成「建構、擴充、管理」三欄。管理那一欄的 Policies（護欄和規則）、Gateways（存取和流量控制）、Topology（流程對應圖）就是 AgentOps 會用到的東西：</p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1600" height="560" src="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-13-console-agent-tools.png" alt="Agent Platform 總覽頁的 agent 工具地圖：建構欄有 Agent Garden、ADK、MCP 伺服器；擴充欄有部署作業、Memory Bank、工作階段、評估；管理欄有 Agent Registry、Policies、Gateways、Security、Topology（2026 年 11 月畫面）" class="wp-image-13864" srcset="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-13-console-agent-tools.png 1600w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-13-console-agent-tools-300x105.png 300w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-13-console-agent-tools-1024x358.png 1024w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-13-console-agent-tools-768x269.png 768w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-13-console-agent-tools-1536x538.png 1536w" sizes="(max-width: 1600px) 100vw, 1600px" /></figure>



<h3 class="wp-block-heading">說法不一</h3>


<ul class="wp-block-list">
<li><strong>Google Cloud 沒有「What is AgentOps」這一頁</strong>（2026 年 11 月查，網址 <code>/discover/what-is-agentops</code> 回 404），所以這段用 IBM、論文和 Google 白皮書整理</li>

<li><strong>AgentOps 也是一個工具的名字</strong>：IBM 那一頁提到，程式碼平台上有一個工具就叫 AgentOps。看到「用 AgentOps」，要分清楚是指做法還是那個工具</li>

<li>各家列的範圍不同：有的強調治理和護欄，有的強調成本，有的強調追蹤</li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">AIOps 是什麼：方向相反，拿 AI 來做維運</h2>



<p class="wp-block-paragraph"><strong>AIOps（Artificial Intelligence for IT Operations，IT 維運人工智慧）是用機器學習、自然語言處理這類 AI 技術，自動化和改善 IT 系統的管理方式。</strong> 這是 Google Cloud〈<a href="https://cloud.google.com/discover/what-is-aiops?hl=zh-TW">什麼是 AIOps？</a>〉的定義（頁面寫上次更新 2026 年 10 月 15 日）。</p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1600" height="739" src="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-15a-aiops-hero.png" alt="Google Cloud 官方〈什麼是 AIOps？〉繁中頁：AIOps（IT 維運人工智慧）運用機器學習和自然語言處理等技術，自動化及改善 IT 系統的管理方式，上次更新時間 2026 年 10 月 15 日" class="wp-image-13865" srcset="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-15a-aiops-hero.png 1600w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-15a-aiops-hero-300x139.png 300w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-15a-aiops-hero-1024x473.png 1024w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-15a-aiops-hero-768x355.png 768w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-15a-aiops-hero-1536x709.png 1536w" sizes="(max-width: 1600px) 100vw, 1600px" /></figure>



<p class="wp-block-paragraph"><strong>注意方向</strong>：前面三個是「用 Ops 的方法顧 AI」，<strong>AIOps 是「用 AI 來幫 Ops」</strong>。被照顧的是你整套系統（網站、資料庫、網路），AI 是幫維運人員看資料的助手。</p>



<p class="wp-block-paragraph"><strong>生活比喻</strong>：大樓保全中控室原本靠人盯幾十個監視器畫面，眼睛一定會漏。AIOps 像在中控室裝一套<strong>會自己看畫面、把同一件事的警報合併、還能說出「可能是三樓的門沒關好」的系統</strong>，保全人員只要處理它挑出來的重點。</p>



<p class="wp-block-paragraph"><strong>來龍去脈</strong>：一般說法是研究機構 Gartner 在 2016 年左右提出 AIOps 這個詞（二手資料的說法，沒找到 Gartner 原文）。原因是系統越來越複雜，log（系統自動寫下的流水帳）和警示多到人看不完。</p>



<p class="wp-block-paragraph"><strong>為什麼要學</strong>：半夜警報響了 50 封，真正的原因可能只有一個。會用 AIOps 工具的人，能更快找到根本原因。</p>



<h3 class="wp-block-heading">Google 怎麼說 AIOps 怎麼運作</h3>



<p class="wp-block-paragraph">Google 那一頁把 AIOps 分成三步：<strong>觀察</strong>（Observe，把 log、指標、trace 集中起來）、<strong>參與</strong>（Engage，用機器學習分辨重要訊號、合併相關警報、找可能的根因）、<strong>行動</strong>（Act，自動通知對的人，或自動重啟、擴充、回復）。</p>



<p class="wp-block-paragraph">同一頁還有一段「<strong>Gemini Cloud Assist 和 AIOps</strong>」，直接拿 Google 自家的 Gemini Cloud Assist 當 AIOps 的例子：用自然語言請它分析 log 和錯誤訊息、找可能的根因、建議修法。</p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1600" height="605" src="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-15b-aiops-gemini-cloud-assist.png" alt="Google Cloud〈什麼是 AIOps？〉的「Gemini Cloud Assist 和 AIOps」段落：加快疑難排解速度、主動式最佳化、簡化作業三項，說明 Gemini Cloud Assist 怎麼強化 AIOps（2026 年 11 月畫面）" class="wp-image-13866" srcset="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-15b-aiops-gemini-cloud-assist.png 1600w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-15b-aiops-gemini-cloud-assist-300x113.png 300w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-15b-aiops-gemini-cloud-assist-1024x387.png 1024w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-15b-aiops-gemini-cloud-assist-768x290.png 768w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-15b-aiops-gemini-cloud-assist-1536x581.png 1536w" sizes="(max-width: 1600px) 100vw, 1600px" /></figure>



<p class="wp-block-paragraph"><strong>Gemini Cloud Assist</strong> 是 Google Cloud 內建的 AI 助手，官方概覽寫它可以建立「調查」（Investigations）：讀 log、指標和設定，同時驗證好幾種假設，追出根因；也能在 Cloud Alerting 的警示政策裡另外設定，讓警示觸發時自動開調查。<strong>這兩個功能要有 Gemini Code Assist Enterprise 方案才能用</strong>；所有 Google Cloud 使用者都能用的，是在 Observability 裡用自然語言查指標和 log 這類功能（2026 年 11 月查 <a href="https://docs.cloud.google.com/cloud-assist/overview">Gemini Cloud Assist 概覽</a>的功能表）。它目前是<strong>預覽版</strong>，使用要同意預覽條款，所以這篇沒有開來用，第 12 篇：Gemini Cloud Assist、Antigravity、MCP：AI 怎麼幫 DevOps 做事（撰寫中）會實際操作。</p>



<h3 class="wp-block-heading">說法不一：有人把 AIOps 當成「維運 AI」</h3>



<p class="wp-block-paragraph">這是四個名詞裡最亂的一個。Google 的定義是「拿 AI 來做 IT 維運」，業界一般也是這個用法，但資安廠商 Palo Alto Networks 的〈<a href="https://www.paloaltonetworks.com/cyberpedia/what-is-agentops">What is AgentOps</a>〉常見問答裡，把 AIOps 寫成「LLM 工作負載的維運」，意思剛好反過來（2026 年 11 月查，頁面沒寫日期）。</p>



<p class="wp-block-paragraph"><strong>分辨方法</strong>：看那段文字裡「被照顧的是誰」。被照顧的是 AI 模型或 AI 應用，它講的其實是 MLOps／LLMOps 那一類；被照顧的是一般 IT 系統、AI 是幫手，才是 Google 定義的 AIOps。這篇照 Google 的定義。</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">MLOps、LLMOps、AgentOps、AIOps 一張表比較</h2>



<p class="wp-block-paragraph">先看包含關係，結論是：<strong>DevOps 在最外層，往內依序是 MLOps、LLMOps、AgentOps，AIOps 在框外</strong>。各家分法不一樣，下圖是照 Google 的說法畫的：</p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1200" height="675" src="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-cards-02-nested.png" alt="MLOps、LLMOps、AgentOps 的包含關係：DevOps 最外層，MLOps 多了資料和模型，LLMOps／GenAIOps 多了提示詞、評估和 token，AgentOps 多了工具呼叫、多步驟追蹤和權限隔離；AIOps 在框外，是拿 AI 來看 log、找根因、自動處理" class="wp-image-13867" srcset="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-cards-02-nested.png 1200w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-cards-02-nested-300x169.png 300w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-cards-02-nested-1024x576.png 1024w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-cards-02-nested-768x432.png 768w" sizes="(max-width: 1200px) 100vw, 1200px" /></figure>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th></th><th>MLOps</th><th>LLMOps</th><th>AgentOps</th><th>AIOps</th></tr></thead><tbody><tr><td><strong>方向</strong></td><td>顧 AI</td><td>顧 AI</td><td>顧 AI</td><td>用 AI 顧系統</td></tr><tr><td><strong>管的對象</strong></td><td>預測模型（推薦、詐騙偵測、銷量預測）</td><td>大型語言模型應用（聊天、摘要、客服）</td><td>會自己呼叫工具做事的 agent</td><td>整套 IT 系統（網站、資料庫、網路）</td></tr><tr><td><strong>主要指標</strong></td><td>準確率、資料漂移、訓練時間</td><td>回答品質、token 數、每次費用、延遲、錯誤率</td><td>任務成功率、每一步的延遲和工具呼叫、每個任務的成本</td><td>告警數量、找到根因的時間、平均修復時間（MTTR，從出事到恢復平均花多久）</td></tr><tr><td><strong>常見問題</strong></td><td>模型隨時間變笨</td><td>提示詞改壞、帳單暴增、模型退休</td><td>中間某一步出錯、權限太大、跑進無限迴圈</td><td>警報太多、根因難找</td></tr><tr><td><strong>常見工具</strong></td><td>Kubeflow、MLflow、TFX</td><td>評估工具、提示詞管理、Langfuse 這類 LLM 觀測工具</td><td>OpenTelemetry trace、agent 評估框架</td><td>各家 AIOps 平台、可觀測性平台</td></tr><tr><td><strong>在 GCP 上對應</strong></td><td>Vertex AI Pipelines、Model Registry、模型監控（Agent Platform 的「管道」「監控」）</td><td>Agent Platform 的 Gemini API、usageMetadata、Cloud Monitoring 的 token 指標、Model Armor</td><td>ADK＋Cloud Trace、Agent Platform 的評估和 Policies、GKE Agent Sandbox</td><td>Gemini Cloud Assist、Logs Explorer 的 AI 輔助分析</td></tr><tr><td><strong>站上文章</strong></td><td>ML 系列〈MLOps 是什麼〉</td><td>本篇動手做</td><td>第 24 篇（撰寫中）</td><td>第 12 篇（撰寫中）</td></tr></tbody></table></figure>



<p class="wp-block-paragraph"><strong>MTTR</strong> 是 Mean Time To Recovery 的縮寫。<strong>Langfuse</strong> 是一套開源的 LLM 應用觀測工具，表裡放它只是舉例有這類工具，這篇沒有用。</p>



<p class="wp-block-paragraph">一句話記：<strong>MLOps 管模型會不會變笨，LLMOps 管回答品質和 token 帳單，AgentOps 管 agent 每一步做了什麼，AIOps 是請 AI 幫你看 log 找問題。</strong></p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">動手做：呼叫一次 Gemini，看 LLMOps 為什麼要盯 token</h2>



<p class="wp-block-paragraph">這段在 Google Cloud 上呼叫 Gemini 模型做一個很小的請求，然後：</p>


<ol class="wp-block-list">
<li>先用免費的 countTokens 數一數，同一句話中文、英文各是幾個 token</li>

<li>照官方快速入門的範例模型呼叫一次，看看會發生什麼事</li>

<li>用新模型呼叫兩次，一次預設思考等級、一次調低，比較 token 和費用</li>

<li>到 Cloud Monitoring 找到同一批呼叫的 token 數，確認兩邊對得起來</li>
</ol>



<p class="wp-block-paragraph"><strong>看不懂指令沒關係</strong>：這段的重點在每段指令下面的輸出和截圖，只看那些也學得到 LLMOps 要盯什麼。想跟著做的話，下面每段都整段照貼。</p>



<p class="wp-block-paragraph"><strong>Agent Platform</strong> 是 Google Cloud 的 AI 平台，2026 年 4 月以前叫 Vertex AI，正式名稱是 Gemini Enterprise Agent Platform，裡面可以直接呼叫 Gemini 模型（站上〈<a href="https://dongdonggcp.com/2026/11/17/gemini-enterprise-agent-platform-agent-studio/">Gemini Enterprise 是什麼？</a>〉有講 Google AI 產品怎麼分）。Console 首頁現在會寫「Vertex AI 已更名為 Agent Platform」：</p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1600" height="202" src="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-10-console-agent-platform.png" alt="Google Cloud Console 的 Agent Platform 總覽頁：標題「歡迎使用 Agent Platform」，下面寫 Vertex AI 已更名為 Agent Platform，左側選單上方顯示 Gemini Platform（2026 年 11 月畫面）" class="wp-image-13868" srcset="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-10-console-agent-platform.png 1600w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-10-console-agent-platform-300x38.png 300w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-10-console-agent-platform-1024x129.png 1024w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-10-console-agent-platform-768x97.png 768w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-10-console-agent-platform-1536x194.png 1536w" sizes="(max-width: 1600px) 100vw, 1600px" /></figure>


<ul class="wp-block-list">
<li><strong>在哪裡做</strong>：Cloud Shell（Google 提供、開瀏覽器就能打指令的 Linux 終端機），專案 dong-dong-gcp-3，模型用 Google 的全球端點（<code>global</code>）</li>

<li><strong>花多久</strong>：從開始到刪除約 15 分鐘，其中等 Cloud Monitoring 出現資料約 5 分鐘</li>

<li><strong>事前準備</strong>：要有一個已經連結帳單帳戶的 GCP 專案。<strong>還沒有的話，先照〈<a href="https://dongdonggcp.com/2024/02/01/how-to-apply-gcp-free-usage-credit-300-dollars/">如何快速申請 GCP 免費試用額度 300 美元</a>〉申請</strong>。下面指令裡的 <code>dong-dong-gcp-3</code> 都要換成你的專案 ID（Console 左上角的專案選單看得到）</li>

<li><strong>權限</strong>：用自己的專案通常是擁有者，沒問題。如果是公司或課程給的專案，你的帳號至少要有 Vertex AI User（<code>roles/aiplatform.user</code>，角色名稱還沒跟著改名）才能呼叫模型、Monitoring Viewer（<code>roles/monitoring.viewer</code>）才能查步驟 8 的監控數字，不然會看到 403 或 PERMISSION_DENIED。不確定自己有沒有，請專案管理員幫你確認</li>

<li><strong>會不會花錢</strong>：會，但很少。這篇一共呼叫模型 5 次：2 次 countTokens（官方寫明不收費）、1 次呼叫已退休的模型（失敗）、2 次正式產生回答。兩次正式回答照官方價格算出來分別是 0.0031 和 0.0002 美元（算法在步驟 7）。考綱段落會提到的 <strong>Provisioned Throughput</strong>（預先包下模型的處理能力，像餐廳先付錢包場，保證尖峰時段也有位子，一週上千美元）要另外下訂單才會收，<strong>照這篇做不會被收這筆錢</strong></li>
</ul>



<p class="wp-block-paragraph"><strong>怎麼開 Cloud Shell</strong>：登入 <a href="https://console.cloud.google.com/">Google Cloud Console</a>，左上角藍框是專案選單（顯示目前的專案 ID），右上角紅框那個 <code>&gt;_</code> 圖示就是 Cloud Shell：</p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1600" height="59" src="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-00a-console-cloudshell-button.png" alt="Google Cloud Console 上方工具列：左上藍框是專案選單，顯示專案 ID dong-dong-gcp-3；右上紅框是開啟 Cloud Shell 的按鈕" class="wp-image-13869" srcset="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-00a-console-cloudshell-button.png 1600w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-00a-console-cloudshell-button-300x11.png 300w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-00a-console-cloudshell-button-1024x38.png 1024w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-00a-console-cloudshell-button-768x28.png 768w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-00a-console-cloudshell-button-1536x57.png 1536w" sizes="(max-width: 1600px) 100vw, 1600px" /></figure>



<p class="wp-block-paragraph">點下去，畫面下方會開出黑底的終端機，看到結尾是 <code>$</code> 的提示字元就能打指令（這張是之前拍的畫面）：</p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1600" height="500" src="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-00b-cloudshell-open.png" alt="Cloud Shell 開起來的樣子：黑底終端機，最後一行是 $ 提示字元，可以開始輸入指令" class="wp-image-13870" srcset="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-00b-cloudshell-open.png 1600w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-00b-cloudshell-open-300x94.png 300w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-00b-cloudshell-open-1024x320.png 1024w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-00b-cloudshell-open-768x240.png 768w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-00b-cloudshell-open-1536x480.png 1536w" sizes="(max-width: 1600px) 100vw, 1600px" /></figure>



<p class="wp-block-paragraph">第一次開可能會跳「授權 Cloud Shell」的視窗，按「授權」後 Cloud Shell 才能用你的身分呼叫 Google Cloud。更詳細的開法在<a href="https://dongdonggcp.com/2026/10/27/docker-tutorial-cloud-shell-first-container/">容器系列第 1 篇</a>。</p>



<p class="wp-block-paragraph">下面每段指令都是<strong>整段複製、貼進 Cloud Shell、按 Enter</strong>，等提示字元（結尾的 <code>$</code>）再出現就是跑完了。截圖裡的提示字元有縮短，你的畫面會是「你的帳號@cloudshell:~ (專案ID)$」。這篇在 Cloud Shell 建的資料夾叫 <code>do-08</code>，刪的時候不會刪錯。</p>



<p class="wp-block-paragraph"><strong>輸出跟文中差很多怎麼辦</strong>：例如出現 error、說找不到檔案，或什麼都沒印。最常見的三個原因是：Cloud Shell 視窗重開過（變數不見了）、少貼了一行、專案 ID 沒換成你的。最省事的解法是從步驟 0 開始重貼一次，前面的步驟重跑不會壞事。</p>



<h3 class="wp-block-heading">步驟 0：設定專案，確認 Agent Platform 的 API 開著</h3>



<p class="wp-block-paragraph"><strong><code>export</code> 是讓這個終端機視窗記住一個設定</strong>，視窗關掉就忘了。<code>TZ=Asia/Taipei</code> 把時區設成台灣；<code>CLOUDSDK_CORE_PROJECT</code> 告訴 gcloud（操作 Google Cloud 的指令工具）要用哪個專案：</p>



<pre class="wp-block-code"><code>export TZ=Asia/Taipei CLOUDSDK_CORE_PROJECT=dong-dong-gcp-3</code></pre>



<p class="wp-block-paragraph"><strong>API</strong> 是服務對外開的操作窗口，Google Cloud 的服務要先「啟用」才能用，啟用本身不收費。Agent Platform 的 API 名稱還是舊的 <code>aiplatform.googleapis.com</code>：</p>



<pre class="wp-block-code"><code>gcloud config get-value project; date
gcloud services enable aiplatform.googleapis.com &amp;&amp; echo API OK</code></pre>



<pre class="wp-block-code"><code>Your active configuration is: [cloudshell-925]
dong-dong-gcp-3
Sat Nov 28 09:09:13 AM CST 2026
API OK</code></pre>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1136" height="313" src="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-01-api.png" alt="LLMOps 實作步驟 0：在 Cloud Shell 確認專案是 dong-dong-gcp-3，啟用 aiplatform.googleapis.com，印出 API OK" class="wp-image-13871" srcset="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-01-api.png 1136w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-01-api-300x83.png 300w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-01-api-1024x282.png 1024w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-01-api-768x212.png 768w" sizes="(max-width: 1136px) 100vw, 1136px" /></figure>



<p class="wp-block-paragraph">看到 <code>API OK</code> 就可以往下；如果出現 <code>PERMISSION_DENIED</code>，代表帳號權限不夠，見上面「權限」那一點。這個專案之前就開過，所以沒有出現「Operation &#8230; finished」那行；第一次啟用會多一行進度訊息，等它跑完出現 <code>API OK</code> 就好。</p>



<h3 class="wp-block-heading">步驟 1：把要問的問題寫成檔案</h3>



<p class="wp-block-paragraph">呼叫模型要送一段 <strong>JSON</strong>（一種用大括號 <code>{}</code> 和冒號整理資料的文字格式，像填好的表單）。這段一次建四個檔案，內容都是同一個問題「用一句話向完全不懂 IT 的人解釋什麼是 LLMOps」，差別是：</p>


<ul class="wp-block-list">
<li><code>zh.json</code>、<code>en.json</code>：只有問題，中文一份、英文一份，等一下拿來數 token</li>

<li><code>medium.json</code>：問題＋一個標籤 <code>labels</code>，用模型預設的思考等級</li>

<li><code>low.json</code>：同一個問題＋同一個標籤，多了一行把<strong>思考等級</strong>（thinkingLevel）調成 <code>LOW</code></li>
</ul>



<p class="wp-block-paragraph"><code>labels</code> 是幫這次呼叫貼的名牌，寫在請求內容裡的標籤會一路帶到 <strong>Cloud Billing</strong>（帳單），之後可以照標籤拆帳，例如「這個月客服機器人花了多少」。這是 LLMOps 很實用的習慣，但有兩個限制：<strong>標籤要寫在請求內容裡（像本篇的 JSON），而且只有隨用隨付的請求才會帶到帳單</strong>（放在 HTTP header 的標籤不會進帳單），走 Provisioned Throughput 的請求會直接忽略標籤、也不報錯；帳單上通常要等約一天才看得到，有時超過 24 小時（2026 年 11 月查<a href="https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/capabilities/add-labels-to-api-calls">自訂標籤文件</a>）。</p>



<p class="wp-block-paragraph"><code>P</code>、<code>M</code>、<code>URL</code> 是暫存在這個視窗的變數，後面每一步都會用到。<strong>如果中途關過 Cloud Shell，要重新貼步驟 0 和這段最上面三行（<code>mkdir</code> 到 <code>URL=</code>）</strong>，不然後面的指令會找不到網址。<code>M</code> 是模型名稱 <code>gemini-3.8-flash</code>（2026 年 9 月正式推出的 Gemini 3.8 Flash），<code>URL</code> 是這個模型在 Google Cloud 上的網址。整段照貼，只有 <code>P=</code> 後面換成你的專案 ID：</p>



<pre class="wp-block-code"><code>mkdir -p ~/do-08 &amp;&amp; cd ~/do-08
P=dong-dong-gcp-3; M=gemini-3.8-flash
URL=https://aiplatform.googleapis.com/v1/projects/$P/locations/global/publishers/google/models/$M
cat &gt; zh.json &lt;&lt;'EOF'
{"contents":[{"role":"user","parts":[{"text":"用一句話向完全不懂 IT 的人解釋什麼是 LLMOps。"}]}]}
EOF
cat &gt; en.json &lt;&lt;'EOF'
{"contents":[{"role":"user","parts":[{"text":"Explain what LLMOps is in one sentence to someone with no IT background."}]}]}
EOF
cat &gt; medium.json &lt;&lt;'EOF'
{"contents":[{"role":"user","parts":[{"text":"用一句話向完全不懂 IT 的人解釋什麼是 LLMOps。"}]}],
 "labels":{"app":"do-08-demo"}}
EOF
cat &gt; low.json &lt;&lt;'EOF'
{"contents":[{"role":"user","parts":[{"text":"用一句話向完全不懂 IT 的人解釋什麼是 LLMOps。"}]}],
 "generationConfig":{"thinkingConfig":{"thinkingLevel":"LOW"}},
 "labels":{"app":"do-08-demo"}}
EOF
ls; echo $URL</code></pre>



<pre class="wp-block-code"><code>en.json  low.json  medium.json  zh.json
https://aiplatform.googleapis.com/v1/projects/dong-dong-gcp-3/locations/global/publishers/google/models/gemini-3.8-flash</code></pre>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1600" height="605" src="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-02-files.png" alt="LLMOps 實作步驟 1：在 Cloud Shell 建立 zh.json、en.json、medium.json、low.json 四個請求檔，印出 Gemini 3.8 Flash 的網址" class="wp-image-13872" srcset="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-02-files.png 1600w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-02-files-300x113.png 300w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-02-files-1024x387.png 1024w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-02-files-768x290.png 768w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-02-files-1536x581.png 1536w" sizes="(max-width: 1600px) 100vw, 1600px" /></figure>



<p class="wp-block-paragraph"><code>cat &gt; 檔名 &lt;&lt;'EOF'</code> 到下一個 <code>EOF</code> 中間的文字，會原封不動寫進檔案。最後一行看到四個檔名和網址，就表示建好了。</p>



<h3 class="wp-block-heading">步驟 2：為什麼這篇用 curl，不用 gcloud</h3>



<p class="wp-block-paragraph">這個系列原則上 gcloud 優先，但 <strong>gcloud 沒有呼叫 Gemini 產生內容的指令</strong>。列出 <code>gcloud beta ai</code> 底下的所有子群組就看得出來（<code>sed</code> 那段只是把說明文字裡的粗體控制碼拿掉，不然 <code>grep</code> 抓不到）：</p>



<pre class="wp-block-code"><code>gcloud beta ai --help | sed 's/\x1b\[[0-9;]*m//g' | grep -E '^     [a-z]'</code></pre>



<pre class="wp-block-code"><code>     custom-jobs
     endpoints
     hp-tuning-jobs
     index-endpoints
     indexes
     model-garden
     model-monitoring-jobs
     models
     operations
     persistent-resources
     semantic-governance-policies
     semantic-governance-policy-engine
     tensorboard-experiments
     tensorboard-runs
     tensorboard-time-series
     tensorboards
     tuning-jobs</code></pre>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1600" height="654" src="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-03-no-generate-command.png" alt="在 Cloud Shell 列出 gcloud beta ai 的子群組：custom-jobs、endpoints、model-garden、models 等，沒有呼叫 Gemini 產生內容的指令" class="wp-image-13873" srcset="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-03-no-generate-command.png 1600w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-03-no-generate-command-300x123.png 300w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-03-no-generate-command-1024x419.png 1024w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-03-no-generate-command-768x314.png 768w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-03-no-generate-command-1536x628.png 1536w" sizes="(max-width: 1600px) 100vw, 1600px" /></figure>



<p class="wp-block-paragraph">都是管訓練工作、端點、模型的指令，沒有「產生內容」（<code>gcloud ai</code> 正式版也一樣，2026 年 11 月在 Cloud Shell 的 gcloud 592 查）。所以下面用 <strong>curl</strong>（在終端機送出網頁請求的工具）照官方快速入門的寫法打 <strong>REST API</strong>（用網址加上 HTTP 請求來操作服務的方式，跟瀏覽器開網頁是同一套原理）。</p>



<p class="wp-block-paragraph">每段 curl 裡的 <code>$(gcloud auth print-access-token)</code> 會當場拿一張約一小時有效的<strong>存取權杖</strong>（證明「這是你本人」的臨時通行證）塞進請求，這段照貼就好。權杖等於你的身分，<strong>不要把它印出來貼給別人</strong>。</p>



<h3 class="wp-block-heading">步驟 3：先數一數 token（不收費）</h3>



<p class="wp-block-paragraph"><strong>countTokens</strong> 是只數 token、不產生回答的 API。官方文件寫明使用 CountTokens API 不收費，也不佔一般呼叫模型的配額，但它自己每分鐘最多 3,000 次（2026 年 11 月查<a href="https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/capabilities/get-token-count">計算 token 文件</a>）。<code>jq -c .</code> 把回應壓成一行比較好讀：</p>



<pre class="wp-block-code"><code>for f in zh.json en.json; do echo "== $f"; curl -s -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" "$URL:countTokens" -d @$f | jq -c .; done</code></pre>



<pre class="wp-block-code"><code>== zh.json
{"totalTokens":16,"totalBillableCharacters":25,"promptTokensDetails":[{"modality":"TEXT","tokenCount":16}]}
== en.json
{"totalTokens":16,"totalBillableCharacters":60,"promptTokensDetails":[{"modality":"TEXT","tokenCount":16}]}</code></pre>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1600" height="169" src="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-04-count-tokens.png" alt="用 countTokens 數 token：中文問題 16 個 token、25 個計費字元，英文問題也是 16 個 token、60 個計費字元" class="wp-image-13874" srcset="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-04-count-tokens.png 1600w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-04-count-tokens-300x32.png 300w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-04-count-tokens-1024x108.png 1024w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-04-count-tokens-768x81.png 768w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-04-count-tokens-1536x162.png 1536w" sizes="(max-width: 1600px) 100vw, 1600px" /></figure>



<p class="wp-block-paragraph"><strong>這代表什麼</strong>：</p>


<ul class="wp-block-list">
<li><strong>中文和英文都是 16 個 token</strong>。常聽到「中文比英文吃 token」，至少這一句在 Gemini 3.8 Flash 上一樣多。這只是一句話的結果，不代表所有句子都一樣，要知道自己的應用實際用多少，就是去數</li>

<li><code>totalBillableCharacters</code> 是計費字元數：中文 25、英文 60，剛好是兩句<strong>去掉空白後的字數</strong>。同樣意思的話，英文字母比較多，但切出來的 token 一樣</li>

<li>官方文件也提醒：countTokens 是<strong>估計</strong>，<strong>計費用的準確數字只在模型回應的 usage metadata 裡</strong>。所以正式環境要看的是下一步回應裡的數字</li>
</ul>



<h3 class="wp-block-heading">步驟 4：照官方快速入門的模型呼叫，結果 404</h3>



<p class="wp-block-paragraph">Agent Platform 官方快速入門的 REST 範例（頁面寫 2026 年 11 月 20 日更新），模型名稱寫的是 <code>gemini-2.5-flash</code>。照抄呼叫一次看看。<code>.error // {...}</code> 的意思是：有錯誤就印錯誤，沒錯就印用量：</p>



<pre class="wp-block-code"><code>curl -s -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" "https://aiplatform.googleapis.com/v1/projects/$P/locations/global/publishers/google/models/gemini-2.5-flash:generateContent" -d @zh.json | jq '.error // {modelVersion, usageMetadata}'</code></pre>



<pre class="wp-block-code"><code>{
  "code": 404,
  "message": "Publisher model `projects/dong-dong-gcp-3/locations/global/publishers/google/models/gemini-2.5-flash` was not found or your project does not have access to it. Ensure you are using a valid model name and that the model is available in the specified region. For more information, see: https://docs.cloud.google.com/gemini-enterprise-agent-platform/resources/locations.",
  "status": "NOT_FOUND"
}</code></pre>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1600" height="224" src="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-05-retired-model.png" alt="呼叫 gemini-2.5-flash 回 404 NOT_FOUND：Publisher model was not found，這個模型已經在 Agent Platform 退休" class="wp-image-13875" srcset="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-05-retired-model.png 1600w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-05-retired-model-300x42.png 300w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-05-retired-model-1024x143.png 1024w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-05-retired-model-768x108.png 768w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-05-retired-model-1536x215.png 1536w" sizes="(max-width: 1600px) 100vw, 1600px" /></figure>



<p class="wp-block-paragraph"><strong>404 NOT_FOUND，找不到模型</strong>。原因是 Gemini 2.5 Flash 在 Agent Platform 上已經在 <strong>2026 年 10 月 20 日退休</strong>（模型頁寫的退休日，2026 年 11 月查<a href="https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/gemini/2-5-flash">官方模型頁</a>），但快速入門的範例還沒換。</p>



<p class="wp-block-paragraph">這就是 LLMOps 的日常：<strong>雲端模型會退休</strong>，退休那天程式就壞了，錯誤訊息還寫得像是名稱打錯。官方的<a href="https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/migrate">換模型指南</a>也提醒，換新版本前要先拿自己的提示詞測過。所以模型的退休日要記在行事曆上，提早換。</p>



<h3 class="wp-block-heading">步驟 5：用 Gemini 3.8 Flash 產生回答（預設思考等級）</h3>



<p class="wp-block-paragraph">這次換成 <code>$URL</code> 裡的 Gemini 3.8 Flash，送 <code>medium.json</code>。<code>time</code> 會在最後印出這段花了多久；第一個 <code>jq</code> 印出模型的回答，第二個 <code>jq</code> 印出<strong>用量紀錄</strong>（<code>usageMetadata</code>）：</p>



<pre class="wp-block-code"><code>time curl -s -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" "$URL:generateContent" -d @medium.json &gt; r-medium.json
jq -r '[.candidates[0].content.parts[].text // empty] | join("")' r-medium.json
jq '{modelVersion, usageMetadata}' r-medium.json</code></pre>



<pre class="wp-block-code"><code>real    0m7.551s
user    0m0.728s
sys     0m0.095s
**LLMOps 就像是像 ChatGPT 這類「AI 超級大腦」的專屬後勤與保養團隊，負責照顧、訓練並監督它，確保它每天工作時都能穩定、聰明且不出錯。**
{
  "modelVersion": "gemini-3.8-flash",
  "usageMetadata": {
    "promptTokenCount": 16,
    "candidatesTokenCount": 51,
    "totalTokenCount": 833,
    "trafficType": "ON_DEMAND",
    "promptTokensDetails": [
      {
        "modality": "TEXT",
        "tokenCount": 16
      }
    ],
    "candidatesTokensDetails": [
      {
        "modality": "TEXT",
        "tokenCount": 51
      }
    ],
    "thoughtsTokenCount": 766
  }
}</code></pre>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1600" height="627" src="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-06-generate-medium.png" alt="Gemini 3.8 Flash 預設思考等級的回應：花 7.551 秒，usageMetadata 顯示輸入 16、回答 51、思考 766、總共 833 個 token，trafficType 是 ON_DEMAND" class="wp-image-13876" srcset="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-06-generate-medium.png 1600w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-06-generate-medium-300x118.png 300w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-06-generate-medium-1024x401.png 1024w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-06-generate-medium-768x301.png 768w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-06-generate-medium-1536x602.png 1536w" sizes="(max-width: 1600px) 100vw, 1600px" /></figure>



<p class="wp-block-paragraph">回答前後的 <code>**</code> 是 Markdown 的粗體符號，模型自己加的。重點在下面那段用量紀錄，每個欄位的意思（照<a href="https://docs.cloud.google.com/gemini-enterprise-agent-platform/reference/rest/v1/GenerateContentResponse">官方 UsageMetadata 文件</a>，2026 年 11 月查）：</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>欄位</th><th>這次的值</th><th>白話</th></tr></thead><tbody><tr><td><code>promptTokenCount</code></td><td>16</td><td>你送進去的問題，跟步驟 3 數的一樣</td></tr><tr><td><code>candidatesTokenCount</code></td><td>51</td><td>模型寫出來的回答</td></tr><tr><td><code>thoughtsTokenCount</code></td><td><strong>766</strong></td><td>模型回答前在腦中「打草稿」的思考，你看不到，但<strong>一樣算錢</strong></td></tr><tr><td><code>totalTokenCount</code></td><td>833</td><td>16＋51＋766＝833，三個加起來</td></tr><tr><td><code>trafficType</code></td><td><code>ON_DEMAND</code></td><td>這次走「隨用隨付」的額度。買了 Provisioned Throughput 的話會變成 <code>PROVISIONED_THROUGHPUT</code></td></tr></tbody></table></figure>



<p class="wp-block-paragraph"><strong>這代表什麼</strong>：一句 51 個 token 的回答，背後有 766 個 token 的思考，<strong>思考佔了總量的 92%</strong>（766÷833）。Gemini 3.8 Flash 的思考等級預設是 MEDIUM（官方<a href="https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/thinking">思考文件</a>：3.8 Flash 支援 LOW、MEDIUM、HIGH，預設 MEDIUM）。簡單的問題用不到這麼多思考。</p>



<h3 class="wp-block-heading">步驟 6：同一個問題，思考等級調成 LOW</h3>



<p class="wp-block-paragraph">送 <code>low.json</code>，唯一差別是多了 <code>"thinkingLevel":"LOW"</code>：</p>



<pre class="wp-block-code"><code>time curl -s -X POST -H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" "$URL:generateContent" -d @low.json &gt; r-low.json
jq -r '[.candidates[0].content.parts[].text // empty] | join("")' r-low.json
jq '{modelVersion, usageMetadata}' r-low.json</code></pre>



<pre class="wp-block-code"><code>real    0m3.066s
user    0m0.744s
sys     0m0.106s
LLMOps 就像是**「AI 超級大腦的專屬保姆與經紀團隊」**，負責把聰明的大語言模型照顧好、訓練好，並讓它能穩定、安全地上班幫人類解決問題。
{
  "modelVersion": "gemini-3.8-flash",
  "usageMetadata": {
    "promptTokenCount": 16,
    "candidatesTokenCount": 52,
    "totalTokenCount": 68,
    "trafficType": "ON_DEMAND",
    "promptTokensDetails": [
      {
        "modality": "TEXT",
        "tokenCount": 16
      }
    ],
    "candidatesTokensDetails": [
      {
        "modality": "TEXT",
        "tokenCount": 52
      }
    ]
  }
}</code></pre>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1600" height="608" src="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-07-generate-low.png" alt="思考等級調成 LOW 的回應：花 3.066 秒，輸入 16、回答 52、總共 68 個 token，沒有 thoughtsTokenCount" class="wp-image-13877" srcset="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-07-generate-low.png 1600w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-07-generate-low-300x114.png 300w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-07-generate-low-1024x389.png 1024w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-07-generate-low-768x292.png 768w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-07-generate-low-1536x584.png 1536w" sizes="(max-width: 1600px) 100vw, 1600px" /></figure>



<p class="wp-block-paragraph"><strong>這代表什麼</strong>：</p>


<ul class="wp-block-list">
<li><strong><code>thoughtsTokenCount</code> 整個不見了</strong>，總 token 從 833 降到 68</li>

<li>回答一樣是一句話、長度差不多（52 個 token），以這個簡單問題來說品質沒有明顯變差</li>

<li>時間從 7.551 秒變成 3.066 秒。這兩個數字包含 <code>gcloud</code> 拿權杖的時間，只能看大概，但思考少了、回得比較快是合理的</li>
</ul>



<p class="wp-block-paragraph">這裡要講清楚限制：<strong>LOW 不是永遠比較好</strong>。官方寫思考等級越高，在複雜任務上品質可能比較好；而且模型的行為不是每次都一樣，同一個設定，思考 token 每次也可能不同。<strong>簡單的分類、改寫、摘要用低等級，複雜的推理再調高</strong>，而且要用自己的題目測過。這篇只各跑一次，數字是這一次的結果，不是平均值。</p>



<h3 class="wp-block-heading">步驟 7：算一次給你看，差多少錢</h3>



<p class="wp-block-paragraph"><strong>比喻</strong>：計程車有兩種計費，一種是你坐的距離（輸入），一種是司機開的距離（輸出），而司機繞路找路（思考）也照表收費。</p>



<p class="wp-block-paragraph"><strong>單價</strong>（Gemini 3.8 Flash、全球端點、一般方案，2026 年 11 月查 <a href="https://cloud.google.com/vertex-ai/generative-ai/pricing">Agent Platform 價格頁</a>）：<strong>到 2026 年 12 月 31 日是優惠價</strong>，輸入每百萬 token 0.75 美元，輸出每百萬 token 3.75 美元，<strong>輸出包含回答和思考</strong>；2027 年 1 月 1 日起變成 1.50 和 7.50 美元。</p>



<p class="wp-block-paragraph"><strong>公式</strong>：一次的費用 ＝（輸入 token × 0.75 ＋（回答 token ＋ 思考 token）× 3.75）÷ 1,000,000</p>



<p class="wp-block-paragraph">用 <code>jq</code> 把兩次的用量帶進公式：</p>



<pre class="wp-block-code"><code>for f in r-medium.json r-low.json; do jq -r --arg f $f '.usageMetadata | "\($f)  input=\(.promptTokenCount)  output=\(.candidatesTokenCount)  thoughts=\(.thoughtsTokenCount // 0)  total=\(.totalTokenCount)  USD=\(((.promptTokenCount*0.75) + ((.candidatesTokenCount + (.thoughtsTokenCount // 0))*3.75))/1000000)"' $f; done</code></pre>



<pre class="wp-block-code"><code>r-medium.json  input=16  output=51  thoughts=766  total=833  USD=0.00307575
r-low.json  input=16  output=52  thoughts=0  total=68  USD=0.000207</code></pre>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1600" height="150" src="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-08-cost.png" alt="用 jq 算兩次呼叫的費用：預設思考等級 833 個 token、0.00307575 美元；LOW 68 個 token、0.000207 美元" class="wp-image-13878" srcset="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-08-cost.png 1600w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-08-cost-300x28.png 300w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-08-cost-1024x96.png 1024w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-08-cost-768x72.png 768w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-08-cost-1536x144.png 1536w" sizes="(max-width: 1600px) 100vw, 1600px" /></figure>



<p class="wp-block-paragraph"><strong>帶數字算一次</strong>：</p>


<ul class="wp-block-list">
<li>預設（MEDIUM）：(16 × 0.75 ＋ (51 ＋ 766) × 3.75) ÷ 1,000,000 ＝ (12 ＋ 3,063.75) ÷ 1,000,000 ＝ <strong>0.00307575 美元</strong></li>

<li>LOW：(16 × 0.75 ＋ 52 × 3.75) ÷ 1,000,000 ＝ (12 ＋ 195) ÷ 1,000,000 ＝ <strong>0.000207 美元</strong></li>

<li>差距：0.00307575 ÷ 0.000207 ≈ <strong>14.9 倍</strong>。預設那次的 3,075.75 裡有 2,872.5（766 × 3.75）是思考，<strong>93% 的錢花在思考</strong></li>
</ul>



<p class="wp-block-paragraph">一次幾分之一美分看起來沒差。<strong>假設</strong>一個客服機器人每天回答 1 萬次、一個月 30 天，也就是 30 萬次，而且每次都跟這次差不多：</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th></th><th>每次</th><th>一個月 30 萬次（優惠價）</th><th>2027 年起（單價變兩倍）</th></tr></thead><tbody><tr><td>預設 MEDIUM</td><td>0.00307575 美元</td><td>300,000 × 0.00307575 ＝ <strong>922.7 美元</strong></td><td>約 1,845 美元</td></tr><tr><td>LOW</td><td>0.000207 美元</td><td>300,000 × 0.000207 ＝ <strong>62.1 美元</strong></td><td>約 124 美元</td></tr></tbody></table></figure>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1200" height="675" src="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-cards-03-token-result.png" alt="同一個問題，思考等級一調，錢差 15 倍：Gemini 3.8 Flash 預設 MEDIUM 用了 833 個 token（輸入 16、回答 51、思考 766），0.00307575 美元、7.6 秒；思考等級 LOW 只用 68 個 token，0.000207 美元、3.1 秒" class="wp-image-13879" srcset="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-cards-03-token-result.png 1200w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-cards-03-token-result-300x169.png 300w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-cards-03-token-result-1024x576.png 1024w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-cards-03-token-result-768x432.png 768w" sizes="(max-width: 1200px) 100vw, 1200px" /></figure>



<p class="wp-block-paragraph"><strong>數字變大變小代表什麼</strong>：思考 token 越多，帳單越接近左上那格；回答寫得越長、問題送得越長，也會往上加。同一個應用，設定改一行，一個月可以差 800 多美元；模型單價一調整，同樣的用量帳單就翻倍。這就是 LLMOps 要<strong>每天看 token、照標籤拆帳、價格變動前先估算</strong>的原因。</p>



<h3 class="wp-block-heading">步驟 8：在 Cloud Monitoring 找到同一批呼叫</h3>



<p class="wp-block-paragraph">正式環境不會每次都去讀回應，要靠監控。Agent Platform 會把每次呼叫的次數、token 數、延遲送進 <strong>Cloud Monitoring</strong>（Google Cloud 的監控服務）。指標名稱在 2026 年 11 月是 <code>aiplatform.googleapis.com/publisher/online_serving/token_count</code>、<code>model_invocation_count</code> 這些（在 Cloud Shell 用 API 列出來的，階段標 BETA）。</p>



<p class="wp-block-paragraph"><strong>提醒</strong>：這段會用到步驟 1 的 <code>P</code>，中途關過 Cloud Shell 的話，先重貼 <code>P=dong-dong-gcp-3</code>（換成你的專案 ID）。</p>



<p class="wp-block-paragraph">gcloud 一樣<strong>沒有讀監控數字的指令</strong>（<code>gcloud monitoring</code> 只有警示、儀表板、政策、運作時間檢查這類設定指令），所以用 curl 打 Monitoring API。這段很長，<strong>要整段一次貼完，不要分開貼</strong>（中間的 <code>S</code>、<code>E</code> 是這段自己設定的時間範圍），它做的事是：抓最近 60 分鐘，把 token 數照「模型、輸入或輸出」加總，再把呼叫次數照「模型、方法、回應碼」加總。<strong>要等呼叫完約 3～5 分鐘再跑</strong>，資料才會進來：</p>



<pre class="wp-block-code"><code>S=$(date -u -d '-60 min' +%FT%TZ); E=$(date -u +%FT%TZ); echo "$S ~ $E"
echo '== token_count'; curl -s -G -H "Authorization: Bearer $(gcloud auth print-access-token)" "https://monitoring.googleapis.com/v3/projects/$P/timeSeries" --data-urlencode "filter=metric.type=\"aiplatform.googleapis.com/publisher/online_serving/token_count\"" --data-urlencode "interval.startTime=$S" --data-urlencode "interval.endTime=$E" --data-urlencode "aggregation.alignmentPeriod=3600s" --data-urlencode "aggregation.perSeriesAligner=ALIGN_SUM" --data-urlencode "aggregation.crossSeriesReducer=REDUCE_SUM" --data-urlencode "aggregation.groupByFields=resource.labels.model_user_id" --data-urlencode "aggregation.groupByFields=metric.labels.type" | jq -r '.timeSeries[]? | [.resource.labels.model_user_id, .metric.labels.type, .points[0].value.int64Value] | @tsv'
echo '== model_invocation_count'; curl -s -G -H "Authorization: Bearer $(gcloud auth print-access-token)" "https://monitoring.googleapis.com/v3/projects/$P/timeSeries" --data-urlencode "filter=metric.type=\"aiplatform.googleapis.com/publisher/online_serving/model_invocation_count\"" --data-urlencode "interval.startTime=$S" --data-urlencode "interval.endTime=$E" --data-urlencode "aggregation.alignmentPeriod=3600s" --data-urlencode "aggregation.perSeriesAligner=ALIGN_SUM" --data-urlencode "aggregation.crossSeriesReducer=REDUCE_SUM" --data-urlencode "aggregation.groupByFields=resource.labels.model_user_id" --data-urlencode "aggregation.groupByFields=metric.labels.method" --data-urlencode "aggregation.groupByFields=metric.labels.response_code" | jq -r '.timeSeries[]? | [.resource.labels.model_user_id, .metric.labels.method, .metric.labels.response_code, .points[0].value.int64Value] | @tsv'</code></pre>



<pre class="wp-block-code"><code>2026-11-28T00:17:02Z ~ 2026-11-28T01:17:02Z
== token_count
gemini-3.8-flash        input   32
gemini-3.8-flash        output  869
== model_invocation_count
gemini-3.8-flash        CountTokens     200     2
gemini-3.8-flash        GenerateContent 200     2</code></pre>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1600" height="407" src="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-09-monitoring-api.png" alt="用 Monitoring API 查 Gemini 3.8 Flash 的指標：token_count 輸入 32、輸出 869；model_invocation_count 有 CountTokens 2 次、GenerateContent 2 次，回應碼都是 200" class="wp-image-13880" srcset="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-09-monitoring-api.png 1600w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-09-monitoring-api-300x76.png 300w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-09-monitoring-api-1024x260.png 1024w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-09-monitoring-api-768x195.png 768w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-09-monitoring-api-1536x391.png 1536w" sizes="(max-width: 1600px) 100vw, 1600px" /></figure>



<p class="wp-block-paragraph"><strong>對一下帳</strong>：</p>


<ul class="wp-block-list">
<li><strong>輸入 32</strong> ＝ 兩次正式呼叫各 16（16 ＋ 16）</li>

<li><strong>輸出 869</strong> ＝ 51 ＋ 766 ＋ 52。<strong>思考的 766 被算在輸出裡</strong>，跟價格頁「輸出包含回答和思考」一致</li>

<li><strong>CountTokens 有 2 次呼叫，但沒有算進 token 數</strong>，跟官方說它不收費對得上</li>

<li><strong>步驟 4 那次 404 完全沒出現</strong>：找不到模型的呼叫，不會記在任何模型底下。只盯這張表，會漏掉「程式一直在呼叫已退休模型」這種錯，要另外從程式的 log，或 API 層級的請求數指標（可以照回應碼篩出 404）抓</li>
</ul>



<h3 class="wp-block-heading">步驟 9：在 Console 看同一批數字</h3>



<p class="wp-block-paragraph">先講結論：<strong>總覽頁那張小表可能很久都沒資料，要看數字直接點「顯示所有指標」</strong>。</p>



<p class="wp-block-paragraph">不想打 API 的話，Console 有現成的畫面。到 Agent Platform 總覽頁往下捲，有一區「<strong>模型觀測功能</strong>」，表格欄位是位置、模型、叫用次數、p99 叫用延遲時間、詞元數（token 數）。但這次呼叫完過了約 19 分鐘（上午 9:28），這張表還是寫「沒有資料」：</p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1600" height="540" src="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-11-console-model-observability.png" alt="Agent Platform 總覽頁的「模型觀測功能」表格：欄位有位置、模型、叫用次數、p99 叫用延遲時間、詞元數、字元數，呼叫後約 19 分鐘仍顯示沒有資料，下方有「顯示所有指標」連結" class="wp-image-13881" srcset="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-11-console-model-observability.png 1600w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-11-console-model-observability-300x101.png 300w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-11-console-model-observability-1024x346.png 1024w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-11-console-model-observability-768x259.png 768w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-11-console-model-observability-1536x518.png 1536w" sizes="(max-width: 1600px) 100vw, 1600px" /></figure>



<p class="wp-block-paragraph">點表格下面的「<strong>顯示所有指標</strong>」，會開 Cloud Monitoring 裡的現成儀表板，這邊呼叫完約 5 分鐘（上午 9:14）就有資料了：</p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1600" height="1436" src="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-12-monitoring-dashboard.png" alt="Cloud Monitoring 的 Vertex AI Model Garden（Monitoring）儀表板：Model Invocations 表格列出 gemini-3.8-flash、global、Tokens 0.501/s，下面兩張圖是每秒請求數和每秒 token 數，在上午 9:10 左右有一個高峰" class="wp-image-13882" srcset="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-12-monitoring-dashboard.png 1600w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-12-monitoring-dashboard-300x269.png 300w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-12-monitoring-dashboard-1024x919.png 1024w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-12-monitoring-dashboard-768x689.png 768w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-12-monitoring-dashboard-1536x1379.png 1536w" sizes="(max-width: 1600px) 100vw, 1600px" /></figure>


<ul class="wp-block-list">
<li>上面的表格顯示 gemini-3.8-flash 在過去 30 分鐘平均每秒 <strong>0.501 個 token</strong>。<strong>算一次</strong>：(32 ＋ 869) ÷ (30 × 60 秒) ＝ 901 ÷ 1,800 ≈ 0.5006，四捨五入就是 0.501，跟 API 查到的總數對得上</li>

<li>下面兩張圖在上午 9:10 左右各有一個尖峰，就是步驟 5、6 那兩次呼叫</li>

<li>儀表板的名字還是「<strong>Vertex AI</strong> Model Garden (Monitoring)」，改名還沒改到這裡</li>
</ul>



<p class="wp-block-paragraph">官方文件也提醒：這個儀表板只算<strong>用 API 呼叫</strong>的次數，在 Console 的 Agent Studio 裡直接試用模型不會算進去（<a href="https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/model-observability">模型觀測文件</a>）。</p>



<h3 class="wp-block-heading">實測時的意外</h3>


<ol class="wp-block-list">
<li><strong>官方快速入門的範例模型已經退休</strong>：REST 範例寫 <code>gemini-2.5-flash</code>，它在 2026 年 10 月 20 日退休，照抄回 404 NOT_FOUND。換成 Python 範例用的 <code>gemini-3.8-flash</code> 才成功</li>

<li><strong>中文、英文同一個意思都是 16 個 token</strong>：跟「中文比較吃 token」的印象不同，只是一句話的結果，不能推到所有內容</li>

<li><strong>預設思考等級佔了 92% 的 token、93% 的錢</strong>：一句話的回答，後面有 766 個 token 的思考</li>

<li><strong>總覽頁的「模型觀測功能」表格一直是「沒有資料」</strong>：呼叫完約 5 分鐘，Cloud Monitoring 的儀表板已經有資料，步驟 8 的 API 也查得到，但 Agent Platform 總覽頁那張小表格到呼叫後約 19 分鐘還是空的（官方文件沒寫原因；這是這次實測的狀況，你的畫面可能不一樣）。要看數字，直接點「顯示所有指標」</li>

<li><strong>名字還在換</strong>：Console 頁面寫 Agent Platform、左側選單寫 Gemini Platform、監控儀表板寫 Vertex AI、API 網址是 <code>aiplatform</code>、gcloud 說明寫「Manage Vertex AI &#8230;」。查資料時新舊名字都要認得</li>

<li><strong>gcloud 的說明文字有粗體控制碼</strong>：直接 <code>gcloud beta ai --help | grep</code> 什麼都抓不到，要先用 <code>sed</code> 把控制碼拿掉</li>
</ol>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">新版考綱把 agent 放進來了</h2>



<p class="wp-block-paragraph">Professional Cloud DevOps Engineer 新版考綱（2026 年 11 月 23 日起適用）第一段的定義就改了：DevOps 工程師用「Google 建議的方法、工具，<strong>和 agent</strong>」做事。舊版考綱裡沒有 agent、token、Provisioned Throughput 這些字（2026 年 11 月逐字搜尋兩份 PDF）。跟這篇有關的四件事，各講一兩句：</p>



<h3 class="wp-block-heading">Provisioned Throughput：買斷吞吐量，讓 agent 不被限流（1.2、5.2）</h3>



<p class="wp-block-paragraph"><strong>Provisioned Throughput</strong>（Console 翻成「佈建輸送量」）是固定費用、固定期限的訂閱，<strong>預先保留</strong>模型的處理量。官方說適合即時的正式環境應用（像聊天機器人和 agent）、要穩定體驗、要成本可預測的情況（2026 年 11 月查 <a href="https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/provisioned-throughput">Provisioned Throughput 概覽</a>）。考綱 1.2 寫「用 Provisioned Throughput 確保 agent 可靠」，5.2 寫「用 Provisioned Throughput 控制成本」。</p>



<p class="wp-block-paragraph">步驟 5 回應裡的 <code>trafficType: ON_DEMAND</code> 就是「沒有買、走隨用隨付」；有買的話會變成 <code>PROVISIONED_THROUGHPUT</code>。Console 的訂單頁在這裡，這篇<strong>只看不買</strong>，所以訂單是空的：</p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1600" height="883" src="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-14-console-provisioned-throughput.png" alt="Agent Platform 的佈建輸送量（Provisioned Throughput）訂單頁：說明是費率固定的訂閱服務，可以為生成式 AI 模型預留處理量，訂單列表沒有資料；左側選單有管道、實驗、特徵儲存庫、Model Registry、監控等 MLOps 工具" class="wp-image-13883" srcset="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-14-console-provisioned-throughput.png 1600w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-14-console-provisioned-throughput-300x166.png 300w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-14-console-provisioned-throughput-1024x565.png 1024w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-14-console-provisioned-throughput-768x424.png 768w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-14-console-provisioned-throughput-1536x848.png 1536w" sizes="(max-width: 1600px) 100vw, 1600px" /></figure>



<p class="wp-block-paragraph"><strong>算一次</strong>：價格頁的單位是 <strong>GSU</strong>（generative AI scale unit，生成式 AI 規模單位），全球端點、承諾 1 週是每個 GSU 每小時 7.14 美元。以 1 個 GSU、1 週來算：7.14 × 24 小時 × 7 天 ＝ <strong>1,199.52 美元</strong>，跟價格頁範例寫的「每週 1,200 美元」一致（2026 年 11 月查）。這篇兩次正式呼叫加起來約 0.0033 美元，差了幾十萬倍，所以<strong>流量小的時候用隨用隨付，流量大又穩定才考慮買斷</strong>。左側選單順便看得到 MLOps 那一套工具也在這裡：管道、實驗、特徵儲存庫、Model Registry、監控。</p>



<h3 class="wp-block-heading">Token 消耗：要能看、能省（5.2）</h3>



<p class="wp-block-paragraph">考綱 5.2 寫「優化 token 消耗」。這篇的步驟 5～8 就是在做這件事：從 <code>usageMetadata</code> 看每一次、從 Cloud Monitoring 看總量、用 <code>labels</code> 拆帳、用思考等級省錢。其他常見的省法：縮短提示詞、選比較小的模型（例如 Flash-Lite）、重複的長段落用快取（價格頁上 Gemini 3.8 Flash 快取的輸入 token 是一般輸入的十分之一：0.075 對 0.75 美元）。完整做法在第 24 篇：AI agent 上線後怎麼顧？監控、token 成本、Provisioned Throughput（撰寫中）。</p>



<h3 class="wp-block-heading">GKE Agent Sandbox：讓 agent 在隔離的環境裡跑程式（1.4）</h3>



<p class="wp-block-paragraph">考綱 1.4 寫「隔離 agent 的執行環境（例如 GKE Agent Sandbox）」。agent 有時會自己寫程式、自己執行，那段程式碼是 LLM 產生的、不能完全相信。GKE Agent Sandbox 讓每個 agent 有一個專屬的 <strong>Pod</strong>（Kubernetes 裡跑程式的最小單位），用 gVisor（Google 開源的沙箱）或 microVM（很輕的虛擬機）把程式跟主機核心隔開。它是 Kubernetes SIG Apps 底下的開源專案，要自己在叢集裝 controller、之後也要自己升級。官方也寫多數 agent 工作負載建議用 Agent Substrate on GKE，需要專屬 Pod、GPU 或 Autopilot 時才用 Agent Sandbox（2026 年 11 月查<a href="https://docs.cloud.google.com/kubernetes-engine/docs/concepts/machine-learning/agent-sandbox">官方概覽</a>）。這個系列不建 GKE（每小時有叢集費），所以只講觀念，下面是官方概覽頁的開頭：</p>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1600" height="1087" src="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-17-gke-agent-sandbox-doc.png" alt="Google Cloud 官方文件〈關於 GKE 的 Agent Sandbox〉繁中頁：Agent Sandbox 讓 AI 代理在專屬的 Kubernetes Pod 中執行，用 gVisor 或 microVM 把 LLM 產生的不受信任程式碼與節點核心隔離，是 Kubernetes SIG Apps 下的開源專案（2026 年 11 月畫面）" class="wp-image-13884" srcset="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-17-gke-agent-sandbox-doc.png 1600w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-17-gke-agent-sandbox-doc-300x204.png 300w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-17-gke-agent-sandbox-doc-1024x696.png 1024w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-17-gke-agent-sandbox-doc-768x522.png 768w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-17-gke-agent-sandbox-doc-1536x1044.png 1536w" sizes="(max-width: 1600px) 100vw, 1600px" /></figure>



<h3 class="wp-block-heading">從 Agent Platform、ADK 送 log 和指標（4.1）</h3>



<p class="wp-block-paragraph">考綱 4.1 點名要能從「GKE、Cloud Run、Gemini Enterprise Agent Platform、Agent Development Kit、Antigravity」送出指標和 log。步驟 8 看到的 token 指標，就是 Agent Platform 自動送的；ADK 寫的 agent 可以用 <code>adk web --otel_to_cloud</code>，把 log、指標、trace（一個請求經過哪些步驟、各花多久的紀錄）三種資料都用 <strong>OpenTelemetry</strong>（開源的觀測資料標準）協定送進 Google Cloud 的 Telemetry API，再分別到 Cloud Logging、Cloud Monitoring、Cloud Trace 看。跑之前帳號要有 Logs Writer、Monitoring Metric Writer、Cloud Telemetry Traces Writer、Vertex AI User 這幾個角色（2026 年 11 月查<a href="https://docs.cloud.google.com/stackdriver/docs/instrumentation/ai-agent-adk">官方文件</a>，ADK 1.17.0 起）。<strong>Antigravity</strong> 是 Google 的 AI 程式開發工具，跟 Gemini Cloud Assist、MCP 一起在第 12 篇：Gemini Cloud Assist、Antigravity、MCP：AI 怎麼幫 DevOps 做事（撰寫中）實際操作。</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">用完記得刪</h2>



<p class="wp-block-paragraph">這篇<strong>沒有在 Google Cloud 建任何資源</strong>：沒有服務、沒有存放區、沒有 VM，只呼叫了模型。要刪的只有 Cloud Shell 裡的資料夾。<code>rm -rf ~/do-08</code> 只會刪掉剛建的 <code>do-08</code> 資料夾和裡面六個檔案，不會動到別的：</p>



<pre class="wp-block-code"><code>cd ~ &amp;&amp; rm -rf ~/do-08 &amp;&amp; echo cleaned</code></pre>



<pre class="wp-block-code"><code>cleaned</code></pre>



<figure class="wp-block-image aligncenter size-full"><img loading="lazy" decoding="async" width="1170" height="177" src="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-20-cleanup.png" alt="刪除 Cloud Shell 的 do-08 資料夾，印出 cleaned" class="wp-image-13885" srcset="https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-20-cleanup.png 1170w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-20-cleanup-300x45.png 300w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-20-cleanup-1024x155.png 1024w, https://dongdonggcp.com/wp-content/uploads/2026/11/do08-shots-20-cleanup-768x116.png 768w" sizes="(max-width: 1170px) 100vw, 1170px" /></figure>



<p class="wp-block-paragraph"><strong>刪不掉、也不用刪的</strong>：</p>


<ul class="wp-block-list">
<li><strong>API 呼叫的費用</strong>：呼叫了就算，刪資料夾不會退錢。這篇兩次正式回答約 0.0033 美元，countTokens 不收費，404 那次沒有產生回答</li>

<li><strong>Agent Platform 的 API</strong>：啟用本身不收費，不用時也可以留著。想關的話到「API 和服務」停用</li>

<li><strong>監控資料</strong>：Cloud Monitoring 的指標會照保留期限自動過期</li>
</ul>



<p class="wp-block-paragraph"><strong>不刪會怎樣</strong>：Cloud Shell 的資料夾放在你的 5 GB 個人空間，不收費，只是佔位置。真正要小心的是<strong>正式環境的 AI 應用</strong>：它每天都在跳錶，記得照〈<a href="https://dongdonggcp.com/2026/05/19/gcp-bill-explosion-prevention-guide/">GCP 帳單爆炸防護指南</a>〉設預算警示，或參考〈<a href="https://dongdonggcp.com/2026/11/22/gcp-budget-auto-disable-billing-cloud-run-functions/">GCP 預算超過怎麼自動停用帳單？</a>〉。</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">證照會怎麼考</h2>



<p class="wp-block-paragraph">不打算考證照的話，這段可以直接跳到下一段「面試會怎麼問」。</p>



<p class="wp-block-paragraph">Professional Cloud DevOps Engineer 考試 2 小時、50～60 題選擇題、報名費 200 美元，考試語言英文和日文（2026 年 11 月查<a href="https://cloud.google.com/learn/certification/cloud-devops-engineer">官方考試頁</a>）。2026 年 11 月 23 日起適用<a href="https://services.google.com/fh/files/misc/112326_professional_cloud_devops_engineer_exam_guide_english.pdf">新版考綱</a>。</p>



<p class="wp-block-paragraph">MLOps、LLMOps、AgentOps、AIOps 這四個字<strong>考綱裡一個都沒出現</strong>，但內容散在好幾個小節：</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>考綱小節（新版）</th><th>原文重點</th><th>對應哪個名詞</th><th>這篇對應的地方</th></tr></thead><tbody><tr><td><strong>第 2 區塊標題、2.2</strong></td><td>CI/CD 涵蓋「application, infrastructure, and <strong>ML workloads</strong>」；用 ML 管線的遙測資料定義部署成功指標</td><td>MLOps</td><td>MLOps 那段、ML 系列</td></tr><tr><td><strong>1.2</strong></td><td>Implementing <strong>Provisioned Throughput</strong> for agent reliability</td><td>LLMOps／AgentOps</td><td>Provisioned Throughput 那段</td></tr><tr><td><strong>1.4</strong></td><td>Isolating agent execution environments（<strong>GKE Agent Sandbox</strong>）</td><td>AgentOps</td><td>GKE Agent Sandbox 那段</td></tr><tr><td><strong>1.5</strong></td><td>用 AI 協助開發和維運（Antigravity、<strong>Gemini Cloud Assist</strong>）；設定和使用 MCP 伺服器</td><td>AIOps</td><td>AIOps 那段、第 12 篇</td></tr><tr><td><strong>4.1</strong></td><td>從 services and <strong>agents</strong> 送出指標和 log（Agent Platform、ADK、Antigravity）</td><td>AgentOps</td><td>步驟 8、ADK 那段</td></tr><tr><td><strong>4.2、4.3</strong></td><td>Logs Explorer、trace 的 <strong>AI-assisted analysis</strong>；AI 輔助解讀指標</td><td>AIOps</td><td>AIOps 那段</td></tr><tr><td><strong>5.1</strong></td><td>Application and <strong>agent performance monitoring</strong></td><td>AgentOps</td><td>步驟 9 儀表板</td></tr><tr><td><strong>5.2</strong></td><td>用 Provisioned Throughput 控制成本；<strong>Optimizing token consumption</strong></td><td>LLMOps</td><td>步驟 5～7</td></tr></tbody></table></figure>



<p class="wp-block-paragraph"><strong>新舊差異</strong>：舊版考綱的 AI 相關內容只有 Gemini Code Assist、Gemini Cloud Assist、Gemini CLI 和「用 Gemini Cloud Assist 分析 log、解讀指標、分析 trace」，也就是只有 AIOps 這一邊；新版多了 agent、token、Provisioned Throughput、GKE Agent Sandbox，<strong>「顧 AI」這一邊是新加的</strong>。</p>



<p class="wp-block-paragraph"><strong>看到這些字，就想到這個</strong>（情境題的判斷關鍵字）：</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>題目關鍵字</th><th>想到</th></tr></thead><tbody><tr><td>「agent 上線後流量大又穩定，不想被限流，成本要可預測」</td><td>Provisioned Throughput</td></tr><tr><td>「Gemini 的費用太高，要降低 token 用量」</td><td>降低思考等級、縮短提示詞、快取、換比較小的模型</td></tr><tr><td>「要知道每個團隊、每個應用各花了多少 Gemini 費用」</td><td>請求加 <code>labels</code>，帳單照標籤拆（限隨用隨付，Provisioned Throughput 的請求會忽略標籤）</td></tr><tr><td>「agent 會執行 LLM 產生的程式碼，要跟其他工作隔離」</td><td>GKE Agent Sandbox（gVisor 或 microVM）</td></tr><tr><td>「要看 agent 每一步呼叫了哪些工具、哪一步最慢」</td><td>ADK 的 OpenTelemetry → Cloud Trace</td></tr><tr><td>「要監控 Gemini 模型的呼叫次數、token、延遲」</td><td>Cloud Monitoring 的 Agent Platform 指標、模型觀測儀表板</td></tr><tr><td>「用自然語言分析 log、找根本原因」</td><td>Gemini Cloud Assist、Logs Explorer 的 AI 輔助分析</td></tr><tr><td>「模型上線後準確率因為資料改變而下降」</td><td>模型監控（漂移）＋自動重新訓練的管線（ML 系列）</td></tr></tbody></table></figure>



<p class="wp-block-paragraph">考試範圍完整的準備地圖在第 1 篇：<a href="https://dongdonggcp.com/2026/11/28/gcp-devops-certification-guide/">GCP DevOps 證照怎麼考？2026 新版考綱、比重與準備地圖</a>。</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">面試會怎麼問</h2>


<ul class="wp-block-list">
<li><strong>「MLOps 和 LLMOps 差在哪？」</strong>：LLMOps 是 MLOps 的一支（Google 官方說法）。MLOps 管預測模型會不會隨資料變笨；LLMOps 多了提示詞版本、回答品質評估、token 成本、模型退休要換版。最好帶一個數字，例如「同一個問題，思考等級從預設改成 LOW，token 從 833 降到 68」</li>

<li><strong>「AIOps 是什麼？跟 MLOps 一樣嗎？」</strong>：不一樣，方向相反。MLOps 是用維運的方法管 AI，AIOps 是用 AI 幫忙做維運，例如合併警報、找根因。可以補一句：有些廠商的文章把 AIOps 用成「維運 AI」，要看上下文</li>

<li><strong>「怎麼監控一個 LLM 應用？」</strong>：看回應的 usage metadata（輸入、輸出、思考 token），用 Cloud Monitoring 的 token 和延遲指標設儀表板和警示，用標籤拆帳，另外要有回答品質的評估</li>

<li><strong>「agent 和一般 LLM 應用，維運上差在哪？」</strong>：agent 會自己呼叫工具、改資料，要追蹤每一步（trace）、限制權限、隔離執行環境，成本要看「一個任務」而不是「一次呼叫」</li>

<li><strong>「雲端模型退休了怎麼辦？」</strong>：退休日要事先追蹤，換新版前拿自己的提示詞和測試題重新評估，錯誤率和 404 要有警示。這篇照官方範例呼叫已退休的模型，直接回 404</li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">常見問答</h2>



<h3 class="wp-block-heading">LLMOps 是什麼？用一句話說</h3>



<p class="wp-block-paragraph">LLMOps（大型語言模型維運）是管理和操作大型語言模型的做法和程序，Google 官方把它定位成 MLOps 的一支。實務上多管了提示詞、回答品質評估、token 成本和模型版本更換。這篇實測同一個問題，設定不同，token 從 833 個變 68 個、費用差約 15 倍，這就是 LLMOps 要盯的東西。</p>



<h3 class="wp-block-heading">LLMOps 和 MLOps 差在哪？</h3>



<p class="wp-block-paragraph">MLOps 管一般機器學習模型的整個生命週期，重點是資料漂移和重新訓練；LLMOps 是 MLOps 裡專門管大型語言模型的一支。多數公司不自己訓練 LLM，而是呼叫現成模型，所以 LLMOps 更常處理提示詞、評估、按 token 計費和模型退休。</p>



<h3 class="wp-block-heading">AIOps 是什麼？跟 MLOps、LLMOps 有什麼不同？</h3>



<p class="wp-block-paragraph">AIOps（IT 維運人工智慧）是用機器學習、自然語言處理這類 AI 技術幫忙做 IT 維運，例如合併警報、找根本原因、自動處理。MLOps、LLMOps 是「顧 AI」，AIOps 是「用 AI 顧系統」，方向相反。Google Cloud 上的例子是 Gemini Cloud Assist（2026 年 11 月仍是預覽版）。</p>



<h3 class="wp-block-heading">AgentOps 是什麼？</h3>



<p class="wp-block-paragraph">AgentOps 是管理 AI agent 整個生命週期的做法。agent 會自己決定步驟、呼叫工具，所以要追蹤每一步做了什麼、花了多少、權限夠不夠小、執行環境有沒有隔離。這個詞還沒有統一定義，Google 的《Agents Companion》白皮書把它放在 GenAIOps 底下；它也是一個工具的名字，看上下文判斷。</p>



<h3 class="wp-block-heading">GenAIOps、GenOps 和 LLMOps 是一樣的嗎？</h3>



<p class="wp-block-paragraph">大致是在講同一類事：生成式 AI 應用的維運。Google 的《Agents Companion》白皮書把 MLOps for GenAI、LLMOps、FMOps、GenAIOps 列成同義的說法，Google Cloud 部落格也用過 GenOps。不用糾結名字，重點是要管提示詞、評估、token 和安全。</p>



<h3 class="wp-block-heading">中文比英文吃 token 嗎？</h3>



<p class="wp-block-paragraph">不一定。這篇用 Gemini 3.8 Flash 的 countTokens 實測，「用一句話向完全不懂 IT 的人解釋什麼是 LLMOps」和意思相同的英文句子都是 16 個 token。不同模型、不同句子結果會不同，要知道自己的應用用多少，直接用 countTokens（不收費）或看回應的 usageMetadata。</p>



<h3 class="wp-block-heading">呼叫 Gemini 練習要花多少錢？</h3>



<p class="wp-block-paragraph">很少。這篇兩次正式呼叫照 Gemini 3.8 Flash 2026 年的優惠價（輸入 0.75、輸出 3.75 美元／百萬 token）算，分別是 0.0031 和 0.0002 美元；countTokens 不收費。要注意的是思考 token 也算在輸出裡，2027 年 1 月 1 日起單價會變兩倍。</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">重點整理</h2>


<ul class="wp-block-list">
<li><strong>兩個方向</strong>：MLOps、LLMOps、AgentOps 是「顧 AI」，管的對象依序是預測模型、大型語言模型、會自己動手的 agent；AIOps 是「用 AI 顧系統」，Google 的例子是 Gemini Cloud Assist</li>

<li><strong>說法不一</strong>：LLMOps 是 MLOps 的一支（Google）、AgentOps 是 GenAIOps 的一支（Google 白皮書）；有廠商把 AIOps 用成「維運 AI」，看「被照顧的是誰」來判斷</li>

<li><strong>這次實測</strong>：同一個問題，Gemini 3.8 Flash 預設思考等級用了 833 個 token（思考 766 個）、0.00307575 美元；調成 LOW 只用 68 個 token、0.000207 美元，差約 15 倍。Cloud Monitoring 的 token 數（輸入 32、輸出 869）跟兩次回應加起來一致</li>

<li><strong>模型會退休</strong>：官方快速入門範例的 gemini-2.5-flash 已在 2026 年 10 月 20 日退休，照抄回 404，而且這種錯誤不會出現在 token 指標裡</li>

<li><strong>證照</strong>：新版考綱沒出現這四個名詞，但點名了 Provisioned Throughput（1.2、5.2）、GKE Agent Sandbox（1.4）、從 agent 送 log 和指標（4.1）、優化 token 消耗（5.2）</li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<h2 class="wp-block-heading">延伸閱讀</h2>



<p class="wp-block-paragraph"><strong>本系列</strong></p>


<ul class="wp-block-list">
<li>第 1 篇：<a href="https://dongdonggcp.com/2026/11/28/gcp-devops-certification-guide/">GCP DevOps 證照怎麼考？2026 新版考綱、比重與準備地圖</a></li>

<li>第 2 篇：<a href="https://dongdonggcp.com/2026/11/28/what-is-devops-dora-metrics/">DevOps 是什麼？白話解釋＋DORA 5 個指標實測</a></li>

<li>第 5 篇：<a href="https://dongdonggcp.com/2026/11/28/what-is-sre-site-reliability-engineering-vs-devops/">SRE 是什麼？跟 DevOps 差在哪</a></li>

<li>第 7 篇：<a href="https://dongdonggcp.com/2026/11/28/what-is-devsecops-vs-secops-google-secops/">DevSecOps 是什麼？跟 SecOps、Google SecOps 差在哪</a></li>

<li>第 9 篇：<a href="https://dongdonggcp.com/2026/11/28/platform-engineering-ops-glossary-devops-sre-finops/">Ops 名詞總表：DevOps、SRE、Platform Engineering、FinOps 差在哪</a></li>

<li>第 12 篇：Gemini Cloud Assist、Antigravity、MCP：AI 怎麼幫 DevOps 做事（撰寫中）</li>

<li>第 22 篇：Cloud Monitoring 教學：指標、儀表板、警示、合成監控（撰寫中）</li>

<li>第 23 篇：OpenTelemetry＋Cloud Trace：一個請求慢在哪？（撰寫中）</li>

<li>第 24 篇：AI agent 上線後怎麼顧？監控、token 成本、Provisioned Throughput（撰寫中）</li>

<li>第 25 篇：FinOps 是什麼？GCP 省錢實務：Recommender、承諾使用折扣、Spot VM、log 成本（撰寫中）</li>
</ul>



<p class="wp-block-paragraph"><strong>ML 系列（MLOps 的細節）</strong></p>


<ul class="wp-block-list">
<li><a href="https://dongdonggcp.com/2026/10/25/what-is-mlops-vertex-ai-pipelines-kubeflow-tfx/">MLOps 是什麼？Vertex AI Pipelines、Kubeflow、TFX 介紹</a></li>

<li><a href="https://dongdonggcp.com/2026/10/25/model-monitoring-drift-training-serving-skew/">模型上線後會變笨？Drift 與 Training-Serving Skew 監控</a></li>

<li><a href="https://dongdonggcp.com/2026/10/25/ml-ci-cd-continuous-training-auto-retrain/">機器學習的 CI/CD：程式改了、資料來了，模型自動重訓</a></li>

<li><a href="https://dongdonggcp.com/2026/10/25/gcp-professional-machine-learning-engineer-certification-guide/">GCP ML 證照怎麼考？PMLE 考試範圍、準備地圖與 23 篇重點整理</a></li>
</ul>



<p class="wp-block-paragraph"><strong>站上相關文章</strong></p>


<ul class="wp-block-list">
<li><a href="https://dongdonggcp.com/2026/11/17/gemini-enterprise-agent-platform-agent-studio/">Gemini Enterprise 是什麼？Google 的 AI 產品三層怎麼分，Agent Studio 又是什麼</a></li>

<li><a href="https://dongdonggcp.com/2026/11/24/model-armor-ai-agent-data-leak/">Model Armor 是什麼？企業 AI agent 防資料外洩實測</a></li>

<li><a href="https://dongdonggcp.com/2026/05/19/gcp-bill-explosion-prevention-guide/">GCP 帳單爆炸防護指南：5 個步驟讓你不再睡醒崩潰</a></li>

<li><a href="https://dongdonggcp.com/2026/11/22/gcp-budget-auto-disable-billing-cloud-run-functions/">GCP 預算超過怎麼自動停用帳單？Cloud Run functions 教學</a></li>
</ul>



<p class="wp-block-paragraph"><strong>官方資料</strong></p>


<ul class="wp-block-list">
<li><a href="https://cloud.google.com/discover/what-is-llmops?hl=zh-TW">Google Cloud〈什麼是 LLMOps？〉</a></li>

<li><a href="https://cloud.google.com/discover/what-is-aiops?hl=zh-TW">Google Cloud〈什麼是 AIOps？〉</a></li>

<li><a href="https://cloud.google.com/discover/what-is-mlops">Google Cloud〈What is MLOps?〉</a></li>

<li><a href="https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/start">Agent Platform 快速入門</a></li>

<li><a href="https://cloud.google.com/vertex-ai/generative-ai/pricing">Agent Platform 價格</a></li>

<li><a href="https://docs.cloud.google.com/cloud-assist/overview">Gemini Cloud Assist 概覽</a></li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p class="wp-block-paragraph">MLOps、LLMOps、AgentOps、AIOps 拆開之後，下一篇把所有 Ops 名詞收成一張總表：DevOps、SRE、Platform Engineering、FinOps 又各自在管什麼。可以看看<a href="https://dongdonggcp.com/">東東的 GCP 課程</a>，或<a href="https://line.me/R/ti/p/@754xlakm">加 LINE 聊聊</a>你現在的狀況，一起找出最適合你的學習順序。</p>



<style>.wp-block-code{overflow-x:auto}.wp-block-code code{white-space:pre !important;overflow-wrap:normal !important;word-break:normal !important}</style>



<script type="application/ld+json">
{
  "@context": "https://schema.org",
  "@type": "FAQPage",
  "mainEntity": [
    {
      "@type": "Question",
      "name": "LLMOps 是什麼？用一句話說",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "LLMOps（大型語言模型維運）是管理和操作大型語言模型的做法和程序，Google 官方把它定位成 MLOps 的一支。實務上多管了提示詞、回答品質評估、token 成本和模型版本更換。這篇實測同一個問題，設定不同，token 從 833 個變 68 個、費用差約 15 倍，這就是 LLMOps 要盯的東西。"
      }
    },
    {
      "@type": "Question",
      "name": "LLMOps 和 MLOps 差在哪？",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "MLOps 管一般機器學習模型的整個生命週期，重點是資料漂移和重新訓練；LLMOps 是 MLOps 裡專門管大型語言模型的一支。多數公司不自己訓練 LLM，而是呼叫現成模型，所以 LLMOps 更常處理提示詞、評估、按 token 計費和模型退休。"
      }
    },
    {
      "@type": "Question",
      "name": "AIOps 是什麼？跟 MLOps、LLMOps 有什麼不同？",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "AIOps（IT 維運人工智慧）是用機器學習、自然語言處理這類 AI 技術幫忙做 IT 維運，例如合併警報、找根本原因、自動處理。MLOps、LLMOps 是「顧 AI」，AIOps 是「用 AI 顧系統」，方向相反。Google Cloud 上的例子是 Gemini Cloud Assist（2026 年 11 月仍是預覽版）。"
      }
    },
    {
      "@type": "Question",
      "name": "AgentOps 是什麼？",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "AgentOps 是管理 AI agent 整個生命週期的做法。agent 會自己決定步驟、呼叫工具，所以要追蹤每一步做了什麼、花了多少、權限夠不夠小、執行環境有沒有隔離。這個詞還沒有統一定義，Google 的《Agents Companion》白皮書把它放在 GenAIOps 底下；它也是一個工具的名字，看上下文判斷。"
      }
    },
    {
      "@type": "Question",
      "name": "GenAIOps、GenOps 和 LLMOps 是一樣的嗎？",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "大致是在講同一類事：生成式 AI 應用的維運。Google 的《Agents Companion》白皮書把 MLOps for GenAI、LLMOps、FMOps、GenAIOps 列成同義的說法，Google Cloud 部落格也用過 GenOps。不用糾結名字，重點是要管提示詞、評估、token 和安全。"
      }
    },
    {
      "@type": "Question",
      "name": "中文比英文吃 token 嗎？",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "不一定。這篇用 Gemini 3.8 Flash 的 countTokens 實測，「用一句話向完全不懂 IT 的人解釋什麼是 LLMOps」和意思相同的英文句子都是 16 個 token。不同模型、不同句子結果會不同，要知道自己的應用用多少，直接用 countTokens（不收費）或看回應的 usageMetadata。"
      }
    },
    {
      "@type": "Question",
      "name": "呼叫 Gemini 練習要花多少錢？",
      "acceptedAnswer": {
        "@type": "Answer",
        "text": "很少。這篇兩次正式呼叫照 Gemini 3.8 Flash 2026 年的優惠價（輸入 0.75、輸出 3.75 美元／百萬 token）算，分別是 0.0031 和 0.0002 美元；countTokens 不收費。要注意的是思考 token 也算在輸出裡，2027 年 1 月 1 日起單價會變兩倍。"
      }
    }
  ]
}
</script><p>The post <a href="https://dongdonggcp.com/2026/11/28/mlops-llmops-agentops-aiops-differences/">MLOps、LLMOps、AgentOps、AIOps 差在哪？AI 時代的 Ops 一次看懂</a> first appeared on <a href="https://dongdonggcp.com">東東 GCP 教學 - GCP 實戰講師</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://dongdonggcp.com/2026/11/28/mlops-llmops-agentops-aiops-differences/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
