Instructions to use kaushik-harsh-99/Qwen3.5-2B-RAG-Decision with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kaushik-harsh-99/Qwen3.5-2B-RAG-Decision with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="kaushik-harsh-99/Qwen3.5-2B-RAG-Decision") 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("kaushik-harsh-99/Qwen3.5-2B-RAG-Decision") model = AutoModelForMultimodalLM.from_pretrained("kaushik-harsh-99/Qwen3.5-2B-RAG-Decision", 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 kaushik-harsh-99/Qwen3.5-2B-RAG-Decision with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kaushik-harsh-99/Qwen3.5-2B-RAG-Decision" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kaushik-harsh-99/Qwen3.5-2B-RAG-Decision", "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/kaushik-harsh-99/Qwen3.5-2B-RAG-Decision
- SGLang
How to use kaushik-harsh-99/Qwen3.5-2B-RAG-Decision 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 "kaushik-harsh-99/Qwen3.5-2B-RAG-Decision" \ --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": "kaushik-harsh-99/Qwen3.5-2B-RAG-Decision", "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 "kaushik-harsh-99/Qwen3.5-2B-RAG-Decision" \ --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": "kaushik-harsh-99/Qwen3.5-2B-RAG-Decision", "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 kaushik-harsh-99/Qwen3.5-2B-RAG-Decision with Docker Model Runner:
docker model run hf.co/kaushik-harsh-99/Qwen3.5-2B-RAG-Decision
Qwen3.5‑2B RAG Decision
Score how well an answer uses its evidence. Give the model a question, a candidate answer, and the retrieved evidence. Evidence can include text, document pages, and images. The model returns scores between 0 and 1 for up to 28 criteria, including correctness, faithfulness, citation accuracy, and visual grounding.
| 52% less scoring error | 18.5× faster median scoring |
|---|---|
| Compared with base Qwen on shared rubric scores | 0.30 s per example in the Kaggle benchmark |
The model reads the input once and produces rubric scores directly. The inference script applies per-criterion calibration by default and can return raw scores for comparison.
How much did it improve?
| Benchmark measure | Base Qwen3.5‑2B | Raw decision head | Calibrated decision head |
|---|---|---|---|
| Average difference from Gemini on shared scores (lower is better) | 28.26 points | 19.47 points | 13.48 points |
| Shared scores within 15 points of Gemini (higher is better) | 41.8% | 50.5% | 64.7% |
| All target scores within 15 points, counting missing outputs as misses (higher is better) | 29.4% | 51.3% | 66.7% |
The shared-score comparison covers 43,729 rubric scores. The base model returned valid output for 2,206 of 3,000 examples. Median scoring time fell from 5.57 s to 0.30 s per example, excluding model loading and input preparation. The base model generated JSON. The decision head returned scores in one forward pass.
Gemini Decision 1 provided the benchmark reference scores. Agreement measures proximity to that judge. This export merges the LoRA update into the unquantized BF16 base weights. The numbers above are from the original 4-bit-base Kaggle run. The merged export can differ numerically. Benchmark coverage above 16K tokens was insufficient to estimate quality, and OCR error rose after calibration in this run.
Results by criterion
Each bar shows the mean absolute error (MAE) against Gemini Decision 1 for one criterion, in percentage points. Shorter is better. For example, a 10-point MAE means the model’s score differed from Gemini’s by 0.10 on average on that criterion. For each paired comparison, both bars use the same rubric scores. OCR had no comparable base scores, so its bar shows calibrated MAE across the available OCR scores.
| Criterion | Calibrated MAE |
|---|---|
| Answer clarity | 5.6 points |
| OCR accuracy | 8.3 points |
| Answer correctness | 15.4 points |
| Faithfulness | 18.1 points |
See all benchmark metrics and sample counts
Run it
Clone or download this model repository and install its requirements.
pip install -r requirements.txt
python inference.py example_prompt.txt --model . --criterion faithfulness --criterion answer_correctness
python inference.py prompt.txt --model . --image evidence.png --criterion visual_grounding
The prompt should contain the question, retrieved passages, and candidate answer in the same format as the training dataset. Image paths go in evidence order. Repeat --criterion to select specific scores or omit it to return all 28. Use --raw to see scores before calibration.
The root contains the full merged backbone, tokenizer, processor, decision head, and calibration mappings. inference.py loads the head and backbone together. The optional adapter/ folder contains the original LoRA adapter for users who want the training artifacts. metrics.json contains the complete benchmark breakdown.
Training
Trained for one epoch over 60,284 eligible examples with an 8,192-token training budget, rank-16 LoRA, and a 28-criterion head. The training targets came from GPT‑6 Luna, and Gemini Decision 1 supplied the separate calibration and benchmark targets.
- Downloads last month
- -
