vllm启动Qwen/Qwen3-Coder-30B-A3B-Instruct并支持工具调用

阿里云千问团队在2025年8月1号推出了Qwen3-Coder系列的一个比较小参数版本Qwen/Qwen3-Coder-30B-A3B-Instruct 具有较强的性能并且对显存要求没那么高。那么我们应该如何在本地启动并使用这个模型开发Agent呢?

众所周知,Agent相比于LLM的最大的区别就是Agent可以使用各种各样的工具,所以我们想使用Qwen3-Coder-30B-A3B-Instruct开发Agent的前提就是让它支持工具调用。

硬件参数

显卡:H20(96G VRAM)

模型下载

安装modelscope

pip install modelscope

下载模型

modelscope download --model Qwen/Qwen3-Coder-30B-A3B-Instruct

注:模型文件大小在39GB左右,请提供足够的磁盘空间

VLLM模型服务

安装vllm>=0.10.0

推荐使用uv安装

pip install uv
uv venv
source .venv/bin/activate
uv pip install -U vllm --torch-backend auto

VLLM服务配置

model: Qwen/Qwen3-Coder-30B-A3B-Instruct
served_model_name: qwen3-coder
host: 0.0.0.0
port: 8000
tensor-parallel-size: 1
gpu-memory-utilization: 0.9
api-key: your-api-key
disable-fastapi-docs: true
enable-auto-tool-choice: true
tool-call-parser: qwen3_coder
max-model-len: 32768

将这份配置保存为qwen3-coder.yml

启动VLLM模型服务

vllm serve --config qwen3-coder.yml

观察日志输出,如果出现和上图一样的日志就代表模型服务启动成功了

工具调用测试

工具调用测试我准备使用openai-agents[litellm]测试

安装openai-agents-python

uv pip install "openai-agents[litellm]"

测试代码

import asyncio
from agents.extensions.models.litellm_model import LitellmModel
from agents import Agent, function_tool, Runner


qwen3_coder = LitellmModel(
    base_url="http://localhost:8000/v1",  # vllm 服务地址
    api_key="your-api-key",  # 注意这里只是方便演示,不推荐将api-key直接写到代码中,应该使用环境变量的方式os.getenv("API_KEY")
    model="openai/qwen3-coder",
)


@function_tool
def get_user_info(user_id: str):
    """
    get user info tool
    Args:
       user_id: str
    return user info in dict
    """
    return {"name": "Jack", "age": 18, "id": user_id}


agent = Agent(
    name="Your Agent",
    instructions="使用工具完成用户任务",
    model=qwen3_coder,
    tools=[get_user_info],
)


async def main():
    result = await Runner.run(agent, input="我的用户ID是1234,我是谁?")
    print(result.final_output)


if __name__ == "__main__":
    asyncio.run(main())

将代码保存成agent.py文件

运行代码

uv run python agent.py

测试结果

从图中可以看出模型已经成功调用get_user_info工具获取到用户信息。

