Downloads · 30 days
188
11% of all-time downloads
HarshBhanushali7705/medgemma-27b-text-it-GPTQ-4bit
medgemma-27b-text-it-GPTQ-4bit is a text generation model from HarshBhanushali7705. Use it when you need the model to write or continue text. The card lists the license as other.
This repository contains a 4-bit GPTQ quantized version of google/medgemma-27b-text-it, optimized for high-throughput inference using vLLM and the Marlin kernel.
Downloads · 30 days
188
11% of all-time downloads
All-time downloads
1.8K
Public
Parameters
27B
16.2 GB on disk
Likes
4
Public
Click a slice to open those files.
.safetensors16.1 GB · 100%
How the weights are stored.
I3225.6B · 95%
From the Hugging Face model README
This repository contains a 4-bit GPTQ quantized version of google/medgemma-27b-text-it, optimized for high-throughput inference using vLLM and the Marlin kernel.
MedGemma 27B is a text-only, instruction-tuned medical Large Language Model developed by Google and the Health AI Developer Foundation. It is trained on extensive medical datasets to excel in clinical reasoning, medical Q&A, and healthcare text comprehension.
This model was quantized using GPTQModel with the following parameters to ensure maximum compatibility and speed on modern NVIDIA GPUs:
bfloat16 activationsFalse (Specifically optimized for vLLM's Marlin kernels to prevent latency penalties and maximize tokens-per-second)Thanks to 4-bit quantization, the VRAM footprint is drastically reduced compared to the original 16-bit model:
For the best tokens-per-second (TPS) and concurrent request handling, use vLLM.
Note: Gemma 3 architectures strictly require bfloat16 activations to prevent numerical instability. Do not use float16.
Install vLLM:
pip install vllm
Start the OpenAI-compatible API Server:
python -m vllm.entrypoints.openai.api_server \
--model HarshBhanushali7705/medgemma-27b-text-it-GPTQ-4bit \
--served-model-name medgemma-27b-gptq \
--dtype bfloat16 \
--quantization gptq \
--max-model-len 8192 \
--gpu-memory-utilization 0.90 \
--port 8000
Query via Python (OpenAI Client):
from openai import OpenAI
client = OpenAI(
base_url="http://localhost:8000/v1",
api_key="not-needed"
)
response = client.chat.completions.create(
model="medgemma-27b-gptq",
messages=[
{"role": "system", "content": "You are a helpful medical assistant."},
{"role": "user", "content": "What are the diagnostic criteria for systemic lupus erythematosus?"}
],
temperature=0.0,
max_tokens=512
)
print(response.choices[0].message.content)
If you prefer running the model locally in a Python script without a server:
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
model_id = "HarshBhanushali7705/medgemma-27b-text-it-GPTQ-4bit"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
device_map="auto",
torch_dtype=torch.bfloat16
)
messages = [
{"role": "system", "content": "You are a helpful medical assistant."},
{"role": "user", "content": "Explain the pathophysiology of type 2 diabetes mellitus."}
]
inputs = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
return_tensors="pt"
).to(model.device)
outputs = model.generate(inputs, max_new_tokens=256, do_sample=False)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
This model is for research and development purposes only.
bfloat16 weights.This quantized model is built upon the incredible work by Google and the Health AI Developer Foundation.
@misc{medgemma-hf,
author = {Google},
title = {MedGemma Hugging Face},
howpublished = {\url{https://huggingface.co/collections/google/medgemma-release-680aade845f90bec6a3f60c4}},
year = {2025},
note = {Accessed: [Insert Date]}
}
This quantization and vLLM optimization pipeline was created and maintained by:
Harsh Bhanushali
If you find this quantized model useful for your medical AI research or deployment, please consider upvoting the model and citing the original Google MedGemma paper/repository!