A Cheaper Model Does Not Imply a Cheaper Turn
Alook 是一個開源、self-hosted 的平台,旨在利用傳統的組織圖(organizational chart)架構進行 multi-agent orchestration。使用者無需手動連接複雜的 graphs,而是為 agents 定義 roles 和 reporting lines,agents 之間則透過 email inboxes 進行通訊。這種方法允許使用者利用現有的 agent runtimes(例如 Claude Code 和 OpenCode)直觀地在本地管理 AI teams。Model routing 是一種透過將簡單任務導向較便宜的 LLMs 來降低成本的策略,但在長期的 agent sessions 中可能會適得其反。由於 prompt caches 是綁定特定模型的,在對話中途切換模型會迫使整個歷史紀錄進行完整的「cold prefill」,失去 warm caches 提供的 90% 折扣。在對話歷史龐大的情境下,在較便宜的模型上重新處理歷史紀錄的成本往往會超過其較低的 per-token rate 所帶來的節省。Claude 輸出的品質主要取決於 prompt structure,這可以分解為八個核心 building blocks。這些 blocks 包括定義 role、指定帶有 success criteria 的 objectives,以及使用 XML tags 明確劃分 context 和 examples。Anthropic 的研究表明,將長篇 documents 放在 prompt 的開頭可提升 30% 的效能。像 pre-filling 和 reasoning tags 這類進階技巧更能進一步提升模型的精確度與 formatting。
閱讀原文 ↗目錄
如何建立自己的 AI 公司(100% local)
Alook 是一個開源、self-hosted 的平台,旨在利用傳統的組織圖架構進行 multi-agent orchestration。使用者無需手動連接複雜的 graphs,而是為 agents 定義 roles 和 reporting lines,agents 之間則透過 email inboxes 進行通訊。這種方法允許使用者利用現有的 agent runtimes(例如 Claude Code 和 OpenCode)直觀地在本地管理 AI teams。
- Alook 以階層式 organization chart 架構取代手動的 graph-based agent orchestration。
- Alook 系統中的 agents 透過專屬的 email inboxes 來協同作業並交換資訊。
- 該 platform 設計為 100% 本地端運行且為 open-source,確保資料隱私。
- Alook 支援多種 agent runtimes,包含 Claude Code、OpenCode 與 Codex。
- 此組織架構允許單一真人窗口對接負責向下分派任務的「CEO」agent。
更便宜的 model 並不意味著更便宜的 turn
Model routing 是一種透過將簡單任務導向較便宜的 LLM 來降低成本的策略,但在長對話的 agent sessions 中可能適得其反。由於 prompt cache 是 model-specific 的,在對話中途切換 model 會強制對整個歷史記錄進行完整的「cold prefill」,因而失去 warm cache 提供的 90% 折扣。在對話歷史記錄龐大的情境下,在較便宜的 model 上重新處理歷史記錄的成本,往往會超過其較低 per-token rate 所節省的費用。
- 當 prefix 符合儲存的 KV cache 時,prompt caching 允許 provider 僅以基準 input rate 的 10% 來計算 token 費用。
- KV cache 是 model-specific 的,由於 weights 不同,無法在像 Opus 5 與 Haiku 4.5 這類 model 之間轉移。
- 在 session 中途切換 model 會使 warm cache 失效,需要對整個對話 transcript 進行完整的 re-prefill。
- 對 Anthropic 的 Opus 5 與 Haiku 4.5 而言,只有在歷史記錄小於新 input 大小的 8 倍時,切換到較便宜的 model 才能省錢。
- Model routing 對於獨立的 prompts 或歷史記錄 penalty 極小的短 sessions 最為有效。
- 切換 model 最具效率的時機是在 context reset 或 compaction 期間,因為此時 cache 本來就已經失效。
Claude prompt 的結構剖析
Claude 的 output 品質主要由 prompt 結構決定,該結構可拆解為八個關鍵的 building blocks。這些 blocks 包括定義 role、指定帶有 success criteria 的 objectives,以及使用 XML tags 來清楚劃分 context 和 examples。Anthropic 的研究顯示,將長文件放在 prompt 的開頭可提升 30% 的效能。像 pre-filling 與 reasoning tags 等進階技巧可進一步優化 model 的準確度與格式。
- 一個結構良好的 Claude prompt 會使用八個 building blocks:Role、Objective、Context、Examples、Thinking、Constraints、Output Format 以及 Pre-filling。
- 在 system prompt 中定義特定的 role,會顯著改變 Claude 的 reasoning 與溝通風格。
- 納入 success criteria(「so that」)可為 Claude 提供評估自身表現的基準。
- 將長文件置於 prompt 頂端、並將 query 放在末端,可將 response 品質提升 30%。
- 像 <context>、<examples> 與 <thinking> 這類的 XML tags,對於組織複雜資訊以及將 reasoning 與最終答案分開至關重要。
- 透過 API pre-filling response 的開頭,能讓使用者跳過開場白(preambles)並強制套用特定的 output formats。
AI 公司如何看待 Agent Harness?
Agent harness 代表圍繞著 AI model、使其能夠作為 agent 運作的 infrastructure,而各家公司目前對這一層應該具備多高的複雜度仍未達成共識。Anthropic 提倡依賴 model 智慧的 thin harness,而 LangGraph 則採用具有明確 graph-based logic 的 thick harness。雖然這種 infrastructure 通常是作為暫時性的 scaffolding,會隨著 model 進步而被移除,但 model 在訓練過程中也可能會對特定的 harness 結構產生依賴。來自 TerminalBench 2.0 的證據表明,在不改變底層 model 的情況下,單純優化 harness 就能顯著提升 agent 的效能。
- Agent harness 是包裝 model 以管理 turns、tools 與 memory 的 infrastructure。
- Anthropic 的 dumb loop 方法假設隨著 model 變得更聰明,對複雜 infrastructure 的需求將會減少。
- OpenAI 的 Agents SDK 優先採用 code-first 方法,使用 native Python 而非 domain-specific languages。
- LangGraph 使用 thick harness,其中每個決策點和 transition 都被明確定義為 graph 中的 node 或 edge。
- scaffolding(鷹架)隱喻描述了一種 harness 邏輯:一旦模型具備在內部處理這些任務的能力,該邏輯就會被移除。
- LangChain 僅僅透過變更其 infrastructure,就將其在 TerminalBench 2.0 上的排名從 30 名以外提升至第 5 名。
- 在訓練迴圈中包含特定 harness 所訓練出的模型,若該 harness 被修改,可能會面臨效能下降的問題。