跳转至

自定义 OpenAI-compatible LLM

LLM 供应商 · 本地日志

使用实现了 POST /chat/completions 的云端兼容接口。该 provider 仍是云端 BYOK 配置;项目 不内置或管理本地模型运行时。

最小配置会使用 OpenAI 的 endpoint 和 gpt-5-mini,如果目标不是 OpenAI,应使用完整配置:

{
  "llm": {
    "provider": "openai-compatible",
    "apiKey": "replace-me"
  }
}
{
  "llm": {
    "enabled": true,
    "provider": "openai-compatible",
    "endpoint": "https://llm.example.com/v1/chat/completions",
    "apiKey": "replace-me",
    "model": "model-name",
    "mode": "smart",
    "style": "clean",
    "timeoutMs": 10000,
    "customPrompt": "表达自然、简洁"
  }
}

接口需要接受 Bearer Token、modelmessagesstream: false,响应需要提供 choices[0].message.content。兼容接口返回的 x-request-idrequest-idx-trace-idx-tt-logidx-api-request-id 会进入本地日志。