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

Apple MLX

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

Apple MLX 通过 OpenAI-compatible API 在 Apple 芯片上本地运行模型,因此你可以将 LibreChat 指向你自己的机器。

配置

本地 MLX 服务器不对请求进行身份验证,因此 API key 仅作为占位符。将 baseURL 指向您正在运行的服务器。在 librechat.yaml 中的 endpoints.custom 下添加该 endpoint:

    - name: "MLX"
      apiKey: "mlx"
      baseURL: "http://localhost:8080/v1/" 
      models:
        default: [
          "Meta-Llama-3-8B-Instruct-4bit"
          ]
        fetch: false # fetching list of models is not supported
      titleConvo: true
      titleModel: "current_model"
      summarize: false
      summaryModel: "current_model"
      modelDisplayLabel: "Apple MLX"
      addParams:
            max_tokens: 2000
            "stop": [
              "<|eot_id|>"
            ]

注意事项

  • MLX 服务器一次仅运行一个模型。若要服务多个模型,请在不同的端口上运行单独的实例,并添加另一个具有各自 baseURL 的 endpoint。
  • API 对无法识别的参数要求严格,因此请将 addParams 限制在服务器可接受的值内,例如 max_tokensstop

这篇指南怎么样?