Instructions to use scienceverse/bibr-extract-qwen35-2b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use scienceverse/bibr-extract-qwen35-2b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="scienceverse/bibr-extract-qwen35-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("scienceverse/bibr-extract-qwen35-2b") model = AutoModelForMultimodalLM.from_pretrained("scienceverse/bibr-extract-qwen35-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 scienceverse/bibr-extract-qwen35-2b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "scienceverse/bibr-extract-qwen35-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": "scienceverse/bibr-extract-qwen35-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/scienceverse/bibr-extract-qwen35-2b
- SGLang
How to use scienceverse/bibr-extract-qwen35-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 "scienceverse/bibr-extract-qwen35-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": "scienceverse/bibr-extract-qwen35-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 "scienceverse/bibr-extract-qwen35-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": "scienceverse/bibr-extract-qwen35-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 scienceverse/bibr-extract-qwen35-2b with Docker Model Runner:
docker model run hf.co/scienceverse/bibr-extract-qwen35-2b
bibr-extract-qwen35-2b
This is the structured-extraction student model used by bibr. It answers bibr's extraction prompts (statistical equations, reference segmentation, funding / contributions / affiliations, โฆ) in JSON. The model is Qwen/Qwen3.5-2B fine-tuned on answers from a larger teacher model, with the LoRA merged into full bf16 weights.
GGUF builds (Q8_0, Q4_K_M) are in scienceverse/bibr-extract-qwen35-2b-GGUF.
Training
- Base model: Qwen/Qwen3.5-2B (Apache-2.0), revision
15852e8 - Method: LoRA (r=16, alpha=32, dropout 0) on every language-model linear layer (150 modules: attention q/k/v/o, linear-attention in_proj_qkv / in_proj_z / out_proj, MLP gate/up/down). 1 epoch, lr 1e-4, 877 optimizer steps, loss on the assistant answer only.
- Merge: the adapter is merged into the bf16 base weights (W + 2.0ยทBA), bitwise identical to peft
merge_and_unload. The vision tower and the MTP head are unchanged from the base. The MTP head was not trained, so speculative decoding with it may accept fewer tokens. - Training data: 5,299 rows: the same 1,113 Qwen3.8-27B answers to bibr extraction prompts on 181 CC BY PubMed Central papers, plus 4,186 JATS author lists from CC BY / CC0 papers.
Evaluation
These scores come from bibr's extraction harness of 9 Oct 2026 (bibr 9621739, v5 scorer, gate192 + ci60), with the unmerged LoRA served in bf16 on vLLM:
| model | passes / 252 |
|---|---|
| Qwen3.8-27B (teacher) | 223 |
| bibr-extract-qwen35-4b | 216 |
| bibr-extract-qwen35-2b | 207 |
Usage notes
Use the model with thinking off, which is how it was trained and scored. The chat template, unchanged from Qwen3.5-2B, defaults to thinking off. llama-server turns thinking on whenever a template supports it, so run it with --reasoning off or send "chat_template_kwargs": {"enable_thinking": false}.
- Downloads last month
- 27