7.3 模型元数据系统
7.3.1 Provider.Model 类型定义
Provider.Model 类型定义export const Model = z.object({
id: z.string(), // 模型 ID(如 "claude-sonnet-4-20250514")
providerID: z.string(), // 所属 Provider
api: z.object({
id: z.string(), // API 调用时使用的模型 ID
url: z.string(), // API 端点 URL
npm: z.string(), // SDK npm 包名
}),
name: z.string(), // 模型显示名称
family: z.string().optional(), // 模型系列(如 "claude-3")
capabilities: z.object({
temperature: z.boolean(), // 是否支持 temperature 参数
reasoning: z.boolean(), // 是否具有推理能力
attachment: z.boolean(), // 是否支持文件附件
toolcall: z.boolean(), // 是否支持工具调用
input: z.object({ // 输入模态支持
text: z.boolean(),
audio: z.boolean(),
image: z.boolean(),
video: z.boolean(),
pdf: z.boolean(),
}),
output: z.object({ // 输出模态支持
text: z.boolean(),
audio: z.boolean(),
image: z.boolean(),
video: z.boolean(),
pdf: z.boolean(),
}),
interleaved: z.union([ // 交错思考链支持
z.boolean(),
z.object({ field: z.enum(["reasoning_content", "reasoning_details"]) }),
]),
}),
cost: z.object({ // 定价信息(每百万 token)
input: z.number(),
output: z.number(),
cache: z.object({
read: z.number(),
write: z.number(),
}),
experimentalOver200K: z.object({ /* 超过 200K 上下文的定价 */ }).optional(),
}),
limit: z.object({ // 限制
context: z.number(), // 上下文窗口大小
input: z.number().optional(), // 最大输入 token 数
output: z.number(), // 最大输出 token 数
}),
status: z.enum(["alpha", "beta", "deprecated", "active"]),
options: z.record(z.string(), z.any()),
headers: z.record(z.string(), z.string()),
release_date: z.string(),
variants: z.record(z.string(), z.record(z.string(), z.any())).optional(),
})能力系统的设计
能力
使用场景
价格信息的用途
7.3.2 models.dev 集成
模型搜索
7.3.3 Small Model 选择
7.3.4 模型变体(Variants)
Last updated