解释一下2. Find the API endpoint below corresponding to your desired function in the app. Copy the code snippet, replacing the placeholder values with your own input data. Or use the API Recorder to automatically generate your API requests. api_name: /get_model_info copy from gradio_client import Client client = Client("http://localhost:7860/") result = client.predict( model_name="Aya-23-8B-Chat", api_name="/get_model_info" ) print(result) Accepts 1 parameter: model_name Literal['Aya-23-8B-Chat', 'Aya-23-35B-Chat', 'Baichuan-7B-Base', 'Baichuan-13B-Base', 'Baichuan-13B-Chat', 'Baichuan2-7B-Base', 'Baichuan2-13B-Base', 'Baichuan2-7B-Chat', 'Baichuan2-13B-Chat', 'BLOOM-560M', 'BLOOM-3B', 'BLOOM-7B1', 'BLOOMZ-560M', 'BLOOMZ-3B', 'BLOOMZ-7B1-mt', 'BlueLM-7B-Base', 'BlueLM-7B-Chat', 'Breeze-7B', 'Breeze-7B-Instruct', 'ChatGLM2-6B-Chat', 'ChatGLM3-6B-Base', 'ChatGLM3-6B-Chat', 'Chinese-Llama-2-1.3B', 'Chinese-Llama-2-7B', 'Chinese-Llama-2-13B', 'Chinese-Alpaca-2-1.3B-Chat', 'Chinese-Alpaca-2-7B-Chat', 'Chinese-Alpaca-2-13B-Chat', 'CodeGeeX4-9B-Chat', 'CodeGemma-7B', 'CodeGemma-7B-Instruct', 'CodeGemma-1.1-2B', 'CodeGemma-1.1-7B-Instruct', 'Codestral-22B-v0.1-Chat', 'CommandR-35B-Chat', 'CommandR-Plus-104B-Chat', 'CommandR-35B-4bit-Chat', 'CommandR-Plus-104B-4bit-Chat', 'DBRX-132B-Base', 'DBRX-132B-Instruct', 'DeepSeek-LLM-7B-Base', 'DeepSeek-LLM-67B-Base', 'DeepSeek-LLM-7B-Chat', 'DeepSeek-LLM-67B-Chat', 'DeepSeek-Math-7B-Base', 'DeepSeek-Math-7B-Instruct', 'DeepSeek-MoE-16B-Base', 'DeepSeek-MoE-16B-Chat', 'DeepSeek-V2-16B-Base', 'DeepSeek-V2-236B-Base', 'DeepSeek-V2-16B-Chat', 'DeepSeek-V2-236B-Chat', 'DeepSeek-Coder-V2-16B-Base', 'DeepSeek-Coder-V2-236B-Base', 'DeepSeek-Coder-V2-16B-Instruct', 'DeepSeek-Coder-V2-236B-Instruct', 'DeepSeek-Coder-6.7B-Base', 'DeepSeek-Coder-7B-Base', 'DeepSeek-Coder-33B-Base', 'DeepSeek-Coder-6.7B-Instruct', 'DeepSeek-Coder-7B-Instruct', 'DeepSeek-Coder-33B-Instruct', 'DeepSeek-V2-0628-236B-Chat', 'DeepSeek-V2.5-236B-Chat', 'DeepSeek-V2.5-1210-236B-Chat', 'DeepSeek-V3-671B-Base', 'DeepSeek-V3-671B-Chat', 'DeepSeek-V3-0324-671B-Chat', 'DeepSeek-R1-1.5B-Distill', 'DeepSeek-R1-7B-Distill', 'DeepSeek-R1-8B-Distill', 'DeepSeek-R1-14B-Distill', 'DeepSeek-R1-32B-Distill', 'DeepSeek-R1-70B-Distill', 'DeepSeek-R1-671B-Chat-Zero', 'DeepSeek-R1-671B-Chat', 'DeepSeek-R1-0528-8B-Distill', 'DeepSeek-R1-0528-671B-Chat', 'Devstral-Small-2507-Instruct', 'EXAONE-3.0-7.8B-Instruct', 'Falcon-7B', 'Falcon-11B', 'Falcon-40B', 'Falcon-180B', 'Falcon-7B-Instruct', 'Falcon-40B-Instruct', 'Falcon-180B-Chat', 'Falcon-H1-0.5B-Base', 'Falcon-H1-1.5B-Base', 'Falcon-H1-1.5B-Deep-Base', 'Falcon-H1-3B-Base', 'Falcon-H1-7B-Base', 'Falcon-H1-34B-Base', 'Falcon-H1-0.5B-Instruct', 'Falcon-H1-1.5B-Instruct', 'Falcon-H1-1.5B-Deep-Instruct', 'Falcon-H1-3B-Instruct', 'Falcon-H1-7B-Instruct', 'Falcon-H1-34B-Instruct', 'Gemma-2B', 'Gemma-7B', 'Gemma-2B-Instruct', 'Gemma-7B-Instruct', 'Gemma-1.1-2B-Instruct', 'Gemma-1.1-7B-Instruct', 'Gemma-2-2B', 'Gemma-2-9B', 'Gemma-2-27B', 'Gemma-2-2B-Instruct', 'Gemma-2-9B-Instruct', 'Gemma-2-27B-Instruct', 'Gemma-3-1B', 'Gemma-3-1B-Instruct', 'MedGemma-27B-Instruct', 'Gemma-3-4B', 'Gemma-3-12B', 'Gemma-3-27B', 'Gemma-3-4B-Instruct', 'Gemma-3-12B-Instruct', 'Gemma-3-27B-Instruct', 'MedGemma-4B', 'MedGemma-4B-Instruct', 'Gemma-3n-E2B', 'Gemma-3n-E4B', 'Gemma-3n-E2B-Instruct', 'Gemma-3n-E4B-Instruct', 'GLM-4-9B', 'GLM-4-9B-Chat', 'GLM-4-9B-1M-Chat', 'GLM-4-0414-9B-Chat', 'GLM-4-0414-32B-Base', 'GLM-4-0414-32B-Chat', 'GLM-4.1V-9B-Base', 'GLM-4.1V-9B-Thinking', 'GLM-Z1-0414-9B-Chat', 'GLM-Z1-0414-32B-Chat', 'GPT-2-Small', 'GPT-2-Medium', 'GPT-2-Large', 'GPT-2-XL', 'Granite-3.0-1B-A400M-Base', 'Granite-3.0-3B-A800M-Base', 'Granite-3.0-2B-Base', 'Granite-3.0-8B-Base', 'Granite-3.0-1B-A400M-Instruct', 'Granite-3.0-3B-A800M-Instruct', 'Granite-3.0-2B-Instruct', 'Granite-3.0-8B-Instruct', 'Granite-3.1-1B-A400M-Base', 'Granite-3.1-3B-A800M-Base', 'Granite-3.1-2B-Base', 'Granite-3.1-8B-Base', 'Granite-3.1-1B-A400M-Instruct', 'Granite-3.1-3B-A800M-Instruct', 'Granite-3.1-2B-Instruct', 'Granite-3.1-8B-Instruct', 'Granite-3.2-2B-Instruct', 'Granite-3.2-8B-Instruct', 'Granite-3.3-2B-Base', 'Granite-3.3-8B-Base', 'Granite-3.3-2B-Instruct', 'Granite-3.3-8B-Instruct', 'Granite-Vision-3.2-2B', 'Hunyuan-7B-Instruct', 'Index-1.9B-Base', 'Index-1.9B-Base-Pure', 'Index-1.9B-Chat', 'Index-1.9B-Character-Chat', 'Index-1.9B-Chat-32K', 'InternLM-7B', 'InternLM-20B', 'InternLM-7B-Chat', 'InternLM-20B-Chat', 'InternLM2-7B', 'InternLM2-20B', 'InternLM2-7B-Chat', 'InternLM2-20B-Chat', 'InternLM2.5-1.8B', 'InternLM2.5-7B', 'InternLM2.5-20B', 'InternLM2.5-1.8B-Chat', 'InternLM2.5-7B-Chat', 'InternLM2.5-7B-1M-Chat', 'InternLM2.5-20B-Chat', 'InternLM3-8B-Chat', 'InternVL2.5-2B-MPO', 'InternVL2.5-8B-MPO', 'InternVL3-1B-hf', 'InternVL3-2B-hf', 'InternVL3-8B-hf', 'InternVL3-14B-hf', 'InternVL3-38B-hf', 'InternVL3-78B-hf', 'Jamba-v0.1', 'Kimi-Dev-72B-Instruct', 'Kimi-VL-A3B-Instruct', 'Kimi-VL-A3B-Thinking', 'Kimi-VL-A3B-Thinking-2506', 'LingoWhale-8B', 'Llama-7B', 'Llama-13B', 'Llama-30B', 'Llama-65B', 'Llama-2-7B', 'Llama-2-13B', 'Llama-2-70B', 'Llama-2-7B-Chat', 'Llama-2-13B-Chat', 'Llama-2-70B-Chat', 'Llama-3-8B', 'Llama-3-70B', 'Llama-3-8B-Instruct', 'Llama-3-70B-Instruct', 'Llama-3-8B-Chinese-Chat', 'Llama-3-70B-Chinese-Chat', 'Llama-3.1-8B', 'Llama-3.1-70B', 'Llama-3.1-405B', 'Llama-3.1-8B-Instruct', 'Llama-3.1-70B-Instruct', 'Llama-3.1-405B-Instruct', 'Llama-3.1-8B-Chinese-Chat', 'Llama-3.1-70B-Chinese-Chat', 'Llama-3.2-1B', 'Llama-3.2-3B', 'Llama-3.2-1B-Instruct', 'Llama-3.2-3B-Instruct', 'Llama-3.3-70B-Instruct', 'Llama-3.2-11B-Vision', 'Llama-3.2-11B-Vision-Instruct', 'Llama-3.2-90B-Vision', 'Llama-3.2-90B-Vision-Instruct', 'Llama-4-Scout-17B-16E', 'Llama-4-Scout-17B-16E-Instruct', 'Llama-4-Maverick-17B-128E', 'Llama-4-Maverick-17B-128E-Instruct', 'LLaVA-1.5-7B-Chat', 'LLaVA-1.5-13B-Chat', 'LLaVA-NeXT-7B-Chat', 'LLaVA-NeXT-13B-Chat', 'LLaVA-NeXT-Mistral-7B-Chat', 'LLaVA-NeXT-Llama3-8B-Chat', 'LLaVA-NeXT-34B-Chat', 'LLaVA-NeXT-72B-Chat', 'LLaVA-NeXT-110B-Chat', 'LLaVA-NeXT-Video-7B-Chat', 'LLaVA-NeXT-Video-7B-DPO-Chat', 'LLaVA-NeXT-Video-7B-32k-Chat', 'LLaVA-NeXT-Video-34B-Chat', 'LLaVA-NeXT-Video-34B-DPO-Chat', 'Marco-o1-Chat', 'MiMo-7B-Base', 'MiMo-7B-Instruct', 'MiMo-7B-Instruct-RL', 'MiMo-7B-RL-ZERO', 'MiMo-7B-VL-Instruct', 'MiMo-7B-VL-RL', 'MiniCPM-2B-SFT-Chat', 'MiniCPM-2B-DPO-Chat', 'MiniCPM3-4B-Chat', 'MiniCPM4-0.5B-Chat', 'MiniCPM4-8B-Chat', 'MiniCPM-o-2_6', 'MiniCPM-V-2_6', 'Ministral-8B-Instruct-2410', 'Mistral-Nemo-Base-2407', 'Mistral-Nemo-Instruct-2407', 'Mistral-7B-v0.1', 'Mistral-7B-v0.2', 'Mistral-7B-v0.3', 'Mistral-7B-Instruct-v0.1', 'Mistral-7B-Instruct-v0.2', 'Mistral-7B-Instruct-v0.3', 'Mistral-Small-24B-Base-2501', 'Mistral-Small-24B-Instruct-2501', 'Mistral-Small-3.1-24B-Base', 'Mistral-Small-3.1-24B-Instruct', 'Mistral-Small-3.2-24B-Instruct', 'Mixtral-8x7B-v0.1', 'Mixtral-8x22B-v0.1', 'Mixtral-8x7B-v0.1-Instruct', 'Mixtral-8x22B-v0.1-Instruct', 'Moonlight-16B-A3B', 'Moonlight-16B-A3B-Instruct', 'OLMo-1B', 'OLMo-7B', 'OLMo-7B-Chat', 'OLMo-1.7-7B', 'OpenChat3.5-7B-Chat', 'OpenChat3.6-8B-Chat', 'OpenCoder-1.5B-Base', 'OpenCoder-8B-Base', 'OpenCoder-1.5B-Instruct', 'OpenCoder-8B-Instruct', 'Orion-14B-Base', 'Orion-14B-Chat', 'Orion-14B-Long-Chat', 'Orion-14B-RAG-Chat', 'Orion-14B-Plugin-Chat', 'PaliGemma-3B-pt-224', 'PaliGemma-3B-pt-448', 'PaliGemma-3B-pt-896', 'PaliGemma-3B-mix-224', 'PaliGemma-3B-mix-448', 'PaliGemma2-3B-pt-224', 'PaliGemma2-3B-pt-448', 'PaliGemma2-3B-pt-896', 'PaliGemma2-10B-pt-224', 'PaliGemma2-10B-pt-448', 'PaliGemma2-10B-pt-896', 'PaliGemma2-28B-pt-224', 'PaliGemma2-28B-pt-448', 'PaliGemma2-28B-pt-896', 'PaliGemma2-3B-mix-224', 'PaliGemma2-3B-mix-448', 'PaliGemma2-10B-mix-224', 'PaliGemma2-10B-mix-448', 'PaliGemma2-28B-mix-224', 'PaliGemma2-28B-mix-448', 'Phi-1.5-1.3B', 'Phi-2-2.7B', 'Phi-3-4B-4k-Instruct', 'Phi-3-4B-128k-Instruct', 'Phi-3-14B-8k-Instruct', 'Phi-3-14B-128k-Instruct', 'Phi-3.5-4B-instruct', 'Phi-3.5-MoE-42B-A6.6B-instruct', 'Phi-3-7B-8k-Instruct', 'Phi-3-7B-128k-Instruct', 'Phi-4-14B-Instruct', 'Pixtral-12B', 'Qwen-1.8B', 'Qwen-7B', 'Qwen-14B', 'Qwen-72B', 'Qwen-1.8B-Chat', 'Qwen-7B-Chat', 'Qwen-14B-Chat', 'Qwen-72B-Chat', 'Qwen-1.8B-Chat-Int8', 'Qwen-1.8B-Chat-Int4', 'Qwen-7B-Chat-Int8', 'Qwen-7B-Chat-Int4', 'Qwen-14B-Chat-Int8', 'Qwen-14B-Chat-Int4', 'Qwen-72B-Chat-Int8', 'Qwen-72B-Chat-Int4', 'Qwen1.5-0.5B', 'Qwen1.5-1.8B', 'Qwen1.5-4B', 'Qwen1.5-7B', 'Qwen1.5-14B', 'Qwen1.5-32B', 'Qwen1.5-72B', 'Qwen1.5-110B', 'Qwen1.5-MoE-A2.7B', 'Qwen1.5-0.5B-Chat', 'Qwen1.5-1.8B-Chat', 'Qwen1.5-4B-Chat', 'Qwen1.5-7B-Chat', 'Qwen1.5-14B-Chat', 'Qwen1.5-32B-Chat', 'Qwen1.5-72B-Chat', 'Qwen1.5-110B-Chat', 'Qwen1.5-MoE-A2.7B-Chat', 'Qwen1.5-0.5B-Chat-GPTQ-Int8', 'Qwen1.5-0.5B-Chat-AWQ', 'Qwen1.5-1.8B-Chat-GPTQ-Int8', 'Qwen1.5-1.8B-Chat-AWQ', 'Qwen1.5-4B-Chat-GPTQ-Int8', 'Qwen1.5-4B-Chat-AWQ', 'Qwen1.5-7B-Chat-GPTQ-Int8', 'Qwen1.5-7B-Chat-AWQ', 'Qwen1.5-14B-Chat-GPTQ-Int8', 'Qwen1.5-14B-Chat-AWQ', 'Qwen1.5-32B-Chat-AWQ', 'Qwen1.5-72B-Chat-GPTQ-Int8', 'Qwen1.5-72B-Chat-AWQ', 'Qwen1.5-110B-Chat-AWQ', 'Qwen1.5-MoE-A2.7B-Chat-GPTQ-Int4', 'CodeQwen1.5-7B', 'CodeQwen1.5-7B-Chat', 'CodeQwen1.5-7B-Chat-AWQ', 'Qwen2-0.5B', 'Qwen2-1.5B', 'Qwen2-7B', 'Qwen2-72B', 'Qwen2-MoE-57B-A14B', 'Qwen2-0.5B-Instruct', 'Qwen2-1.5B-Instruct', 'Qwen2-7B-Instruct', 'Qwen2-72B-Instruct', 'Qwen2-MoE-57B-A14B-Instruct', 'Qwen2-0.5B-Instruct-GPTQ-Int8', 'Qwen2-0.5B-Instruct-GPTQ-Int4', 'Qwen2-0.5B-Instruct-AWQ', 'Qwen2-1.5B-Instruct-GPTQ-Int8', 'Qwen2-1.5B-Instruct-GPTQ-Int4', 'Qwen2-1.5B-Instruct-AWQ', 'Qwen2-7B-Instruct-GPTQ-Int8', 'Qwen2-7B-Instruct-GPTQ-Int4', 'Qwen2-7B-Instruct-AWQ', 'Qwen2-72B-Instruct-GPTQ-Int8', 'Qwen2-72B-Instruct-GPTQ-Int4', 'Qwen2-72B-Instruct-AWQ', 'Qwen2-57B-A14B-Instruct-GPTQ-Int4', 'Qwen2-Math-1.5B', 'Qwen2-Math-7B', 'Qwen2-Math-72B', 'Qwen2-Math-1.5B-Instruct', 'Qwen2-Math-7B-Instruct', 'Qwen2-Math-72B-Instruct', 'Qwen2.5-0.5B', 'Qwen2.5-1.5B', 'Qwen2.5-3B', 'Qwen2.5-7B', 'Qwen2.5-14B', 'Qwen2.5-32B', 'Qwen2.5-72B', 'Qwen2.5-0.5B-Instruct', 'Qwen2.5-1.5B-Instruct', 'Qwen2.5-3B-Instruct', 'Qwen2.5-7B-Instruct', 'Qwen2.5-14B-Instruct', 'Qwen2.5-32B-Instruct', 'Qwen2.5-72B-Instruct', 'Qwen2.5-7B-Instruct-1M', 'Qwen2.5-14B-Instruct-1M', 'Qwen2.5-0.5B-Instruct-GPTQ-Int8', 'Qwen2.5-0.5B-Instruct-GPTQ-Int4', 'Qwen2.5-0.5B-Instruct-AWQ', 'Qwen2.5-1.5B-Instruct-GPTQ-Int8', 'Qwen2.5-1.5B-Instruct-GPTQ-Int4', 'Qwen2.5-1.5B-Instruct-AWQ', 'Qwen2.5-3B-Instruct-GPTQ-Int8', 'Qwen2.5-3B-Instruct-GPTQ-Int4', 'Qwen2.5-3B-Instruct-AWQ', 'Qwen2.5-7B-Instruct-GPTQ-Int8', 'Qwen2.5-7B-Instruct-GPTQ-Int4', 'Qwen2.5-7B-Instruct-AWQ', 'Qwen2.5-14B-Instruct-GPTQ-Int8', 'Qwen2.5-14B-Instruct-GPTQ-Int4', 'Qwen2.5-14B-Instruct-AWQ', 'Qwen2.5-32B-Instruct-GPTQ-Int8', 'Qwen2.5-32B-Instruct-GPTQ-Int4', 'Qwen2.5-32B-Instruct-AWQ', 'Qwen2.5-72B-Instruct-GPTQ-Int8', 'Qwen2.5-72B-Instruct-GPTQ-Int4', 'Qwen2.5-72B-Instruct-AWQ', 'Qwen2.5-Coder-0.5B', 'Qwen2.5-Coder-1.5B', 'Qwen2.5-Coder-3B', 'Qwen2.5-Coder-7B', 'Qwen2.5-Coder-14B', 'Qwen2.5-Coder-32B', 'Qwen2.5-Coder-0.5B-Instruct', 'Qwen2.5-Coder-1.5B-Instruct', 'Qwen2.5-Coder-3B-Instruct', 'Qwen2.5-Coder-7B-Instruct', 'Qwen2.5-Coder-14B-Instruct', 'Qwen2.5-Coder-32B-Instruct', 'Qwen2.5-Math-1.5B', 'Qwen2.5-Math-7B', 'Qwen2.5-Math-72B', 'Qwen2.5-Math-1.5B-Instruct', 'Qwen2.5-Math-7B-Instruct', 'Qwen2.5-Math-72B-Instruct', 'QwQ-32B-Preview-Instruct', 'QwQ-32B-Instruct', 'Qwen3-0.6B-Base', 'Qwen3-1.7B-Base', 'Qwen3-4B-Base', 'Qwen3-8B-Base', 'Qwen3-14B-Base', 'Qwen3-30B-A3B-Base', 'Qwen3-0.6B-Instruct', 'Qwen3-1.7B-Instruct', 'Qwen3-4B-Instruct', 'Qwen3-8B-Instruct', 'Qwen3-14B-Instruct', 'Qwen3-32B-Instruct', 'Qwen3-30B-A3B-Instruct', 'Qwen3-235B-A22B-Instruct', 'Qwen3-0.6B-Instruct-GPTQ-Int8', 'Qwen3-1.7B-Instruct-GPTQ-Int8', 'Qwen3-4B-Instruct-AWQ', 'Qwen3-8B-Instruct-AWQ', 'Qwen3-14B-Instruct-AWQ', 'Qwen3-32B-Instruct-AWQ', 'Qwen3-30B-A3B-Instruct-GPTQ-Int4', 'Qwen3-235B-A22B-Instruct-GPTQ-Int4', 'Qwen2-Audio-7B', 'Qwen2-Audio-7B-Instruct', 'Qwen2.5-Omni-3B', 'Qwen2.5-Omni-7B', 'Qwen2.5-Omni-7B-GPTQ-Int4', 'Qwen2.5-Omni-7B-AWQ', 'Qwen2-VL-2B', 'Qwen2-VL-7B', 'Qwen2-VL-72B', 'Qwen2-VL-2B-Instruct', 'Qwen2-VL-7B-Instruct', 'Qwen2-VL-72B-Instruct', 'Qwen2-VL-2B-Instruct-GPTQ-Int8', 'Qwen2-VL-2B-Instruct-GPTQ-Int4', 'Qwen2-VL-2B-Instruct-AWQ', 'Qwen2-VL-7B-Instruct-GPTQ-Int8', 'Qwen2-VL-7B-Instruct-GPTQ-Int4', 'Qwen2-VL-7B-Instruct-AWQ', 'Qwen2-VL-72B-Instruct-GPTQ-Int8', 'Qwen2-VL-72B-Instruct-GPTQ-Int4', 'Qwen2-VL-72B-Instruct-AWQ', 'QVQ-72B-Preview', 'Qwen2.5-VL-3B-Instruct', 'Qwen2.5-VL-7B-Instruct', 'Qwen2.5-VL-32B-Instruct', 'Qwen2.5-VL-72B-Instruct', 'Qwen2.5-VL-3B-Instruct-AWQ', 'Qwen2.5-VL-7B-Instruct-AWQ', 'Qwen2.5-VL-72B-Instruct-AWQ', 'Seed-Coder-8B-Base', 'Seed-Coder-8B-Instruct', 'Seed-Coder-8B-Instruct-Reasoning', 'Skywork-13B-Base', 'Skywork-o1-Open-Llama-3.1-8B', 'SmolLM-135M', 'SmolLM-360M', 'SmolLM-1.7B', 'SmolLM-135M-Instruct', 'SmolLM-360M-Instruct', 'SmolLM-1.7B-Instruct', 'SmolLM2-135M', 'SmolLM2-360M', 'SmolLM2-1.7B', 'SmolLM2-135M-Instruct', 'SmolLM2-360M-Instruct', 'SmolLM2-1.7B-Instruct', 'SOLAR-10.7B-v1.0', 'SOLAR-10.7B-Instruct-v1.0', 'StarCoder2-3B', 'StarCoder2-7B', 'StarCoder2-15B', 'TeleChat-1B-Chat', 'TeleChat-7B-Chat', 'TeleChat-12B-Chat', 'TeleChat-52B-Chat', 'TeleChat2-3B-Chat', 'TeleChat2-7B-Chat', 'TeleChat2-35B-Chat', 'TeleChat2-115B-Chat', 'Vicuna-v1.5-7B-Chat', 'Vicuna-v1.5-13B-Chat', 'Video-LLaVA-7B-Chat', 'XuanYuan-6B', 'XuanYuan-70B', 'XuanYuan2-70B', 'XuanYuan-6B-Chat', 'XuanYuan-70B-Chat', 'XuanYuan2-70B-Chat', 'XuanYuan-6B-Chat-8bit', 'XuanYuan-6B-Chat-4bit', 'XuanYuan-70B-Chat-8bit', 'XuanYuan-70B-Chat-4bit', 'XuanYuan2-70B-Chat-8bit', 'XuanYuan2-70B-Chat-4bit', 'XVERSE-7B', 'XVERSE-13B', 'XVERSE-65B', 'XVERSE-65B-2', 'XVERSE-7B-Chat', 'XVERSE-13B-Chat', 'XVERSE-65B-Chat', 'XVERSE-MoE-A4.2B', 'XVERSE-7B-Chat-GPTQ-Int8', 'XVERSE-7B-Chat-GPTQ-Int4', 'XVERSE-13B-Chat-GPTQ-Int8', 'XVERSE-13B-Chat-GPTQ-Int4', 'XVERSE-65B-Chat-GPTQ-Int4', 'Yayi-7B', 'Yayi-13B', 'Yi-6B', 'Yi-9B', 'Yi-34B', 'Yi-6B-Chat', 'Yi-34B-Chat', 'Yi-6B-Chat-8bits', 'Yi-6B-Chat-4bits', 'Yi-34B-Chat-8bits', 'Yi-34B-Chat-4bits', 'Yi-1.5-6B', 'Yi-1.5-9B', 'Yi-1.5-34B', 'Yi-1.5-6B-Chat', 'Yi-1.5-9B-Chat', 'Yi-1.5-34B-Chat', 'Yi-Coder-1.5B', 'Yi-Coder-9B', 'Yi-Coder-1.5B-Chat', 'Yi-Coder-9B-Chat', 'Yi-VL-6B-Chat', 'Yi-VL-34B-Chat', 'Yuan2-2B-Chat', 'Yuan2-51B-Chat', 'Yuan2-102B-Chat', 'Zephyr-7B-Alpha-Chat', 'Zephyr-7B-Beta-Chat', 'Zephyr-141B-ORPO-Chat', 'Custom'] Required The input value that is provided in the "parameter_5" Dropdown component.
07-17
<think>好的,我需要帮助用户了解如何在本地使用vLLM工具部署Qwen3-30b-a3b模型的GGUF版本。首先,我应该回顾用户之前的问题和我的回答,确保信息的一致性。用户提到了引用[1]和[2],但看起来这些引用主要关于不同的推理框架和加载PEFT适配器,可能与当前问题关联不大,不过可以注意是否有相关内容可用。 接下来,我需要确认GGUF格式是否被vLLM支持。根据我的知识,vLLM主要支持Hugging Face格式的模型,而GGUF通常是用于llama.cpp的量化格式。因此,可能需要将GGUF转换为vLLM兼容的格式,或者使用其他工具如llama.cpp配合vLLM。如果直接不支持,可能需要用户进行转换或寻找替代方法。 然后,检查vLLM的官方文档是否有相关说明,或者是否有社区解决方案。例如,用户是否需要先将GGUF转换为Hugging Face的格式?或者是否有第三方工具能够桥接这两者? 另外,用户提到Qwen3-30b-a3b模型,需要确认该模型是否有现成的GGUF版本可用。如果没有,可能需要用户自行转换,或者建议使用Hugging Face的原生格式,这样可能更容易部署到vLLM。 如果GGUF格式确实无法直接用于vLLM,可能需要建议用户使用llama.cpp来运行GGUF模型,或者转而使用Hugging Face格式的模型,指导他们如何通过vLLM进行部署。此外,还应考虑环境配置,如安装正确的CUDA版本、Python依赖等。 最后,确保步骤清晰,分点说明,提醒用户注意可能的常见问题,比如模型路径错误、依赖版本冲突等。如果有必要,提供示例命令或代码片段,帮助用户更直观地操作。</think>要在本地使用vLLM部署Qwen3-30b-a3b模型的GGUF版本,需特别注意以下关键点: ### 部署步骤说明 1. **格式兼容性验证** - vLLM目前主要支持Hugging Face格式(PyTorch或Safetensors)[^1] - GGUF格式需通过llama.cpp转换工具转换为Hugging Face格式: ```bash python3 convert-llama-ggml-to-hf.py --input qwen3-30b-a3b.gguf --output qwen-hf --model qwen3-30b-a3b ``` 2. **环境配置** ```bash conda create -n vllm python=3.9 conda activate vllm pip install vllm transformers>=4.40.0 ``` 3. **模型加载示例** ```python from vllm import LLM llm = LLM( model="path/to/converted-qwen-hf", tensor_parallel_size=2, # GPU数量 quantization="awq" # 若使用量化版本 ) ``` 4. **API服务启动** ```bash python -m vllm.entrypoints.openai.api_server \ --model converted-qwen-hf \ --served-model-name qwen3-30b-a3b \ --port 8000 ``` ### 注意事项 - **显存需求**:30B模型至少需要2*24GB显存(使用2块3090/4090显卡) - **量化方案**:推荐使用GPTQ/AWQ量化而非GGUF,可通过AutoGPTQ工具转换 - **混合部署**:GGUF格式可配合llama.cpp+OpenAI API兼容层实现类vLLM服务 ### 性能优化建议 $$ P = \frac{N}{k \cdot T} \quad (N=token总数, k=行数, T=时延) $$ 通过增加tensor_parallel_size参数可提升吞吐量[^1]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值