跳转到主要内容

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 作为提供方。对于支持 OpenAI API schema 的模型提供方,Langfuse 会使用此适配器。
3

输入 CometAPI 凭证

使用以下值配置连接:
FieldValue
API key你的 CometAPI API key
Base URLhttps://api.cometapi.com/v1
Custom model IDs来自 CometAPI Models page 的一个或多个 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 评估器可以使用同一个 LLM connection。在评估器配置中选择 CometAPI 连接,然后选择一个支持 tool calling 的 model ID(如果你的评分 Prompt 需要结构化提取)。 仅当所选的 CometAPI 模型支持这些请求字段时,才使用 provider options。要发现模型,请使用 CometAPI Models page/v1/models API。

故障排查

将精确的 CometAPI model ID 添加到 LLM connection 的 custom model IDs 列表中。对于自定义的 OpenAI 兼容提供方,Langfuse 不会自动发现每一个模型。
使用 https://api.cometapi.com/v1 作为 base URL。Langfuse 会为所选适配器追加 OpenAI 兼容路径。
确认所选模型支持评估器使用的请求功能,例如 tool calling 或 JSON 输出。

相关资源