服务调用
接口测试
curl http://localhost:8000/v1/models
输出示例:
{
"object":"list",
"data":[
{
"id":"models/gptq-Qwen2.5-7B-Instruct/",
"object":"model",
"created":1752157983,
"owned_by":"vllm",
"root":"models/gptq-Qwen2.5-7B-Instruct/",
"parent":null,
"max_model_len":1500,
"permission":[
{
"id":"modelperm-531dc2363c5f4277bb258d23b69914bf",
"object":"model_permission",
"created":1752157983,
"allow_create_engine":false,
"allow_sampling":true,
"allow_logprobs":true,
"allow_search_indices":false,
"allow_view":true,
"allow_fine_tuning":false,
"organization":"*",
"group":null,
"is_blocking":false
}
]
}
]
}
接口调用
注意
注意:需要替换为本地的模型路径。
另开一个窗口调用:
curl http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "models/gptq-Qwen2.5-7B-Instruct/",
"temperature": 0.7,
"top_p": 0.8,
"top_k": 20,
"repetition_penalty":1.05,
"max_tokens": 1000,
"messages": [{"role": "user", "content": "介绍一下北京"}]
}'