alt.freeweights.qwen / Qwen2-VL-2B-Instruct
From: onnx-community <huggingface.co/onnx-community>Newsgroups: alt.freeweights.qwenSubject:

Qwen2-VL-2B-Instruct

Date: 2026-11-15Commit: 6855b96Signed: 2DC28CC7B26A283B ✓

Image text to text model. Onnx weights, 33.7 GB in all. Published by onnx-community under Apache-2.0.

qwen33.7GBQwen2-VL-2B-Instructonnxpermissive
FactsParamsnot statedSize33.7 GBFormatsonnxTaskimage text to textLicenseApache-2.0From sourcepermissive
$ fw get onnx-community/Qwen2-VL-2B-Instruct
# manifest sha256 101e3c38e5f6… · 33.7 GB · 40 files
$ fw verify ./Qwen2-VL-2B-Instruct onnx-community/Qwen2-VL-2B-Instruct
From sourceHosted (signed)onnx-community/Qwen2-VL-2B-InstructLast check: 2026-11-15 05:05 UTC

Get help: custom fine-tune or private deploy. We review your setup before we quote.

Quantized of Qwen2-VL-2B-Instruct.

Works with

Runs with

Ranked by fit to this model (onnx), then by GitHub stars.

Convert with

Overview

Size
33.7 GB
Weights
233 MB (smallest of 24 ONNX variants)
Parameters
not stated
Formats
onnx
Task
image text to text
License
Apache-2.0 (permissive)
Files
40, each with a sha256
Publisher
onnx-community
Added
2026-11-15
Section
alt.freeweights.qwen
Lineage

Original release from the publisher.

Base model: Qwen/Qwen2-VL-2B-Instruct

Where these bytes come from
Publisher at the pinned commit→You

Sources are tried in order. A file counts only when its size and sha256 match the manifest. Sources are checked when you ask for them, not on a timer.

Sources
BadgeHostLast checkResult
From sourcehuggingface.co2026-11-15 05:05 UTCpassed

Model card

From the publisher at commit 6855b96. Shown as plain text with links; images open at the publisher.

https://huggingface.co/Qwen/Qwen2-VL-2B-Instruct with ONNX weights to be compatible with Transformers.js.

Usage (Transformers.js)#

If you haven't already, you can install the Transformers.js JavaScript library from NPM using:

npm i @huggingface/transformers

Example: Image+text to text

import { AutoProcessor, Qwen2VLForConditionalGeneration, RawImage } from "@huggingface/transformers";

// Load processor and model
const model_id = "onnx-community/Qwen2-VL-2B-Instruct";
const processor = await AutoProcessor.from_pretrained(model_id);
const model = await Qwen2VLForConditionalGeneration.from_pretrained(model_id);

// Prepare inputs
const url = "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg";
const image = await (await RawImage.read(url)).resize(448, 448);
const conversation = [
  {
    role: "user",
    content: [
      { type: "image" },
      { type: "text", text: "Describe this image." },
    ],
  },
];
const text = processor.apply_chat_template(conversation, { add_generation_prompt: true });
const inputs = await processor(text, image);

// Perform inference
const outputs = await model.generate({
  ...inputs,
  max_new_tokens: 128,
});

// Decode output
const decoded = processor.batch_decode(
  outputs.slice(null, [inputs.input_ids.dims.at(-1), null]),
  { skip_special_tokens: true },
);
console.log(decoded[0]);
// The image depicts a serene beach scene with a woman and a dog. The woman is sitting on the sand, wearing a plaid shirt, and appears to be engaged in a playful interaction with the dog. The dog, which is a large breed, is sitting on its hind legs and appears to be reaching out to the woman, possibly to give her a high-five or a paw. The background shows the ocean with gentle waves, and the sky is clear, suggesting it might be either sunrise or sunset. The overall atmosphere is calm and relaxed, capturing a moment of connection between the woman and the dog.

ONNX conversion script:#

First, install the following dependencies:

pip install --upgrade git+https://github.com/huggingface/transformers.git onnx==1.17.0 onnxruntime==1.20.1 optimum==1.23.3 onnxslim==0.1.42
import os
import torch
from transformers import (
    AutoProcessor,
    Qwen2VLForConditionalGeneration,
    DynamicCache,
)


