Skip to main content
LibreChat is joining ClickHouse to power the open-source Agentic Data Stack 🎉 Learn more
LibreChat

LiteLLM

将 LiteLLM 配置为 LibreChat 中的自定义 endpoint。

LiteLLM Proxy 是一个自托管网关,它通过单一的 OpenAI 兼容 endpoint 公开来自多个提供商的模型,因此您可以将 LibreChat 指向您自己的代理。

配置

API 密钥应与您在 LiteLLM 代理配置中设置的值匹配,而不是提供商密钥,因此请使用下方的占位符或您自己的密钥。将 baseURL 指向您正在运行的代理。在 librechat.yamlendpoints.custom 下添加该 endpoint:

    - name: "LiteLLM"
      apiKey: "sk-from-config-file"
      baseURL: "http://localhost:8000/v1"
      # if using LiteLLM example in docker-compose.override.yml.example, use "http://litellm:8000/v1"
      models:
        default: ["gpt-3.5-turbo"]
        fetch: true
      titleConvo: true
      titleModel: "gpt-3.5-turbo"
      summarize: false
      summaryModel: "gpt-3.5-turbo"
      modelDisplayLabel: "LiteLLM"

注意事项

  • 请参阅 Using LibreChat with LiteLLM Proxy 以获取设置代理的完整指南。
  • 当设置 fetch: true 时,LibreChat 会加载您代理中配置的完整模型列表,因此 default 仅作为初始选项。
  • 如果您运行了 docker-compose.override.yml.example 中捆绑的代理,请将 baseURL 设置为 http://litellm:8000/v1,以便容器可以通过服务名称相互访问。

这篇指南怎么样?