获取模型版本详情
更新时间:2025-09-22
功能介绍
用于获取模型版本详情,如模型版本名称、描述、创建时间、输入输出模式、输入输出模式限制等。
使用说明
本文API支持通过Python SDK、Go SDK、Java SDK 和 Node.js SDK调用,调用流程请参考SDK安装及使用流程。
权限说明
调用本文API,需符合以下权限要求,权限介绍及分配,请查看角色与权限控制列表、账号创建与权限分配。需具有以下任一权限:
- 完全控制千帆大模型平台的权限:QianfanFullControlAccessPolicy
- 只读访问千帆大模型平台的权限:QianfanReadAccessPolicy
- 完全控制千帆大模型平台模型调优的权限:QianfanModelTuningFullControlAccessPolicy
- 只读访问千帆大模型平台模型调优的权限:QianfanModelTuningReadAccessPolicy
SDK调用
调用示例
import os
from qianfan import resources
# 通过环境变量初始化认证信息
# 使用安全认证AK/SK调用,替换下列示例中参数,安全认证Access Key替换your_iam_ak,Secret Key替换your_iam_sk,如何获取请查看https://cloud.baidu.com/doc/Reference/s/9jwvz2egb
os.environ["QIANFAN_ACCESS_KEY"] = "your_iam_ak"
os.environ["QIANFAN_SECRET_KEY"] = "your_iam_sk"
resp = resources.console.utils.call_action(
# 调用本文API,该参数值为固定值,无需修改;对应API调用文档-请求结构-请求地址的后缀
"/v2/model",
# 调用本文API,该参数值为固定值,无需修改;对应API调用文档-请求参数-Query参数的Action
"DescribeModel",
# 请查看本文请求参数说明,根据实际使用选择参数;对应API调用文档-请求参数-Body参数
{
"modelId":"amv-xxxxatka4jk0"
}
)
print(resp.body)package main
import (
"context"
"fmt"
"os"
"github.com/baidubce/bce-qianfan-sdk/go/qianfan"
)
func main() {
// 使用安全认证AK/SK鉴权,通过环境变量初始化;替换下列示例中参数,安全认证Access Key替换your_iam_ak,Secret Key替换your_iam_sk
os.Setenv("QIANFAN_ACCESS_KEY", "your_iam_ak")
os.Setenv("QIANFAN_SECRET_KEY", "your_iam_sk")
ca := qianfan.NewConsoleAction()
res, err := ca.Call(context.TODO(),
// 调用本文API,该参数值为固定值,无需修改;对应API调用文档-请求结构-请求地址的后缀
"/v2/model",
// 调用本文API,该参数值为固定值,无需修改;对应API调用文档-请求参数-Query参数的Action
"DescribeModel",
// 请查看本文请求参数说明,根据实际使用选择参数;对应API调用文档-请求参数-Body参数
map[string]interface{}{
"modelId":"amv-xxxxatka4jk0",
})
if err != nil {
panic(err)
}
fmt.Println(string(res.Body))
}import com.baidubce.qianfan.Qianfan;
import com.baidubce.qianfan.model.console.ConsoleResponse;
import com.baidubce.qianfan.util.CollUtils;
import com.baidubce.qianfan.util.Json;
import java.util.Map;
public class Dome {
public static void main(String args[]){
// 使用安全认证AK/SK鉴权,替换下列示例中参数,安全认证Access Key替换your_iam_ak,Secret Key替换your_iam_sk
Qianfan qianfan = new Qianfan("your_iam_ak", "your_iam_sk");
ConsoleResponse<Map<String, Object>> response = qianfan.console()
// 调用本文API,该参数值为固定值,无需修改;对应API调用文档-请求结构-请求地址的后缀
.route("/v2/model")
// 调用本文API,该参数值为固定值,无需修改;对应API调用文档-请求参数-Query参数的Action
.action("DescribeModel")
// 需要传入参数的场景,可以自行封装请求类,或者使用Map.of()来构建请求Body
// Java 8可以使用SDK提供的CollUtils.mapOf()来替代Map.of()
// 请查看本文请求参数说明,根据实际使用选择参数;对应API调用文档-请求参数-Body参数
.body(CollUtils.mapOf(
"modelId","amv-xxxxatka4jk0"
))
.execute();
System.out.println(Json.serialize(response));
}
}import {consoleAction, setEnvVariable} from "@baiducloud/qianfan";
// 使用安全认证AK/SK鉴权,通过环境变量初始化;替换下列示例中参数,安全认证Access Key替换your_iam_ak,Secret Key替换your_iam_sk
setEnvVariable('QIANFAN_ACCESS_KEY','your_iam_ak');
setEnvVariable('QIANFAN_SECRET_KEY','your_iam_sk');
async function main() {
//base_api_route:调用本文API,该参数值为固定值,无需修改;对应API调用文档-请求结构-请求地址的后缀
//action:调用本文API,该参数值为固定值,无需修改;对应API调用文档-请求参数-Query参数的Action
//data:请查看本文请求参数说明,根据实际使用选择参数;对应API调用文档-请求参数-Body参数
const res = await consoleAction({base_api_route: '/v2/model', action: 'DescribeModel', data: {
"modelId":"amv-xxxxatka4jk0"
}
});
console.log(res);
}
main();返回示例
{
"requestId": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
"result": {
"modelSetId": "am-xxxxtnsfq9sb",
"modelId": "amv-xxxxatka4jk0",
"modelName": "V2",
"description": "clc_test_publish_chatglm32k_v10",
"sourceInfo": {
"sourceType": "Train",
"trainTaskId": "task-xxxx"
},
"status": "Ready",
"modelApplicationType": "chat",
"tokenLimitations": {},
"createTime": "2025-09-22T14:47:25+08:00",
"modifyTime": "2025-09-22T14:47:27+08:00",
"isSupportDeploy": True,
"isSupportModelComp": False,
"isSupportEvaluation": True,
"model": "Qwen2.5-14B-Instruct",
"resourceType": [
"GPU-1-1"
],
"advancedSettings": {
"hardwareType": "nvidia-gpu",
"samplingStrategy": "greedySearch",
"isPrecisionPrior": False
},
"modelCompConfigs": [
{
"strategy": "Quantization",
"weight": "W8A8C16"
},
{
"strategy": "Quantization",
"weight": "W8A16"
},
{
"strategy": "Quantization",
"weight": "W4A16"
},
{
"strategy": "Quantization",
"weight": "W8A8C16"
}
]
}
}{
"requestId": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
"result": {
"modelSetId": "am-xxxxtnsfq9sb",
"modelId": "amv-xxxxatka4jk0",
"modelName": "V2",
"description": "clc_test_publish_chatglm32k_v10",
"sourceInfo": {
"sourceType": "Train",
"trainTaskId": "task-xxxx"
},
"status": "Ready",
"modelApplicationType": "chat",
"tokenLimitations": {},
"createTime": "2025-09-22T14:47:25+08:00",
"modifyTime": "2025-09-22T14:47:27+08:00",
"isSupportDeploy": true,
"isSupportModelComp": false,
"isSupportEvaluation": true,
"model": "Qwen2.5-14B-Instruct",
"resourceType": [
"GPU-1-1"
],
"advancedSettings": {
"hardwareType": "nvidia-gpu",
"samplingStrategy": "greedySearch",
"isPrecisionPrior": false
},
"modelCompConfigs": [
{
"strategy": "Quantization",
"weight": "W8A8C16"
},
{
"strategy": "Quantization",
"weight": "W8A16"
},
{
"strategy": "Quantization",
"weight": "W4A16"
},
{
"strategy": "Quantization",
"weight": "W8A8C16"
}
]
}
}{
"requestId": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
"result": {
"modelSetId": "am-xxxxtnsfq9sb",
"modelId": "amv-xxxxatka4jk0",
"modelName": "V2",
"description": "clc_test_publish_chatglm32k_v10",
"sourceInfo": {
"sourceType": "Train",
"trainTaskId": "task-xxxx"
},
"status": "Ready",
"modelApplicationType": "chat",
"tokenLimitations": {},
"createTime": "2025-09-22T14:47:25+08:00",
"modifyTime": "2025-09-22T14:47:27+08:00",
"isSupportDeploy": true,
"isSupportModelComp": false,
"isSupportEvaluation": true,
"model": "Qwen2.5-14B-Instruct",
"resourceType": [
"GPU-1-1"
],
"advancedSettings": {
"hardwareType": "nvidia-gpu",
"samplingStrategy": "greedySearch",
"isPrecisionPrior": false
},
"modelCompConfigs": [
{
"strategy": "Quantization",
"weight": "W8A8C16"
},
{
"strategy": "Quantization",
"weight": "W8A16"
},
{
"strategy": "Quantization",
"weight": "W4A16"
},
{
"strategy": "Quantization",
"weight": "W8A8C16"
}
]
}
}{
"requestId": "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
"result": {
"modelSetId": "am-xxxxtnsfq9sb",
"modelId": "amv-xxxxatka4jk0",
"modelName": "V2",
"description": "clc_test_publish_chatglm32k_v10",
"sourceInfo": {
"sourceType": "Train",
"trainTaskId": "task-xxxx"
},
"status": "Ready",
"modelApplicationType": "chat",
"tokenLimitations": {},
"createTime": "2025-09-22T14:47:25+08:00",
"modifyTime": "2025-09-22T14:47:27+08:00",
"isSupportDeploy": true,
"isSupportModelComp": false,
"isSupportEvaluation": true,
"model": "Qwen2.5-14B-Instruct",
"resourceType": [
"GPU-1-1"
],
"advancedSettings": {
"hardwareType": "nvidia-gpu",
"samplingStrategy": "greedySearch",
"isPrecisionPrior": false
},
"modelCompConfigs": [
{
"strategy": "Quantization",
"weight": "W8A8C16"
},
{
"strategy": "Quantization",
"weight": "W8A16"
},
{
"strategy": "Quantization",
"weight": "W4A16"
},
{
"strategy": "Quantization",
"weight": "W8A8C16"
}
]
}
}请求参数
| 名称 | 类型 | 必填 | 描述 |
|---|---|---|---|
| modelId | string | 是 | 模型版本ID,示例:amv-g73j3faikzpz,通过以下方式获取该字段值: · 方式一,通过调用新建我的模型版本接口,返回的modelId字段获取 · 方式二,在控制台-我的模型-点击某模型详情,在版本列表中查看 ![]() |
返回参数
| 名称 | 类型 | 描述 |
|---|---|---|
| requestId | string | 请求ID |
| result | object | 模型版本相关信息 |
result说明
| 名称 | 类型 | 描述 |
|---|---|---|
| modelSetId | string | 模型ID |
| modelId | string | 模型版本ID |
| status | string | 状态,说明: · Ready:已就绪 · Creating:创建中 · Fail:创建失败 |
| modelName | string | 模型版本名称 |
| model | string | 基础模型版本名称 |
| sourceInfo | object | 模型版本来源回溯信息 |
| description | string | 模型版本描述,说明: · 当有模型版本描述时,才返回该字段; · 如果无模型版本描述,不返回此字段 |
| createTime | string | 模型版本创建时间 |
| modifyTime | string | 模型版本修改时间 |
| modelApplicationType | string | 输入输出模式,说明: · chat:对话模式 · completion:续写模式 · embedding:向量模式 · reranker:重排序模式 · Text-to-Image:文生图模式 · Image-to-Text:图生文模式 · video:视频生成模式 · voice:语音生成 |
| tokenLimitations | object | 输入输出长度限制 |
| isSupportDeploy | bool | 是否支持部署 |
| isSupportModelComp | bool | 是否支持压缩 |
| isSupportEvaluation | bool | 是否支持评估 |
| resourceType | List<string> | 资源类型,返回如下: · CPU I型:CPU-1-1 · 加速卡I型:GPU-1-1、GPU-1-2、GPU-1-4、GPU-1-8 · 加速卡II型:GPU-2-1 · 加速卡III型:GPU-3-1 · 加速卡VI型:GPU-4-1、GPU-4-2 · 加速卡V型:GPU-5-1、GPU-5-2 · 加速卡VI型:GPU-6-1、GPU-6-2 · 加速卡VII型:GPU-7-1、GPU-7-2、GPU-7-4、GPU-7-8 |
| advancedSettings | object | 量化压缩配置 |
| modelCompConfigs | List<object> | 模型压缩可选配置列表 |
sourceInfo说明
| 名称 | 类型 | 描述 |
|---|---|---|
| sourceType | string | 模型版本来源类型,不同类型对应不同的数据结构,说明: · Train:大模型训练产生 · Acceleration:模型加速产生 · Import:外部导入模型 · PlatformPreset:平台预置模型版本 |
| trainTaskId | string | 大模型训练任务id |
| accelerationTaskId | string | 模型版本加速任务id |
| importModelVersionBosUrl | string | 导入模型版本bos地址 |
tokenLimitations说明
| 名称 | 类型 | 描述 |
|---|---|---|
| trivial | object | modelApplicationType非reranker类型的模型上下文限制 |
| reranker | object | modelApplicationType为reranker类型的模型上下文限制 |
trivial说明
| 名称 | 类型 | 描述 |
|---|---|---|
| inputTokens | int | 输入tokens限制 |
| outputTokens | int | 输出tokens限制 |
| characterLimit | int | 字符数限制 |
reranker说明
| 名称 | 类型 | 描述 |
|---|---|---|
| queryTokens | int | query的tokens限制 |
| queryCharacterLimit | int | query的字符数限制 |
| documentTokens | int | document的tokens限制 |
| documentCharacterLimit | int | document的字符数限制 |
advancedSettings说明
| 名称 | 类型 | 描述 |
|---|---|---|
| hardwareType | string | 硬件类型 |
| samplingStrategy | string | 压缩时的采样策略,说明: (1)当导入HuggingFace模型,且推理引擎为vLLM,该参数有效, (2)可选值如下: · 多项式采样:multinomialSampling · 束搜索:beamSearch · 贪心搜索:greedySearch |
| isPrecisionPrior | bool | 是否精度优先 |
| numBeams | int | 束数量,说明: (1)当导入HuggingFace模型,该参数有效 (2)取值范围为2-15 |
| topLogprobs | int | logits中topk的值,范围为1~20 |
modelCompConfigs说明
| 名称 | 类型 | 描述 |
|---|---|---|
| strategy | string | 模型压缩策略,说明: · Quantization:量化压缩策略 · Sparsity:稀疏化压缩策略 |
| sparsityRatio | float | 稀疏比例,strategy为Sparsity时返回 |
| weight | string | 量化压缩配置,说明: (1)只有当strategy为Quantization时返回该字段 (2)说明: · W8A8C4:EB模型 · W8A8C8:EB模型 · W8A8C16:EB模型 · W8A16C16:HF模型 · W4A16C16:HF模型 |

