Image-Text-to-Text
Transformers
Safetensors
qwen3_vl
vision-language
image-classification
calibrated-probabilities
structured-outputs
typed-questions
jev-inspired
qwen3-vl
conversational
Instructions to use MeerDevelopment/Qevi-2B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MeerDevelopment/Qevi-2B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="MeerDevelopment/Qevi-2B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("MeerDevelopment/Qevi-2B") model = AutoModelForMultimodalLM.from_pretrained("MeerDevelopment/Qevi-2B", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MeerDevelopment/Qevi-2B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MeerDevelopment/Qevi-2B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MeerDevelopment/Qevi-2B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/MeerDevelopment/Qevi-2B
- SGLang
How to use MeerDevelopment/Qevi-2B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "MeerDevelopment/Qevi-2B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MeerDevelopment/Qevi-2B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "MeerDevelopment/Qevi-2B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MeerDevelopment/Qevi-2B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use MeerDevelopment/Qevi-2B with Docker Model Runner:
docker model run hf.co/MeerDevelopment/Qevi-2B
Download qevi/__init__.py from MeerDevelopment/Qevi-2B: direct link, hf CLI and curl.
- Browser
- Download file 2.78 kB
-
https://huggingface.co/MeerDevelopment/Qevi-2B/resolve/main/qevi/__init__.py
- Command line
-
hf download hf://MeerDevelopment/Qevi-2B/qevi/__init__.py
-
curl -L -o __init__.py https://huggingface.co/MeerDevelopment/Qevi-2B/resolve/main/qevi/__init__.py
2.78 kB
| """Qevi: answer typed questions about an image in one forward pass, without generating text. | |
| A normal vision-language model answers a question by decoding tokens one at a time, and | |
| re-encodes the image for every question you ask. When the answer is known to be one of a small | |
| fixed set ("Yes"/"No", "A"/"B"/"C"/"D", "Poor"/"Fair"/"Good"), both of those costs are waste. | |
| Qevi instead encodes the image once, packs every question into a single sequence behind a | |
| block-diagonal attention mask that keeps the questions provably isolated from each other, runs | |
| one forward pass, and reads the model's own LM-head logits at the position where it would have | |
| started writing each answer. Softmax over just that question's candidate tokens gives a | |
| calibrated probability. | |
| from transformers import AutoProcessor, Qwen3VLForConditionalGeneration | |
| from qevi import build_readouts, noul_question, forward_logits, softmax | |
| model = Qwen3VLForConditionalGeneration.from_pretrained(MODEL, dtype="bfloat16").cuda() | |
| processor = AutoProcessor.from_pretrained(MODEL) | |
| specs = [(noul_question("There is a ladder in this image."), ["Yes", "No"])] | |
| readouts = build_readouts(processor.tokenizer, specs) | |
| logits = forward_logits(model, processor, image, readouts) | |
| print(softmax(logits[0])) # -> [0.97, 0.03] | |
| Everything here works with a stock Qwen3-VL checkpoint. The fine-tuned weights are simply more | |
| accurate through the same path; no custom architecture and no trust_remote_code is involved. | |
| """ | |
| from .core import ( | |
| Readout, | |
| build_readouts, | |
| forward_logits, | |
| softmax, | |
| unwrap, | |
| wrap_turn, | |
| noul_question, | |
| choice_question, | |
| choice_question_generic, | |
| score_question, | |
| score_question_generic, | |
| NOUL_TEMPLATE, | |
| LETTERS, | |
| PREFIX_PRE, | |
| PREFIX_POST, | |
| ) | |
| from .pack import Question, PackedBatch, Segment, build_packed_batch, permute_questions | |
| __version__ = "0.1.0" | |
| # The fine-tuned weights in MeerDevelopment/Qevi-2B are calibrated as-is: label smoothing during | |
| # training removed the base model's overconfidence, and T=1.0 minimises ECE on both eval splits. | |
| # The older values (noul 2.45, choice 1.9, score 3.0) were fitted against the BASE model and make | |
| # the fine-tune noticeably UNDER-confident; do not apply them to these weights. | |
| DEFAULT_TEMPERATURES = {"noul": 1.0, "choice": 1.0, "score": 1.0} | |
| __all__ = [ | |
| "Readout", "build_readouts", "forward_logits", "softmax", "unwrap", "wrap_turn", | |
| "noul_question", "choice_question", "choice_question_generic", | |
| "score_question", "score_question_generic", | |
| "NOUL_TEMPLATE", "LETTERS", "PREFIX_PRE", "PREFIX_POST", | |
| "Question", "PackedBatch", "Segment", "build_packed_batch", "permute_questions", | |
| "DEFAULT_TEMPERATURES", "__version__", | |
| ] | |