class PatchedQwen2VLForConditionalGeneration(Qwen2VLForConditionalGeneration):
    def forward(self, *args):
        inputs_embeds, attention_mask, position_ids, *past_key_values_args = args

        # Convert past_key_values list to DynamicCache
        if len(past_key_values_args) == 0:
            past_key_values = None
        else:
            past_key_values = DynamicCache(self.config.num_hidden_layers)
            for i in range(self.config.num_hidden_layers):
                key = past_key_values_args.pop(0)
                value = past_key_values_args.pop(0)
                past_key_values.update(key_states=key, value_states=value, layer_idx=i)

        o = super().forward(
            inputs_embeds=inputs_embeds,
            attention_mask=attention_mask,
            position_ids=position_ids,
            past_key_values=past_key_values,
        )

        flattened_past_key_values_outputs = {
            "logits": o.logits,
        }
        output_past_key_values: DynamicCache = o.past_key_values
        for i, (key, value) in enumerate(
            zip(output_past_key_values.key_cache, output_past_key_values.value_cache)
        ):
            flattened_past_key_values_outputs[f"present.{i}.key"] = key
            flattened_past_key_values_outputs[f"present.{i}.value"] = value

        return flattened_past_key_values_outputs


# Constants
OUTPUT_FOLDER = "output"
EMBEDDING_MODEL_NAME = "embed_tokens.onnx"
TEXT_MODEL_NAME = "decoder_model_merged.onnx"
VISION_MODEL_NAME = "vision_encoder.onnx"
TEMP_MODEL_OUTPUT_FOLDER = os.path.join(OUTPUT_FOLDER, "temp")
FINAL_MODEL_OUTPUT_FOLDER = os.path.join(OUTPUT_FOLDER, "onnx")


# Load model and processor
model_id = "Qwen/Qwen2-VL-2B-Instruct"
model = PatchedQwen2VLForConditionalGeneration.from_pretrained(model_id).eval()
processor = AutoProcessor.from_pretrained(model_id)


# Save model configs and processor
model.config.save_pretrained(OUTPUT_FOLDER)
model.generation_config.save_pretrained(OUTPUT_FOLDER)
processor.save_pretrained(OUTPUT_FOLDER)
os.makedirs(TEMP_MODEL_OUTPUT_FOLDER, exist_ok=True)


# Configuration values
## Text model
text_config = model.config
num_heads = text_config.num_attention_heads
num_key_value_heads = text_config.num_key_value_heads
head_dim = text_config.hidden_size // num_heads
num_layers = text_config.num_hidden_layers
hidden_size = text_config.hidden_size

## Vision model
vision_config = model.config.vision_config
channel = vision_config.in_chans
temporal_patch_size = vision_config.temporal_patch_size
patch_size = vision_config.spatial_patch_size


# Dummy input sizes
grid_t, grid_h, grid_w = [1, 16, 16]
batch_size = 1
sequence_length = 16
num_channels = 3
past_sequence_length = 0

image_batch_size = 1  # TODO: Add support for > 1 images
assert image_batch_size == 1


# Dummy inputs
## Embedding inputs
input_ids = torch.randint(
    0, model.config.vocab_size, (batch_size, sequence_length), dtype=torch.int64
)

## Text inputs
dummy_past_key_values_kwargs = {
    f"past_key_values.{i}.{key}": torch.zeros(
        batch_size,
        num_key_value_heads,
        past_sequence_length,
        head_dim,
        dtype=torch.float32,
    )
    for i in range(num_layers)
    for key in ["key", "value"]
}
inputs_embeds = torch.ones(
    batch_size, sequence_length, hidden_size, dtype=torch.float32
)
attention_mask = torch.ones(batch_size, sequence_length, dtype=torch.int64)
position_ids = torch.ones(3, batch_size, sequence_length, dtype=torch.int64)

## Vision inputs
grid_thw = torch.tensor(
    [[grid_t, grid_h, grid_w]] * image_batch_size, dtype=torch.int64
)
pixel_values = torch.randn(
    image_batch_size * grid_t * grid_h * grid_w,
    channel * temporal_patch_size * patch_size * patch_size,
    dtype=torch.float32,
)


# ONNX Exports
## Embedding model
embedding_inputs = dict(input_ids=input_ids)
embedding_inputs_positional = tuple(embedding_inputs.values())
model.model.embed_tokens(*embedding_inputs_positional)  # Test forward pass
EMBED_TOKENS_OUTPUT_PATH = os.path.join(TEMP_MODEL_OUTPUT_FOLDER, EMBEDDING_MODEL_NAME)
torch.onnx.export(
    model.model.embed_tokens,
    args=embedding_inputs_positional,
    f=EMBED_TOKENS_OUTPUT_PATH,
    export_params=True,
    opset_version=14,
    do_constant_folding=True,
    input_names=list(embedding_inputs.keys()),
    output_names=["inputs_embeds"],
    dynamic_axes={
        "input_ids": {0: "batch_size", 1: "sequence_length"},
        "inputs_embeds": {0: "batch_size", 1: "sequence_length"},
    },
)

