Ollaya:Jev 風格決策模型的本地推論
Ollaya 是一個開源推論引擎,專為在本地執行決策模型而設計。與傳統逐個 token 生成文字的大型語言模型 (LLM) 不同,決策模型能在單次前向傳遞中,針對文字或 JSON 輸入的特定問題提供經過校準的類型化答案,從而實現毫秒級的延遲。
高效能本地決策推論
Ollaya 允許使用者在自己的硬體上執行決策模型,確保敏感資料(如客戶工單和電子郵件)保持私密。該系統針對速度進行了最佳化,在 NVIDIA RTX 4090 上透過 HTTP API 對 Laya 模型進行五個問題的請求,端到端耗時約為 10ms。
效能基準測試
在 NVIDIA RTX 4090 上透過 HTTP API 進行五個問題請求的中位數延遲如下:
| 模型 | 中位數延遲 |
|---|---|
| laya:multilingual | 8.1 ms |
| laya:en | 9.6 ms |
| gliclass | 14.7 ms |
| nli | 20.4 ms |
| decider:0.8b | 155 ms |
| decider:2b | 190 ms |
作為對比,TypeSafe 託管 API 的中位數請求延遲為 236–276 ms(包含網路開銷)。
TypeSafe API 相容性
Ollaya 是 TypeSafe API 的直接替代品,支援 /v1/systemone 和 /v1/models 端點。這使得官方的 TypeSafe Python SDK (v0.7.1) 無需修改即可運作,只需更新 TYPESAFE_BASE_URL 和 TYPESAFE_API_KEY 環境變數即可。
請求與回應範例
典型的請求會要求模型將輸入字串(例如:「我可以取得上個月的發票嗎?」)分類到預定義的標準集(例如:發票、退款、其他)中。
請求:
{
"model": "laya",
"state": "Can I get an invoice for last month?",
"questions": {
"intent": {
"type": "choice",
"instructions": "What does the customer want?",
"criteria": {
"invoice": "Needs an invoice or receipt",
"refund": "Wants money back",
"other": "Anything else"
}
}
}
}
回應:
{
"model": "laya:en",
"answers": {
"intent": {
"type": "choice",
"choice": "invoice",
"confidence": 0.9547,
"probabilities": {
"invoice": 0.9698,
"refund": 0.0172,
"other": 0.013
}
}
},
"usage": {
"input_tokens": 43,
"output_tokens": 0
}
}
模型支援與部署
Ollaya 提供對來自 Convai Innovations 的 Laya 模型的存取,包括英文專用、多語言和路由器模型。
平台可用性
Ollaya 以桌面應用程式、命令列工具和 Docker 映像檔的形式發布。它支援以下硬體配置:
- Linux (x86-64/ARM64): 在 x86-64 上完全支援 NVIDIA GPU 加速 (CUDA 13)。
- Windows: 透過 WSL 2 支援 NVIDIA GPU 加速。
- macOS (Apple Silicon): 僅限 CPU 執行。
- Docker: amd64 映像檔提供 NVIDIA GPU 加速。
社群見解與技術討論
Hacker News 上的社群成員討論了 Ollaya 的實用性與定位。雖然有些人稱讚其設定簡單且能使用舊硬體(例如 GTX 970),但其他人則質疑 Laya 與 Jev 相比的實際決策品質。
"Has anyone actually seen better or the same results with Laya compared to Jev? From my experience, Laya performs significantly worse. It's less confident and often makes wrong decisions with more complex queries." — @handle
其他討論集中在決策模型與傳統分類器或重排序器之間的區別。一些使用者建議,如果決策模型變得普及,主要的 LLM 執行器 Ollama 可能最終會實現對它們的原生支援。
此外,社群開發了一個用於 Ollaya API 的網頁 UI 來輔助該工具:ollaya-web-ui。
Sources
相關
- Dispatch
- 專案
- 專案
- 專案
- Dispatch