跳轉到主要內容

Documentation Index

Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt

Use this file to discover all available pages before exploring further.

Langfuse 提供 LLM 可觀測性、Prompt 管理、playground 與評估工作流程。當您希望 Langfuse Playground 或 LLM-as-a-Judge 評估呼叫 CometAPI 模型時,請將 Langfuse LLM Connection 設定為使用 CometAPI。

先決條件

設定整合

1

建立 Langfuse LLM connection

在 Langfuse 中,開啟 Project SettingsLLM Connections。開始新增 LLM API key 的流程。
2

選擇 OpenAI 轉接器

選取 OpenAI 作為 provider。Langfuse 會對支援 OpenAI API schema 的模型 provider 使用此轉接器。
3

輸入 CometAPI 憑證

使用以下值設定連線:
FieldValue
API key您的 CometAPI API key
Base URLhttps://api.cometapi.com/v1
Custom model IDs一個或多個來自 CometAPI Models 頁面 的 model ID
如果 Langfuse 將 base URL 欄位放在 Advanced Settings 之下,請先展開該區段再儲存連線。
4

在 Playground 中測試

在 Langfuse Playground 中,選取 CometAPI LLM connection 與其中一個已設定的 model ID。送出一個簡短的 Prompt,以確認 Langfuse 收到回應。

將 CometAPI 用於 LLM-as-a-Judge

Langfuse LLM-as-a-Judge evaluator 可使用相同的 LLM connection。在 evaluator 設定中選取 CometAPI connection,然後選擇一個支援 tool calling 的 model ID(如果您的評分 Prompt 需要結構化擷取)。 僅在所選的 CometAPI 模型支援這些請求欄位時才使用 provider 選項。若要探索模型,請使用 CometAPI Models 頁面/v1/models API。

疑難排解

將精確的 CometAPI model ID 加入 LLM connection 的自訂 model IDs 清單中。對於自訂的 OpenAI 相容 provider,Langfuse 不會自動探索每個模型。
使用 https://api.cometapi.com/v1 作為 base URL。Langfuse 會為所選的轉接器附加 OpenAI 相容路徑。
確認所選模型支援 evaluator 使用的請求功能,例如 tool calling 或 JSON 輸出。

相關資源