## Text model
text_inputs = dict(
    inputs_embeds=inputs_embeds,
    attention_mask=attention_mask,
    position_ids=position_ids,
    **dummy_past_key_values_kwargs,
)
text_inputs_positional = tuple(text_inputs.values())
text_outputs = model.forward(*text_inputs_positional)  # Test forward pass
TEXT_MODEL_OUTPUT_PATH=os.path.join(TEMP_MODEL_OUTPUT_FOLDER, TEXT_MODEL_NAME)
torch.onnx.export(
    model,
    args=text_inputs_positional,
    f=TEXT_MODEL_OUTPUT_PATH,
    export_params=True,
    opset_version=14,
    do_constant_folding=True,
    input_names=list(text_inputs.keys()),
    output_names=["logits"]
    + [f"present.{i}.{key}" for i in range(num_layers) for key in ["key", "value"]],
    dynamic_axes={
        "inputs_embeds": {0: "batch_size", 1: "sequence_length"},
        "attention_mask": {0: "batch_size", 1: "sequence_length"},
        "position_ids": {1: "batch_size", 2: "sequence_length"},
        **{
            f"past_key_values.{i}.{key}": {0: "batch_size", 2: "past_sequence_length"}
            for i in range(num_layers)
            for key in ["key", "value"]
        },
        "logits": {0: "batch_size", 1: "sequence_length"},
        **{
            f"present.{i}.{key}": {0: "batch_size", 2: "past_sequence_length + 1"}
            for i in range(num_layers)
            for key in ["key", "value"]
        },
    },
)

## Vision model
vision_inputs = dict(
    pixel_values=pixel_values,
    grid_thw=grid_thw,
)
vision_inputs_positional = tuple(vision_inputs.values())
vision_outputs = model.visual.forward(*vision_inputs_positional)  # Test forward pass
VISION_ENCODER_OUTPUT_PATH = os.path.join(TEMP_MODEL_OUTPUT_FOLDER, VISION_MODEL_NAME)
torch.onnx.export(
    model.visual,
    args=vision_inputs_positional,
    f=VISION_ENCODER_OUTPUT_PATH,
    export_params=True,
    opset_version=14,
    do_constant_folding=True,
    input_names=list(vision_inputs.keys()),
    output_names=["image_features"],
    dynamic_axes={
        "pixel_values": {
            0: "batch_size * grid_t * grid_h * grid_w",
            1: "channel * temporal_patch_size * patch_size * patch_size",
        },
        "grid_thw": {0: "batch_size"},
        "image_features": {0: "batch_size * grid_t * grid_h * grid_w"},
    },
)


# Post-processing
import onnx
import onnxslim
from optimum.onnx.graph_transformations import check_and_save_model

os.makedirs(FINAL_MODEL_OUTPUT_FOLDER, exist_ok=True)
for name in (EMBEDDING_MODEL_NAME, TEXT_MODEL_NAME, VISION_MODEL_NAME):
    temp_model_path = os.path.join(TEMP_MODEL_OUTPUT_FOLDER, name)
    
    ## Shape inference (especially needed by the vision encoder)
    onnx.shape_inference.infer_shapes_path(temp_model_path, check_type=True, strict_mode=True)
    
    ## Attempt to optimize the model with onnxslim
    try:
        model = onnxslim.slim(temp_model_path)
    except Exception as e:
        print(f"Failed to slim {model}: {e}")
        model = onnx.load(temp_model_path)

    ## Save model
    final_model_path = os.path.join(FINAL_MODEL_OUTPUT_FOLDER, name)
    check_and_save_model(model, final_model_path)

## Cleanup
import shutil
shutil.rmtree(TEMP_MODEL_OUTPUT_FOLDER)

Files

