跳到主要内容

部署详情(QuickStart)

更新时间:2025-07-22 14:32:25
基模型服务详情。
GET
https://api.alayanew.com/api/serverless-infer/v1/deployment/{serviceId}
Authorizations
AuthorizationsStringHeaderRequired

用户可通过已获取Open API Key做验证,例如:plain Credential=[YOUR_AK],Signature=[YOUR_SK]。

Path Parameters
serviceIdStringRequired

服务ID。

Response
状态码:application/json
serviceUrlString

服务URL。

apiKeyString

API Key。

statusString

状态。

instanceList<Map<String, Object>>

实例信息。

instance.instanceIdString

实例ID。

instance.loraModelsList<String>

关联LoRA模型列表。

instance.baseModelReadyboolean

基模型是否准备完成。

serviceIdString

服务ID。

vksIdString

弹性容器集群(VKS)ID。

namespaceString

弹性容器集群(VKS)NameSpace。

nameString

服务名称。

servedNameList<String>

模型内部标识。

modelIdString

模型ID。

modeString

启动方式,例如:quickStart/expert。

quickStartObject

curl --location --request GET 'https://api.alayanew.com/api/serverless-infer/v1/deployment/38fbfc3d-6a88-4c35-b8b6-9efc83949d47'     
     --header 'Authorization:plain Credential=YOUR_AK,Signature=YOUR_SK' 
     --header 'Content-Type: application/json'
{
    "code": 0,
    "data": {
        "serviceUrl":"string",
        "apikey":"String ",
        "status":"String ,模型部署状态starting, running, stopping,  stopped, failed",
        "instance": [{
            "instanceId": "0",
            "loraModels": ["lora1","lora2"],
            "baseModelReady": true
        }],
        "vksId":"",
        "namespace":"",
        "name":"string , 服务展示名称由用户自定义",
        "servedName": ["string, 模型内部标识"],
        "modelId": "String, 模型ID",
        "mode":"quickStart",
        "quickStart":{
            "backend":"vllm/sglang",
            "backendVersion":"0.8.4...",
            "backenArgs":[],
            "resource": {
                 "workers": "optional, int, number of workers",
                 "cpu": "required,int",
                 "mem": "required,int",
                 "gpu": {
                    "gpuType": "required, string, gpu type name",
                    "count": "required, int, number of gpu to be use"
          }
      },
      "expert":{...}
    }
  }
}

服务状态

服务状态(status)流转详情如下图所示。

image

服务调用

用户在部署模型服务后,可通过指定模型的参数来调用该服务。调用服务的代码示例如下所示。

curl --location --request POST '[serviceUrl]/v1/chat/completions' \
--header 'apiKey: [apiKey]' \
--data-raw `{ "stream":false,
"messages": [{"role":"user", "content":"你是谁,能干嘛"}],
"model":"[servedName]"}`