Chat UI 文件

Anthropic

Hugging Face's logo
加入 Hugging Face 社群

並獲得增強的文件體驗

開始使用

Anthropic

特性 可用
工具
多模態

我們還透過官方 SDK 支援 Anthropic 模型(包括透過 multmodal: true 支援的多模態模型)。您可以透過 ANTHROPIC_API_KEY 環境變數提供您的 API 金鑰,或者根據以下示例,透過 endpoints.apiKey 提供。

MODELS=`[
  {
      "name": "claude-3-haiku-20240307",
      "displayName": "Claude 3 Haiku",
      "description": "Fastest and most compact model for near-instant responsiveness",
      "multimodal": true,
      "parameters": {
        "max_new_tokens": 4096,
      },
      "endpoints": [
        {
          "type": "anthropic",
          // optionals
          "apiKey": "sk-ant-...",
          "baseURL": "https://api.anthropic.com",
          "defaultHeaders": {},
          "defaultQuery": {}
        }
      ]
  },
  {
      "name": "claude-3-sonnet-20240229",
      "displayName": "Claude 3 Sonnet",
      "description": "Ideal balance of intelligence and speed",
      "multimodal": true,
      "parameters": {
        "max_new_tokens": 4096,
      },
      "endpoints": [
        {
          "type": "anthropic",
          // optionals
          "apiKey": "sk-ant-...",
          "baseURL": "https://api.anthropic.com",
          "defaultHeaders": {},
          "defaultQuery": {}
        }
      ]
  },
  {
      "name": "claude-3-opus-20240229",
      "displayName": "Claude 3 Opus",
      "description": "Most powerful model for highly complex tasks",
      "multimodal": true,
      "parameters": {
         "max_new_tokens": 4096
      },
      "endpoints": [
        {
          "type": "anthropic",
          // optionals
          "apiKey": "sk-ant-...",
          "baseURL": "https://api.anthropic.com",
          "defaultHeaders": {},
          "defaultQuery": {}
        }
      ]
  }
]`

VertexAI

我們還支援使用在 Vertex AI 上執行的 Anthropic 模型。身份驗證透過 Google 應用程式預設憑據完成。專案 ID 可透過 endpoints.projectId 提供,如以下示例所示。

MODELS=`[
  {
      "name": "claude-3-haiku@20240307",
      "displayName": "Claude 3 Haiku",
      "description": "Fastest, most compact model for near-instant responsiveness",
      "multimodal": true,
      "parameters": {
         "max_new_tokens": 4096
      },
      "endpoints": [
        {
          "type": "anthropic-vertex",
          "region": "us-central1",
          "projectId": "gcp-project-id",
          // optionals
          "defaultHeaders": {},
          "defaultQuery": {}
        }
      ]
  },
  {
      "name": "claude-3-sonnet@20240229",
      "displayName": "Claude 3 Sonnet",
      "description": "Ideal balance of intelligence and speed",
      "multimodal": true,
      "parameters": {
        "max_new_tokens": 4096,
      },
      "endpoints": [
        {
          "type": "anthropic-vertex",
          "region": "us-central1",
          "projectId": "gcp-project-id",
          // optionals
          "defaultHeaders": {},
          "defaultQuery": {}
        }
      ]
  },
]`
< > 在 GitHub 上更新

© . This site is unofficial and not affiliated with Hugging Face, Inc.