news 2026/6/8 13:15:27

qwen 系列模型涉及到的部署、推理

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
qwen 系列模型涉及到的部署、推理

来源 https://qwen.readthedocs.io/en/latest/quantization/awq.html

  • 其中关于智能体部分
importos from qwen_agent.agentsimportAssistant# Define LLMllm_cfg={# Use a custom endpoint compatible with OpenAI API by vLLM/SGLang:'model':'Qwen/Qwen3-32B','model_server':'http://localhost:8000/v1',# api_base'api_key':'EMPTY',# 'generate_cfg': {# # When using vLLM/SGLang OAI API, pass the parameter of whether to enable thinking mode in this way# 'extra_body': {# 'chat_template_kwargs': {'enable_thinking': False}# },## # Add: When the content is `<think>this is the thought</think>this is the answer`# # Do not add: When the response has been separated by reasoning_content and content# # This parameter will affect the parsing strategy of tool call# # 'thought_in_content': True,# },}# llm_cfg = {# # Use the model service provided by DashScope:# 'model': 'qwen3-235b-a22b',# 'model_type': 'qwen_dashscope',## # 'generate_cfg': {# # # When using the Dash Scope API, pass the parameter of whether to enable thinking mode in this way# # 'enable_thinking': False,# # },# }# llm_cfg = {# # Use the OpenAI-compatible model service provided by DashScope:# 'model': 'qwen3-235b-a22b',# 'model_server': 'https://dashscope.aliyuncs.com/compatible-mode/v1',# 'api_key': os.getenv('DASHSCOPE_API_KEY'),## # 'generate_cfg': {# # # When using Dash Scope OAI API, pass the parameter of whether to enable thinking mode in this way# # 'extra_body': {# # 'enable_thinking': False# # },# # },# }# Define Toolstools=[{'mcpServers':{# You can specify the MCP configuration file'time':{'command':'uvx','args':['mcp-server-time','--local-timezone=Asia/Shanghai']},"fetch":{"command":"uvx","args":["mcp-server-fetch"]}}},'code_interpreter',# Built-in tools]# Define Agentbot=Assistant(llm=llm_cfg,function_list=tools)# Streaming generationmessages=[{'role':'user','content':'https://qwenlm.github.io/blog/ Introduce the latest developments of Qwen'}]forresponsesinbot.run(messages=messages): pass print(responses)
版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/6/1 3:28:15

AI Agent规划能力实战:点餐支付售后多任务协同实现,面试官看了都点头!建议收藏

文章探讨了AI Agent的规划能力在多任务协同场景下的工程实现。以美团点餐、支付、售后为例&#xff0c;分析了规划能力的三层结构&#xff1a;意图理解、任务分解和执行协调。提出了分层设计、适中粒度、确定性/不确定性分离和显式失败处理等工程原则。强调Agent应作为"翻…

作者头像 李华
网站建设 2026/6/5 16:58:34

LLM教程 | 第2讲:10分钟上手一个最小可用RAG系统

本文将介绍使用LazyLLM搭建最基础的RAG的流程。首先介绍使用LazyLLM搭建RAG系统的必要环境配置&#xff0c;然后简单回顾RAG的基本流程&#xff0c;接下来分别介绍RAG中文档加载、检索组件、生成组件三个关键部分的参数和基本使用方法&#xff0c;最后利用LazyLLM实现最简单的R…

作者头像 李华
网站建设 2026/5/31 4:15:01

《P3810 【模板】三维偏序 / 陌上花开》

题目背景这是一道模板题&#xff0c;可以使用 bitset&#xff0c;CDQ 分治&#xff0c;树套树&#xff0c;KD-Tree 等方式解决。题目描述有 n 个元素&#xff0c;第 i 个元素有 ai​,bi​,ci​ 三个属性&#xff0c;设 f(i) 表示满足 aj​≤ai​ 且 bj​≤bi​ 且 cj​≤ci​ 且…

作者头像 李华
网站建设 2026/6/1 8:29:30

国标GB28181平台EasyGBS全面支持国密GB35114协议

在安防视频监控领域&#xff0c;“联网互通”和“安全可控”一直是两大核心需求。我们熟知的GB/T 28181协议&#xff0c;解决了不同品牌监控设备“连得上、看得见”的互联互通问题&#xff0c;但在信息安全防护上仍有提升空间。而国密GB35114协议的出现&#xff0c;恰好填补了这…

作者头像 李华