Anthropic
- 在 https://platform.claude.com/ 创建一个账户
- 前往 https://platform.claude.com/settings/keys 并获取您的 api key
- 您需要将以下环境变量设置为您的密钥,或者将其设置为
user_provided以便用户提供他们自己的密钥。
- 您可以通过
ANTHROPIC_MODELS来确定您希望可用的模型。
注意:
- Claude Fable 5 已包含在 LibreChat 的默认 Anthropic 模型目录中。Fable/Mythos 类模型在 LibreChat 中使用现代 Anthropic 配置文件:支持 1M 上下文、128K 最大输出、自适应思维(adaptive thinking)、提示词缓存(prompt caching)以及用于摘要或省略推理输出的
thinkingDisplay支持。 - Anthropic endpoint 支持通过
librechat.yaml配置文件使用所有 Shared Endpoint Settings,包括streamRate、headers、titleModel、titleMethod、titlePrompt、titlePromptTemplate和titleEndpoint。 - 要将 Anthropic 或兼容 Anthropic 的网关配置为单独的自定义 endpoint,请使用
provider: "anthropic"。
Vertex AI
LibreChat 支持通过 Google Cloud Vertex AI 运行 Anthropic Claude 模型。如果您有以下需求,这将非常有用:
- 已经拥有 Google Cloud 基础设施
- 想要使用您现有的 GCP 账单和凭据
- 需要符合区域数据驻留要求
快速设置 (环境变量)
设置以下环境变量以通过 Vertex AI 启用 Anthropic:
先决条件
- 已启用 Vertex AI API 的 Google Cloud Project
- Service Account,并具备以下角色:
Vertex AI User(roles/aiplatform.user)- 或者
Vertex AI Administrator以获得完全访问权限
- 在您的 Vertex AI Model Garden 中启用的 Claude models
- Service Account Key (JSON 文件),已下载并可供 LibreChat 访问
高级配置
对于模型名称映射和高级设置(类似于 Azure OpenAI 配置),请使用 librechat.yaml 文件:
有关详细的 YAML 配置选项,请参阅 Anthropic Vertex AI Configuration。
这篇指南怎么样?