40 files · 33.7 GBWeights 233 MB (smallest of 24 ONNX variants). Sizes and sha256 from the signed manifest.
Show all 40 files with their sha256
FileSizesha256
.gitattributes1.93 KB0cd6622969d48d47fcbd9bf70b6113b1166976d9919f2e211afa14ed49e40ffa
README.md10.2 KB3fb745812f7f4e92f2429a18cb806bbada30e4f8eb20249b5b16224969f6e39a
added_tokens.json392 B7fa54985b58718a8fdb4f4d97484c4bd908db114847675e4bf3afe3e1d5d7bd4
chat_template.json1.05 KB94174d7176c52a7192f96fc34eb2cf23c7c2059d63cdbfadca1586ba89731fb7
config.json1.57 KB5ba415da6bb9d06c33507bc48a14d8297b66432f66504a7a32738ae8fba8d45d
generation_config.json215 B2dd60cc6ae1c12e9ee3b77d792dd4a424e818d03b9ef678960860b4b31a6dc55
merges.txt1.67 MB8831e4f1a044471340f7c0a83d7bd71306a5b867e95fd870f74d0c5308a904d5
onnx/decoder_model_merged.onnx813 KBcfb545b801fe12aadf63e6fea2672118953a9ea4a6f93f3f54ef5a5abf640536
onnx/decoder_model_merged.onnx_data6.17 GBe6192eca60b017bd1065578fcd5ef536557a2ae197196101bbd4844dd55b551c
onnx/decoder_model_merged_bnb4.onnx870 MB4f2cf55550007bed1c5453270ea5fc236bddbbc22ca7ba1e7772b514372d508b
onnx/decoder_model_merged_fp16.onnx854 KB63a6d8aaadbd997dd1a3bcb047814e2e11106ace5bd05463e34341e18625261e
onnx/decoder_model_merged_fp16.onnx_data3.09 GB4dea38e3e9305ad4b63db905f2d55b64fd201a8178a27495d406188a6c437139
onnx/decoder_model_merged_int8.onnx1.55 GB1c747059a7294565f59dc6c6852af398477c53eaabf8c605a313d21e71f90cdf
onnx/decoder_model_merged_q4.onnx966 MBd5492bb8064c31f61c48106b3cb140f1a81f9123205f52234329e1119f348eae
onnx/decoder_model_merged_q4f16.onnx869 MB3cbf3e285eb58d975fef96da82faee0277416b5c7c3342718f0fcc0330b27033
onnx/decoder_model_merged_quantized.onnx1.55 GB1c747059a7294565f59dc6c6852af398477c53eaabf8c605a313d21e71f90cdf
onnx/decoder_model_merged_uint8.onnx1.55 GB853451575e3be3bfe1a0506e6b2b858853f1ab1d974bed48d11fc7868b06138a
onnx/embed_tokens.onnx933 MB152d4247d40033d1b6f23ba4b25674850fbaf1b10d259f74da69b31944114cd6
onnx/embed_tokens_bnb4.onnx933 MB88541f1b9947f617d4c1d5cea78ab8cb26574f74db5a7d64d7a9db22099aaa30
onnx/embed_tokens_fp16.onnx467 MBa717f0d2010b07f99b1982b5407f4c55143ca9ec45cb574b3ba272211024c661
onnx/embed_tokens_int8.onnx233 MB3b0c7a8061d5a116be58f9c58637a85e0b87795426dec299c66af21a9ff77a6f
onnx/embed_tokens_q4.onnx933 MB88541f1b9947f617d4c1d5cea78ab8cb26574f74db5a7d64d7a9db22099aaa30
onnx/embed_tokens_q4f16.onnx467 MB1697b2fd5563f22684826e9d6c5c24f2a8da74caa44b123b51f7eab10af1a851
onnx/embed_tokens_quantized.onnx233 MB3b0c7a8061d5a116be58f9c58637a85e0b87795426dec299c66af21a9ff77a6f
onnx/embed_tokens_uint8.onnx233 MB3b0c7a8061d5a116be58f9c58637a85e0b87795426dec299c66af21a9ff77a6f
onnx/vision_encoder.onnx1.68 MBb40135a66ba4b497b7b41252cc48abcfce280897d36545ac8c1e843f9d41f85a
onnx/vision_encoder.onnx_data2.66 GB227108e08c1582c51e33feeda4b209e5d2d3de0f6c0831903eb253b30f687579
onnx/vision_encoder_bnb4.onnx1.69 MB127fbadc1e1c9791b3956acff50616a34dd5e96e060dedb410076f2a82afa5f9
onnx/vision_encoder_bnb4.onnx_data2.66 GB227108e08c1582c51e33feeda4b209e5d2d3de0f6c0831903eb253b30f687579
onnx/vision_encoder_fp16.onnx1.33 GB88e122803ce5413a4f3326b1844aa24cdeb05185e26f1f4713ce9cfd6f246774
onnx/vision_encoder_int8.onnx669 MBe6b0b7f0b5e3d47513833d4712d2279c0618d90a168f9badb691e5702ca9b5a3
onnx/vision_encoder_q4.onnx1.68 MB60dd8f69b8f116f27c887bb489314ea56129063e21de847814da4ac82bf6c43e
onnx/vision_encoder_q4.onnx_data2.66 GB227108e08c1582c51e33feeda4b209e5d2d3de0f6c0831903eb253b30f687579
onnx/vision_encoder_q4f16.onnx1.33 GB0e73fde2311c64e99a0c29523fe1eb76f7ecec7f0f60248cf74a4b50dd9b6207
onnx/vision_encoder_quantized.onnx669 MBb4342d44573e3dfad730a289636bc2ebcd42bafa66d6e81afcbd136ede3e535f
onnx/vision_encoder_uint8.onnx669 MBb4342d44573e3dfad730a289636bc2ebcd42bafa66d6e81afcbd136ede3e535f
preprocessor_config.json567 B8885ee26f126992101959631b5bc8cd2767da5cdae05a89f2989426e5dab0069
tokenizer.json11.4 MB091aa7594dc2fcfbfa06b9e3c22a5f0562ac14f30375c13af7309407a0e67b8a
tokenizer_config.json4.30 KBeb3c5a310899d7d65feec0dee4dff9067d7bc4ad2a17e2005bc9163f1ace0531
vocab.json2.78 MBca10d7e9fb3ed18575dd1e277a2579c16d108e32f27439684afa0e10b1440910
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
6855b966ca pinned now2026-11-15 05:05 UTC40 files · 33.7 GB

