大模型提供方
大模型提供方是在组织中注册的一个具体模型部署。AI 节点通过 id 引用它,节点运行时由 Sommatic AI 在服务端解析端点和密钥。
大模型提供方告诉 Sommatic AI 调用哪个模型、如何访问它。只需注册一次,所有工作流中的 AI 节点都通过 llm_provider_id 引用它。要把工作流切换到另一个模型,只需更改节点引用的提供方,无需改动工作流逻辑。
提供方类型
provider_type 决定 Sommatic AI 用哪个适配器与模型通信。它以对象形式保存,例如 { "id": 3, "name": "openai", "title": "OpenAI" }:
provider_type | 名称 |
|---|---|
link-loom-cloud | Link Loom Cloud |
azure-foundry | Azure Foundry |
openai | OpenAI |
aws-bedrock | AWS Bedrock |
google-vertex | Google Vertex AI |
azure-openai | Azure OpenAI |
generic-json | Generic JSON(默认值) |
字段
| 字段 | 说明 |
|---|---|
slug、name、description | 稳定键与显示名称。slug 和 name 为必填。 |
organization_id、project_id | 所属组织,以及可选的所属项目。 |
provider_type | 上表中的一种类型。 |
transport_kind | 访问提供方的方式。控制台使用 http-api。 |
endpoint、api_version、deployment_name | 模型所在位置,以及要使用的部署名或模型标识。 |
default_parameters | 调用未覆盖时使用的参数(如 temperature、max_tokens)。 |
input_token_limit、output_token_limit | 部署的 token 上限。 |
pricing、rate_limits、safety_settings、routing_rules | 提供方的成本元数据、限流、安全约束与路由规则。 |
is_default | 标记为组织的默认提供方。 |
状态:enabled、review、deprecated、archived。
注册提供方
打开提供方列表
在控制台中进入 Advanced → Cognitive Infrastructure → Model,列表会显示组织内的全部大模型提供方。
创建提供方
选择 Create LLM Provider,填写提供方类型、端点、部署名,以及部署所需的 API 版本。
在节点中使用
在工作流 Studio 中打开一个 AI 节点,在 LLM Provider 中选择该提供方。节点会把它的 id 保存在 llm_provider_id 中。
直接调用提供方
POST /cognitive-infrastructure/cognitive-assets/llm-provider/invoke 对某个提供方执行一次调用,与 AI 节点在 sync 模式下发出的调用相同。
Shell
curl -X POST https://api.sommatic.ai/cognitive-infrastructure/cognitive-assets/llm-provider/invoke \
-H "Authorization: Bearer $SOMMATIC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"model_id": "<llm-provider-id>",
"operation": "chat",
"input": {
"messages": [
{ "role": "system", "content": "请用一句话回答。" },
{ "role": "user", "content": "什么是 flow version?" }
]
}
}'JavaScript
const response = await fetch(
'https://api.sommatic.ai/cognitive-infrastructure/cognitive-assets/llm-provider/invoke',
{
method: 'POST',
headers: {
Authorization: `Bearer ${token}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
model_id: llmProviderId,
operation: 'chat',
input: {
messages: [
{ role: 'system', content: '请用一句话回答。' },
{ role: 'user', content: '什么是 flow version?' },
],
},
}),
},
);
const { success, result } = await response.json();| 请求体字段 | 必填 | 说明 |
|---|---|---|
model_id | 是 | 大模型提供方记录的 id。 |
input | 是 | 调用输入。对话调用使用 OpenAI 格式的 messages(role、content)。 |
operation | 否 | chat(默认)或 embedding。 |
响应采用标准信封格式 { status, success, message, result }。