8
n8n 中文网amn8n.com

Cerebras GPT OSS 120B 模型

中级

这是一个AI Chatbot, Multimodal AI领域的自动化工作流,包含 6 个节点。主要使用 Set, HttpRequest, ChatTrigger 等节点。 通过 Cerebras 推理使用 OpenAI GPT-OSS-120B 模型的高速 AI 聊天

前置要求
  • 可能需要目标 API 的认证凭证
工作流预览
可视化展示节点连接关系,支持缩放和平移
导出工作流
复制以下 JSON 配置到 n8n 导入,即可使用此工作流
{
  "id": "fFKIMw0PeIP2TuOx",
  "meta": {
    "instanceId": "9219ebc7795bea866f70aa3d977d54417fdf06c41944be95e20cfb60f992db19",
    "templateCredsSetupCompleted": true
  },
  "name": "cerebras with gpt oss 120b",
  "tags": [],
  "nodes": [
    {
      "id": "dc93a613-c19f-4dd4-b633-a1112970455d",
      "name": "当收到聊天消息时",
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "position": [
        208,
        0
      ],
      "webhookId": "6530c15b-038f-4b20-bf38-58d034ac3ea6",
      "parameters": {
        "options": {}
      },
      "typeVersion": 1.3
    },
    {
      "id": "a941ace5-5a7e-495a-a37d-8dee620f2bb5",
      "name": "返回输出",
      "type": "n8n-nodes-base.set",
      "position": [
        880,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "409dd10e-b29c-4fac-b471-3204a46034a1",
              "name": "output",
              "type": "string",
              "value": "={{ $json.choices[0].message.content }}"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "849f0355-d1e5-475c-bc1b-1fdd6c693745",
      "name": "设置API密钥",
      "type": "n8n-nodes-base.set",
      "position": [
        432,
        0
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "f828da75-ee7e-482b-83e5-123005f9878d",
              "name": "apiKey",
              "type": "string",
              "value": "your-api-key"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "1f1590ef-2682-40cc-9e5f-447a2513dcc0",
      "name": "Cerebras 端点",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        656,
        0
      ],
      "parameters": {
        "url": "https://api.cerebras.ai/v1/chat/completions",
        "method": "POST",
        "options": {
          "redirect": {
            "redirect": {}
          }
        },
        "jsonBody": "={\n  \"model\": \"gpt-oss-120b\",\n  \"stream\": false,\n  \"messages\": [\n    {\n      \"content\": \"{{ $('When chat message received').item.json.chatInput }}\",\n      \"role\": \"user\"\n    }\n  ],\n  \"temperature\": 0,\n  \"max_completion_tokens\": -1,\n  \"seed\": 0,\n  \"top_p\": 1\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "=Bearer {{ $json.apiKey }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "9eb60d7e-b40e-4e26-87ce-000e99c45985",
      "name": "便签",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        384,
        -144
      ],
      "parameters": {
        "width": 192,
        "height": 304,
        "content": "## 设置 API 密钥"
      },
      "typeVersion": 1
    },
    {
      "id": "4eba1448-d1eb-4ceb-85df-de10a942a91a",
      "name": "便签1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        592,
        176
      ],
      "parameters": {
        "width": 272,
        "height": 240,
        "content": "## 参数"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "4a9e3b9f-4132-4871-b159-6c0663bcb49d",
  "connections": {
    "Set API Key": {
      "main": [
        [
          {
            "node": "Cerebras endpoint",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Cerebras endpoint": {
      "main": [
        [
          {
            "node": "Return Output",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When chat message received": {
      "main": [
        [
          {
            "node": "Set API Key",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
常见问题

如何使用这个工作流?

复制上方的 JSON 配置代码,在您的 n8n 实例中创建新工作流并选择「从 JSON 导入」,粘贴配置后根据需要修改凭证设置即可。

这个工作流适合什么场景?

中级 - AI 聊天机器人, 多模态 AI

需要付费吗?

本工作流完全免费,您可以直接导入使用。但请注意,工作流中使用的第三方服务(如 OpenAI API)可能需要您自行付费。

工作流信息
难度等级
中级
节点数量6
分类2
节点类型4
难度说明

适合有一定经验的用户,包含 6-15 个节点的中等复杂度工作流

作者
Aitor | 1Node

Aitor | 1Node

@aitoralonso

Hi, I'm Aitor with 1 Node. We create practical AI solutions for businesses. Nothing fancy, just tools that solve real problems and help you scale. Always happy to have a conversation about how we might be able to help you grow

外部链接
在 n8n.io 查看

分享此工作流