How to use from
Pi
Start the llama.cpp server
# Install llama.cpp:
brew install llama.cpp
# Start a local OpenAI-compatible server:
llama serve -hf prithivMLmods/MedChain-R1-4B-GGUF:
Configure the model in Pi
# Install Pi:
npm install -g @earendil-works/pi-coding-agent
# Add to ~/.pi/agent/models.json:
{
  "providers": {
    "llama-cpp": {
      "baseUrl": "http://localhost:8080/v1",
      "api": "openai-completions",
      "apiKey": "none",
      "models": [
        {
          "id": "prithivMLmods/MedChain-R1-4B-GGUF:"
        }
      ]
    }
  }
}
Run Pi
# Start Pi in your project directory:
pi
Quick Links

MedChain-R1-4B-GGUF

MedChain-R1-4B is the 4B sibling of MedChain-R1-9B, a vision-language model for sequential medical image grounding built on Qwen3.5-4B ("Think Before You Locate"). Given a sequence of medical images and a clinical question, it first writes an image-grounded rationale in <think> tags, then returns one pixel-coordinate bounding box. Training used deliberative chain-of-thought supervision (dCoT-SFT) on the MedChain corpus, then GRPO with an IoU plus format reward. MedChain has 182,573 filtered rationales over the 8 MedSG-Bench tasks and 10 imaging modalities. A medical VLM (FlemingVL-38B) drafts each rationale and a multimodal refiner (Qwen3.5-397B-A17B) rewrites it conditioned on the annotated box. This checkpoint (dCoT-SFT checkpoint-2000 followed by one GRPO pass, seed 42) scores 75.97 mIoU / 83.67 Acc@0.5 on all 9,630 MedSG-Bench test questions. That is slightly above the paper's 4B GRPO row (75.32 / 82.89, from a different checkpoint) and above the supervised state of the art MedSeq-Grounder 7B (72.55 / 79.71). It is below the 9B sibling (77.54 / 84.87), which the card recommends for highest accuracy, while the 4B is pitched at resource-constrained settings. The paper notes the gains vary by task. Against an answer-only 4B model, the reasoning supervision gains 14.7–16.1 mIoU on difference grounding but loses 2.2–3.2 on multi-view, patch and referring grounding, and GRPO adds little after dCoT-SFT. The card says to append its exact instruction to every question, generate one example at a time because batching gave degenerate outputs, and use the bundled processor, since a lower-resolution one costs 3–5 points. The rationales were written knowing the answer, so they may be post-hoc rather than a faithful account of the model's reasoning. It is a research artifact, not validated for diagnosis or clinical use, and is evaluated only on MedSG-Bench. The license is Apache 2.0, and the training data is released as MedChain-R1-data.

MTP β€” Speculative Decoding: No

Model Files

File Name Quant Type File Size File Link Description
MedChain-R1-4B.BF16.gguf BF16 8.42 GB Link Full BF16 weights. Highest quality, largest file size.
MedChain-R1-4B.Q3_K_L.gguf Q3_K_L 2.49 GB Link Lower quality but usable, good for low RAM availability.
MedChain-R1-4B.Q3_K_M.gguf Q3_K_M 2.3 GB Link Low quality.
MedChain-R1-4B.Q4_K_M.gguf Q4_K_M 2.74 GB Link Good quality, default size for most use cases, recommended.
MedChain-R1-4B.Q4_K_S.gguf Q4_K_S 2.57 GB Link Slightly lower quality with more space savings, recommended.
MedChain-R1-4B.Q5_K_M.gguf Q5_K_M 3.09 GB Link High quality, recommended.
MedChain-R1-4B.Q5_K_S.gguf Q5_K_S 2.99 GB Link High quality, recommended.
MedChain-R1-4B.Q6_K.gguf Q6_K 3.46 GB Link Very high quality, near perfect, recommended.
MedChain-R1-4B.mmproj-bf16.gguf mmproj-bf16 676 MB Link Multimodal projection file in BF16 format. Used for vision/language models.

llama.cpp

LLM inference in C/C++ β€” https://github.com/ggml-org/llama.cpp

Quantized using llama.cpp by prithivMLmods.

Downloads last month
236
GGUF
Model size
4B params
Architecture
qwen35
Hardware compatibility
Log In to add your hardware

3-bit

4-bit

5-bit

6-bit

16-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Model tree for prithivMLmods/MedChain-R1-4B-GGUF

Finetuned
Qwen/Qwen3.5-4B
Quantized
(2)
this model

Datasets used to train prithivMLmods/MedChain-R1-4B-GGUF

Collection including prithivMLmods/MedChain-R1-4B-GGUF