Cohere
在 LibreChat 中将 Cohere 配置为自定义 endpoint。
Cohere 提供了 Command 系列模型,在 LibreChat 中作为自定义 endpoint 使用。其 API 不遵循 OpenAI 规范,因此它依赖于一个映射了部分参数的兼容层。
获取 API key
从 Cohere dashboard 创建一个密钥。将其添加到你的 .env 文件中:
COHERE_API_KEY=your-api-key配置
在你的 librechat.yaml 中,将 endpoint 添加到 endpoints.custom 下:
- name: "cohere"
apiKey: "${COHERE_API_KEY}"
baseURL: "https://api.cohere.ai/v1"
models:
default: ["command-r","command-r-plus","command-light","command-light-nightly","command","command-nightly"]
fetch: false
modelDisplayLabel: "cohere"
titleModel: "command"
dropParams: ["stop", "user", "frequency_penalty", "presence_penalty", "temperature", "top_p"]注意事项
- Cohere 不遵循 OpenAI 规范。一个兼容层将 OpenAI 参数的子集映射到 Cohere 的对应参数:
stop映射为stopSequences,top_p映射为p,frequency_penalty映射为frequencyPenalty,presence_penalty映射为presencePenalty(每个参数的最小/最大范围各不相同)。model和stream是共享的,默认会发送;max_tokens映射为maxTokens,但默认不会发送。上面的示例使用了dropParams来移除其中大部分参数,并回退到 Cohere 的默认设置。 - 有关 Cohere 特定参数的完整列表,请参阅 Cohere API documentation。
这篇指南怎么样?