微信扫码
添加专属顾问
我要投稿
Qwen3-Coder-Flash以30B小参数实现480B级性能,专为高效编码任务优化,支持256K长上下文与Agentic Coding功能。 核心内容: 1. Qwen3-Coder-Flash的核心技术突破与参数配置 2. 在Agentic Coding和长上下文处理上的突出表现 3. 快速开始指南与模型应用场景
Qwen3-Coder-30B-A3B-Instruct发布,官方起名叫Qwen3-Coder-Flash,小参数3B激活同时兼具效果和效率,主要改进如下:
Qwen3-Coder-30B-A3B-Instruct 具备以下特征:
注意:该模型仅支持非思考模式,不会在输出中生成 <think></think> 区块,因此不再需要设置 enable_thinking=False。
如需了解基准评估、硬件需求及推理性能等更多细节,请参阅我们的博客、GitHub 与文档。
建议使用最新版 transformers。
若使用 transformers<4.51.0,将出现以下错误:
下方代码片段演示如何基于给定输入使用模型生成内容。
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "Qwen/Qwen3-Coder-30B-A3B-Instruct"
# 加载 tokenizer 与模型
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto"
)
# 准备模型输入
prompt = "Write a quick sort algorithm."
messages = [
{"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
# 进行文本补全
generated_ids = model.generate(
**model_inputs,
max_new_tokens=65536
)
output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist()
content = tokenizer.decode(output_ids, skip_special_tokens=True)
print("content:", content)
提示:如遇内存不足 (OOM) 问题,可将上下文长度缩小至如 32,768。
本地使用时,Ollama、LMStudio、MLX-LM、llama.cpp 与 KTransformers 均已支持 Qwen3。
Qwen3-Coder 在工具调用方面表现出色。
可如下例所示简单定义或使用任意工具。
# 你的工具实现
def square_the_number(num: float) -> dict:
return num ** 2
# 定义 Tools
tools=[
{
"type":"function",
"function":{
"name": "square_the_number",
"description": "output the square of the number.",
"parameters": {
"type": "object",
"required": ["input_num"],
"properties": {
'input_num': {
'type': 'number',
'description': 'input_num is a number that will be squared'
}
},
}
}
}
]
import OpenAI
# 定义 LLM
client = OpenAI(
# 使用与 OpenAI API 兼容的自定义端点
base_url='http://localhost:8000/v1', # api_base
api_key="EMPTY"
)
messages = [{'role': 'user', 'content': 'square the number 1024'}]
completion = client.chat.completions.create(
messages=messages,
model="Qwen3-Coder-30B-A3B-Instruct",
max_tokens=65536,
tools=tools,
)
print(completion.choice[0])
为获得最佳表现,建议按以下设置:
采样参数:
temperature=0.7、top_p=0.8、top_k=20、repetition_penalty=1.05。充足的输出长度:大多数查询建议使用 65,536 tokens 的输出长度,这对 instruct 模型已足够。
若我们的工作对您有帮助,欢迎引用。
@misc{qwen3technicalreport,
title={Qwen3 Technical Report},
author={Qwen Team},
year={2025},
eprint={2505.09388},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2505.09388},
}53AI,企业落地大模型首选服务商
产品:场景落地咨询+大模型应用平台+行业解决方案
承诺:免费POC验证,效果达标后再合作。零风险落地应用大模型,已交付160+中大型企业
2026-02-04
从“回答者”进化为“研究员”:全面解析 Deep Research
2026-02-04
刚刚,Xcode 史诗级更新:原生集成 Claude Agent SDK,苹果开发直接起飞!
2026-02-04
国产 Cowork 它来了!MCP、Skills和Expert Agents都支持,全部免费体验!
2026-02-04
混元研究博客上线姚顺雨团队最新成果:从 Context 探索语言模型的范式转变
2026-02-04
通俗讲解大模型短期记忆 vs 长期记忆
2026-02-04
谁动了我的电脑?谁应该抱怨?
2026-02-03
从 CLI 到桌面:Codex 把 coding agent 变成“任务指挥台”
2026-02-03
谷歌重大更新:国内手动开启 Gemini AI 侧边栏与 Auto Browse 自动浏览全攻略
2026-01-24
2026-01-10
2025-11-19
2025-11-13
2026-01-26
2026-01-01
2025-12-09
2025-11-12
2026-01-09
2025-12-21
2026-02-04
2026-02-03
2026-02-03
2026-02-02
2026-02-02
2026-02-02
2026-01-31
2026-01-30