模型供应商参考
查阅供应商标识、模型类型、凭据、默认端点、Embedding 适配器与端点安全策略
Clouisle 通过统一的模型供应商抽象层接入多模态模型,覆盖对话、嵌入(Embedding)、重排序(Rerank)、语音(TTS/STT)、图像与视频生成,以及**决策(Decision)**模型。
供应商标识枚举
系统共定义 23 个模型供应商标识(ModelProvider)。下表列出各供应商的后端默认端点;未填写自定义 base_url 时,运行时按此默认值解析请求地址。
供应商标识 (provider) | 显示名称 | 默认 API Base URL |
|---|---|---|
openai | OpenAI | https://api.openai.com/v1 |
openai_responses | OpenAI Responses | https://api.openai.com/v1 |
anthropic | Anthropic | https://api.anthropic.com |
google | Google AI | https://generativelanguage.googleapis.com/v1beta |
azure_openai | Azure OpenAI | 无(必须由用户配置 Endpoint) |
deepseek | DeepSeek | https://api.deepseek.com |
moonshot | Moonshot | https://api.moonshot.cn/v1 |
zhipu | Zhipu AI | https://open.bigmodel.cn/api/paas/v4 |
qwen | Qwen(通义千问) | https://dashscope.aliyuncs.com/compatible-mode/v1 |
baichuan | Baichuan | https://api.baichuan-ai.com/v1 |
minimax | MiniMax | https://api.minimax.chat/v1 |
volcengine | Volcengine(火山引擎) | https://ark.cn-beijing.volces.com/api/v3 |
siliconflow | SiliconFlow | https://api.siliconflow.cn/v1 |
xai | xAI (Grok) | https://api.x.ai/v1 |
ollama | Ollama | http://localhost:11434 |
runway | Runway | https://api.dev.runwayml.com |
pika | Pika | https://api.pika.art/v1 |
luma | Luma AI | https://api.lumalabs.ai/dream-machine/v1 |
kling | Kling | https://api.klingai.com |
stability | Stability AI | https://api.stability.ai |
midjourney | Midjourney | 无(需要代理) |
typesafe | TypeSafe AI | https://api.typesafe.ai/v1 |
custom | OpenAI Compatible(自定义) | 无(由接入方提供) |
针对 volcengine,部分模型类型有专属默认端点,优先于上表通用端点:
- TTS:
https://openspeech.bytedance.com/api/v3/tts/unidirectional/sse - Audio Generation:
https://openspeech.bytedance.com/api/v3/tts/create
解析优先级为:显式 base_url > 供应商 + 模型类型专属端点 > 供应商通用端点。typesafe + decision 也登记了专属端点(与通用端点相同)。
模型类型分类 (ModelType)
model_type 描述模型的能力类别,与供应商相互独立;同一供应商通常只支持其中若干种类型。当前共定义 9 种模型类型:
模型类型 (model_type) | 说明 |
|---|---|
chat | 对话与文本补全大语言模型(支持流式响应与函数调用) |
embedding | 文本向量嵌入模型(用于知识库 RAG 与记忆检索) |
rerank | 检索重排序模型(对初筛文本切片重新打分) |
tts | 文本转语音(Text-to-Speech) |
stt | 语音转文本(Speech-to-Text) |
audio_generation | 提示词生成音频 |
text_to_image | 文本生成图片 |
text_to_video | 文本生成视频 |
decision | 类型化决策模型(choice / score / 是-否),不生成文本 |
决策模型与 TypeSafe AI
decision 类型是非生成式模型:它把一个「状态」对照若干类型化问题求值,返回带概率分布的类型化答案,全程不产出文本。它专供工作流的决策节点使用。
- 唯一供应商:
decision类型目前只接受typesafe供应商;提交decision模型时若provider不是typesafe,创建/更新接口会返回校验错误(model_type_not_supported)。 - 默认端点:
https://api.typesafe.ai/v1。运行时请求发往{base_url}/v1/systemone;适配器会保证路径包含/v1段,因此把base_url配成https://api.typesafe.ai(不含/v1)或https://api.typesafe.ai/v1都会解析到https://api.typesafe.ai/v1/systemone。 - 鉴权:API Key 以
Authorization: Bearer <key>发送。 - 模型 ID:例如
jev-1.13.0,或jev-latest跟随供应商当前版本。模型发现(POST /api/v1/admin/models/discover,需admin:model:create)对 TypeSafe 使用/v1/models路径,并自动避免与已含/v1的base_url重复拼接版本段。 - 端点白名单:
https://api.typesafe.ai已在默认模型端点白名单内;若经由自建网关转发,需先将该网关 Origin 登记到站点设置 > 安全。
decision 与 typesafe 的方向性约束
校验是「类型 → 供应商」单向的:decision 类型必须由 typesafe 提供。反向并不成立——typesafe 供应商在配置层未被强制限定为 decision,但把它配成其他类型(如 chat)在运行时会因无对应适配器而失败。请只把 TypeSafe 用于 decision 类型。
Embedding 模型的供应商支持范围
model_type: embedding 并非对所有供应商标识都可用。创建/更新模型时会校验(EMBEDDING_SUPPORTED_PROVIDERS),后端 Embedding 适配器再按供应商分派到两条路径:
| 适配器路径 | 覆盖的供应商 | 行为说明 |
|---|---|---|
OpenAICompatibleEmbeddingAdapter | openai、openai_responses、deepseek、moonshot、zhipu、qwen、baichuan、minimax、volcengine、siliconflow、xai、ollama、custom | 直接调用 OpenAI 兼容的 /embeddings 端点,捕获上游 usage |
FallbackEmbeddingAdapter | google、azure_openai | 通过 LangChain Embeddings 实现生成向量,usage 为空 |
| 不支持 | anthropic、typesafe、runway、pika、luma、kling、stability、midjourney 等 | 不在 EMBEDDING_SUPPORTED_PROVIDERS 内,创建时即被拒绝;anthropic 即使绕过校验也会在运行时报 Unsupported provider for embedding |
关于 Embedding 适配器的详细机制(降级策略、Token 计量、动态维度、Qdrant 集合划分),参见Embedding 适配器与向量维度。
模型定义字段
| 字段 | 类型 | 必填 | 默认值 | 说明与校验规则 |
|---|---|---|---|---|
name | string | 是 | 无 | 模型显示名称,1-100 字符 |
provider | enum | 是 | 无 | 供应商标识(见上述 23 个枚举值) |
model_id | string | 是 | 无 | 上游服务商实际模型 ID,1-100 字符 |
model_type | enum | 是 | 无 | 模型类型(见上述 9 种类型) |
provider_display_name | string/null | 否 | null | 面向终端用户的供应商显示名称 |
base_url | string/null | 否 | null | 自定义 API URL(最长 512 字符),受端点白名单策略约束 |
api_key | string/null | 否 | null | 访问密钥(本地供应商如 Ollama 可为空);服务端密文加密存储 |
context_length | integer/null | 否 | null | 最大上下文长度(必须 >= 1) |
max_output_tokens | integer/null | 否 | null | 最大输出 Token 数(必须 >= 1) |
input_price | decimal/null | 否 | null | 每百万输入 Token 计费价格(非负,最多 6 位小数) |
output_price | decimal/null | 否 | null | 每百万输出 Token 计费价格(非负,最多 6 位小数) |
default_params | object/null | 否 | null | 默认推理参数(如 temperature、top_p) |
capabilities | object/null | 否 | null | 特性标记:vision、function_calling、streaming 等 |
is_enabled | boolean | 否 | true | 是否全局启用该模型 |
is_default | boolean | 否 | false | 是否为同类型默认模型 |
sort_order | integer | 否 | 0 | 排序权重,升序排列 |
模型端点安全与连通性测试
端点白名单策略 (model_endpoint_allowlist)
所有外发至模型服务商的请求地址均经过系统端点白名单强校验:
- 系统内置预置 20 个官方服务商 Origin(含
https://api.typesafe.ai),例如https://api.openai.com、https://api.deepseek.com、https://api.anthropic.com、https://generativelanguage.googleapis.com等。 - 白名单最多 200 条(
MODEL_ENDPOINT_ALLOWLIST_MAX_ENTRIES)。 - 若管理员配置了自定义私有 Base URL(如自建 vLLM、私有 Ollama 节点),必须在站点设置 > 模型端点白名单中显式登记其完整 Origin(
scheme + host + port)。 - 校验阶段忽略请求路径、查询参数与凭据,但非标准端口(如
:11434)会严格参与匹配。
连通性测试接口
在管理台添加或保存模型时,可调用测试端点 POST /api/v1/admin/models/{model_id}/test 验证连通性:
- 测试请求使用管理员即时提交的凭据进行上游轻量调用;凭据在测试时不会自动入库。
- 对
decision类型,测试会构造一次最小决策求值而非对话请求。 - 返回结构包含:
success(bool):连通性是否正常message(string):成功信息或上游异常详情latency_ms(float/null):网络与响应往返耗时(毫秒)
这篇文章对你有帮助吗?