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

Mistral

在 LibreChat 中将 Mistral 配置为自定义 endpoint。

Mistral 提供了其自有的聊天和嵌入模型系列,在 LibreChat 中作为自定义 endpoint 使用。

获取 API key

Mistral console 创建一个密钥。将其添加到你的 .env 文件中:

MISTRAL_API_KEY=your-api-key

配置

在你的 librechat.yaml 中,将 endpoint 添加到 endpoints.custom 下:

    - name: "Mistral"
      apiKey: "${MISTRAL_API_KEY}"
      baseURL: "https://api.mistral.ai/v1"
      models:
        default: ["mistral-tiny", "mistral-small", "mistral-medium", "mistral-large-latest"]
        fetch: true
      titleConvo: true
      titleModel: "mistral-tiny"
      modelDisplayLabel: "Mistral"
      dropParams: ["stop", "user", "frequency_penalty", "presence_penalty"]

注意事项

  • Mistral API 仅允许在消息负载的顶部包含一条系统消息。
  • 该 API 对无法识别的参数要求严格,且其错误信息描述性不强(通常仅显示为 "no body")。必须使用 dropParams 来丢弃 userfrequency_penaltypresence_penalty
  • stop 不再是默认参数,因此除非您希望阻止用户对其进行配置,否则无需将其包含在 dropParams 中。
  • 支持获取模型列表,但请注意不要选择用于聊天的嵌入(embedding)模型。

这篇指南怎么样?