Qwen3-VL-Embedding
Qwen3-VL-Embedding 是 Qwen 基于 Qwen3-VL 构建的嵌入模型。它把图像和文本映射到同一个向量空间,所以一条文本查询能找到它描述的那一页或那张照片。LibreYOLO 在 embed 任务上运行它的 2B 尺寸,这是库里第一个基于 VLM 的嵌入模型。
- 任务
- embeddings
- 尺寸
- 2b at 1024 px
- 安装
pip install "libreyolo[vlm]"- 支持层级
- 兄弟层级,自 v1.8.0 起。一个独立的产品面,有自己的工厂和契约。
- 许可
- 代码采用 Apache-2.0,权重采用 Apache-2.0。商用
安装
Qwen3-VL-Embedding 属于 LibreYOLO 的 VLM 层级,需要 vlm extra。
pip install "libreyolo[vlm]"预测
权重在首次使用时从 LibreYOLO/LibreQwen3VLEmbedding2b 下载,这是
Qwen/Qwen3-VL-Embedding-2B 的镜像,参数未作改动。架构通过 transformers 的
Qwen3-VL 实现运行。
from libreyolo import LibreVLM, SAMPLE_IMAGE model = LibreVLM("qwen3-vl-embedding-2b") # 权重在首次使用时下载result = model.predict(SAMPLE_IMAGE)print(result.embeddings.shape) # (1, 2048),单位长度from libreyolo import LibreVLM model = LibreVLM("qwen3-vl-embedding-2b")pages = model.embed("pages/") # (N, 2048),每张图像一行 # 查询带任务指令;图像保留默认指令q = model.embed_text( ["total due on the invoice"], prompt="Retrieve images or text relevant to the user's query.",) # (1, 2048)scores = q @ pages.T # 余弦相似度这个家族通过 LibreVLM() 或 LibreQwen3VLEmbedding 类加载。它和 CLIP、SigLIP2、
PE 遵循同一套 embed 约定:predict(image) 返回形状为
(1, 2048) 的 Results.embeddings,embed(source) 把每张图像堆叠为一行,
embed_text(texts, prompt=None) 返回同一空间里的文本行。各行都经过 L2 归一化,
所以点积就是余弦相似度。
每个输入都是一段对话:一条系统指令,然后是图像或文本。最后一个 token 处的隐藏
状态经过归一化后就是向量。prompt 就是这条指令。默认值是上游的
"Represent the user's input.";在构造时设置 prompt= 可以同时改掉图像和文本的
指令,也可以在每次调用 embed_text 时传入。做检索时,给查询加上任务指令,文档
保留默认指令。
图像按 32 像素网格缩放到 4,096 到 1,843,200 像素之间,与上游的参考嵌入实现一致。 与该参考实现相比,在 CPU 上以 float32 运行时,文本向量的差异最多为 7.4e-7,图像 向量的余弦相似度至少为 0.99998。
变体
只有一个尺寸,2b。8B 尺寸没有封装。不支持的有:图像加文本的组合输入、视频片段
(视频会逐帧嵌入),以及作为选项的 Matryoshka 截断;请改为取前 k 列再重新归一化。
导出
仅支持推理:chat()、set_classes()、train()、val() 和 export() 会抛出异常。
许可证
请检查你所下载的具体权重在 Hugging Face 仓库中的许可。LibreYOLO 组织里的每个检查点都附有许可,同一家族内也不一定相同。该仓库是权威来源;以下摘要说明本页上次验证时适用的情况。
这里只说明涉及的许可证,不构成法律意见。如果答案对商用很重要,请自行阅读许可证并咨询法律顾问。
- 原始工作
- Qwen3-VL-Embedding, Alibaba (Qwen Team)
- 上游许可
- Apache-2.0
- LibreYOLO 代码
- MIT
- 权重
- 采用 Apache-2.0 许可,重新发布在 huggingface.co/LibreYOLO
- 解读
- Apache-2.0 is a permissive license, so the Qwen3-VL-Embedding-2B weights can be used in commercial and closed-source products. Redistributing them means keeping the license text and attribution notices, and the license grants a patent license. LibreYOLO copies no model source: the Qwen3-VL architecture runs through the Apache-2.0 Hugging Face Transformers implementation, and libreyolo/models/vlm/qwen3vl_embedding.py (MIT) adapts only the input conventions and last-token pooling of the reference embedder in QwenLM/Qwen3-VL-Embedding at commit 393e2978d27852b0d0230d6994f37f9c15bed73c (Apache-2.0, see libreyolo/models/vlm/NOTICE). The weights are a mirrored snapshot of Qwen/Qwen3-VL-Embedding-2B at revision 9f2f7e710d6d81056aa5c0a4f04764fec6bb7bda, hosted at LibreYOLO/LibreQwen3VLEmbedding2b with learned parameters unchanged and not gated; the upstream Hugging Face repository ships no LICENSE file, so the mirror carries the Apache-2.0 text from the GitHub repository.
Qwen3-VL-Embedding-2B 采用 Apache-2.0 许可,出自 阿里巴巴的 Qwen 团队。 允许商用。镜像不需要申请访问;由于上游的 Hugging Face 仓库没有附带 LICENSE 文件, 镜像附上了 GitHub 仓库里的 Apache-2.0 文本。
引用
@article{qwen3vlembedding,
title={Qwen3-VL-Embedding and Qwen3-VL-Reranker: A Unified Framework for State-of-the-Art Multimodal Retrieval and Ranking},
author={Li, Mingxin and Zhang, Yanzhao and Long, Dingkun and Chen, Keqin and Song, Sibo and Bai, Shuai and Yang, Zhibo and Xie, Pengjun and Yang, An and Liu, Dayiheng and Zhou, Jingren and Lin, Junyang},
journal={arXiv},
year={2026}
}复制自作者在 github.com/QwenLM/Qwen3-VL-Embedding#citation 上提供的引用块。