> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hitheo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Theo 對比其他方案

> Theo 與模型代理、LangChain 以及直接調用模型 API 相比有何不同。

## 開發者的選擇

你想在產品中加入 AI 能力。你有以下幾種選擇：

1. **直接調用模型 API** — 直接調用單一供應商
2. **模型代理** — 使用統一網關實現多模型訪問
3. **框架** — 用 LangChain / LangGraph 自建管線
4. **編排 API** — 使用 Theo，一次調用即可完成分類、路由、技能、工具和計費

## 對比

| 能力 | 直接調用 API | 模型代理 | LangChain | **Theo** |
| - | - | - | - | - |
| 模型訪問 | 1 家供應商 | 300+ 個模型 | 任意（自行配置） | 300+ 個模型 |
| 意圖分類 | ❌ | ❌ | 自行構建 | ✅ 內置 |
| 模型路由 | ❌ | 手動 | 自行構建 | ✅ 自動 |
| 自動故障切換 | ❌ | ✅ | 自行構建 | ✅ 內置 |
| 工具執行 | 取決於供應商 | ❌ | 自行構建 | ✅ Agent 循環 |
| 技能 / 領域專長 | ❌ | ❌ | ❌ | ✅ 應用市場 |
| 自定義角色（E.V.I.） | 自行構建 | ❌ | 自行構建 | ✅ 一個參數即可 |
| 記憶 | ❌ | ❌ | 自行構建 | ✅ 跨會話 |
| 流式 | ✅ | ✅ | 自行構建 | ✅ SSE |
| 計費 / 額度 | 供應商計費 | ✅ | ❌ | ✅ 按令牌計費 |
| 語義緩存 | ❌ | ❌ | 自行構建 | ✅ 內置 |
| 審計追蹤 | ❌ | ❌ | 自行構建 | ✅ 不可篡改 |
| 上線所需時間 | 數週 | 數天 | 數月 | **數小時** |

## 代碼對比

### DIY 方案 — 一切自己處理

```typescript theme={null}
const model = pickModelForTask(prompt);          // you build this
const skills = loadDomainKnowledge(userContext);  // you build this
const tools = resolveToolDefinitions(skills);     // you build this
const systemPrompt = buildPrompt(persona, skills, tools); // you build this
const response = await llmProvider.complete({ model, messages, tools });
const toolResults = await executeTools(response.tool_calls); // you build this
const finalResponse = await llmProvider.complete({ model, messages: [..., toolResults] });
await debitCredits(user, response.usage);        // you build this
await logAudit(user, response);                  // you build this
```

### Theo — 一次調用即可

```typescript theme={null}
import { Theo } from "@hitheo/sdk";

const theo = new Theo({ apiKey: "theo_sk_..." });
const response = await theo.complete({
  prompt: "Check inventory across all warehouses",
  skills: ["inventory-check"],
  persona: { system_prompt: "You are Nova..." },
});
```

## 該如何選擇

**適合使用 Theo 的場景：**

* 你想要 AI 功能，但不想自建編排基礎設施
* 你需要具備自動故障切換的多模型路由
* 你想通過可安裝的技能獲得領域專長
* 你正在構建一個 E.V.I.（帶自定義角色的嵌入式 AI）
* 你需要內置的計費、緩存與審計能力

**適合使用模型代理的場景：**

* 你只是需要統一計費的模型訪問
* 你正在自建編排層

**適合使用 LangChain 的場景：**

* 你需要對管線中的每一個決策擁有完全控制權
* 你的場景需要自定義的 Agent 架構
* 你擁有足夠的工程團隊來構建並維護這套基礎設施

**適合直接調用 API 的場景：**

* 你只需要來自一家供應商的一個模型
* 你有特定的供應商要求（SLA、數據駐留等）


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.