Use it

$ fw get onnx-community/Qwen2-VL-2B-Instruct
# manifest sha256 101e3c38e5f6… · 33.7 GB · 40 files
$ fw verify ./Qwen2-VL-2B-Instruct onnx-community/Qwen2-VL-2B-Instruct
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/onnx-community/Qwen2-VL-2B-Instruct.json --dir ./Qwen2-VL-2B-Instruct $ python3 fw.py verify ./Qwen2-VL-2B-Instruct ./onnx-community__Qwen2-VL-2B-Instruct.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download onnx-community/Qwen2-VL-2B-Instruct --revision 6855b966cae21877107daa61dc609f0f2d696151 --local-dir ./Qwen2-VL-2B-Instruct

License

Name
Apache License 2.0
Id
Apache-2.0
Class
Permissive
Redistribution
yes
Listing
Hosted (signed)
Decided
License as declared by the publisher. No person read it. 2026-11-15
Text in
README.md
Text sha256
3fb745812f7f4e92f2429a18cb806bbada30e4f8eb20249b5b16224969f6e39a
Terms gate
No extra terms beyond the license.

Read the license text

Licenses are checked against the license table. A custom license passes only after a person reads it.

Provenance

From: onnx-community <huggingface.co/onnx-community>Newsgroups: alt.freeweights.qwenSubject: Qwen2-VL-2B-InstructDate: 2026-11-15Commit: 6855b96Signed: 2DC28CC7B26A283B ✓
Upstream
onnx-community/Qwen2-VL-2B-Instruct
Pinned commit
6855b966cae21877107daa61dc609f0f2d696151
Manifest
Qwen2-VL-2B-Instruct.json · .minisig
Manifest sha256
101e3c38e5f6c381c473d7ac7d49ac41ebc9244c048a709e5c66d536301589af
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-15 05:05 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/onnx-community/Qwen2-VL-2B-Instruct.json $ curl -O https://freeweights.allternit.com/manifests/onnx-community/Qwen2-VL-2B-Instruct.json.minisig $ minisign -Vm Qwen2-VL-2B-Instruct.json -P RWQ7KGqyx4zCLXtUFOqvfv8L3g+8fpKJ1FsuxPyOYMF+4KufbUxKq1Oq $ shasum -a 256 <file> # compare with the Files tab

A manifest whose signature fails must be rejected. A file whose size or sha256 does not match must be discarded. Verify a download

Model tree

Parent

Qwen/Qwen2-VL-2B-Instruct · this model is a quantization of it

No model in the catalog names this one as its parent.

Get it
Download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download onnx-community/Qwen2-VL-2B-Instruct
Open in Freeweights Studio

Pull, verify and run it in the Allternit app on Desktop, web or phone.

Signed manifest
minisign, key 2DC28CC7B26A283B. Qwen2-VL-2B-Instruct.json. Provenance. Takedown history: none.
From: BAAI <huggingface.co/BAAI>Subject: Aquila-VL-2B-llava-qwen
From: Perciqa <huggingface.co/Perciqa>Subject: Aurora-Code-1
From: BAAI <huggingface.co/BAAI>Subject: bge-reasoner-embed-qwen3-8b-0923
From: amazon <huggingface.co/amazon>Subject: BMOJOF-primed-HQwen3-8B-Instruct
From: nbeerbower <huggingface.co/nbeerbower>Subject: Bubba-Qwen3.6-27B-LoRA
From: bartowski <huggingface.co/bartowski>Subject: bytkim_Qwen3.8-27B-pi-GGUF