Instructions to use SandLogicTechnologies/MedGemma-4B-IT-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use SandLogicTechnologies/MedGemma-4B-IT-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="SandLogicTechnologies/MedGemma-4B-IT-GGUF", filename="medgemma-4b-it-Q5_K_M.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use SandLogicTechnologies/MedGemma-4B-IT-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf SandLogicTechnologies/MedGemma-4B-IT-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf SandLogicTechnologies/MedGemma-4B-IT-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf SandLogicTechnologies/MedGemma-4B-IT-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf SandLogicTechnologies/MedGemma-4B-IT-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf SandLogicTechnologies/MedGemma-4B-IT-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf SandLogicTechnologies/MedGemma-4B-IT-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf SandLogicTechnologies/MedGemma-4B-IT-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf SandLogicTechnologies/MedGemma-4B-IT-GGUF:Q4_K_M
Use Docker
docker model run hf.co/SandLogicTechnologies/MedGemma-4B-IT-GGUF:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use SandLogicTechnologies/MedGemma-4B-IT-GGUF with Ollama:
ollama run hf.co/SandLogicTechnologies/MedGemma-4B-IT-GGUF:Q4_K_M
- Unsloth Studio new
How to use SandLogicTechnologies/MedGemma-4B-IT-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for SandLogicTechnologies/MedGemma-4B-IT-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for SandLogicTechnologies/MedGemma-4B-IT-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for SandLogicTechnologies/MedGemma-4B-IT-GGUF to start chatting
- Docker Model Runner
How to use SandLogicTechnologies/MedGemma-4B-IT-GGUF with Docker Model Runner:
docker model run hf.co/SandLogicTechnologies/MedGemma-4B-IT-GGUF:Q4_K_M
- Lemonade
How to use SandLogicTechnologies/MedGemma-4B-IT-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull SandLogicTechnologies/MedGemma-4B-IT-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.MedGemma-4B-IT-GGUF-Q4_K_M
List all available models
lemonade list
Quantized MedGemma-4B-IT Models
This repository provides quantized GGUF versions of the google/medgemma-4b-it model. These 4-bit and 5-bit quantized variants retain the original model’s strengths in multimodal medical reasoning, while reducing memory and compute requirements—ideal for efficient inference on resource-constrained devices.
Model Overview
- Original Model: google/medgemma-4b-it
- Quantized Versions:
- Q4_K_M (4-bit quantization)
- Q5_K_M (5-bit quantization)
- Architecture: Decoder-only transformer with SigLIP vision encoder
- Base Model: google/gemma-3-4b-pt
- Modalities: Text + Image (Multimodal)
- Developer: Google
- License: Health AI Developer Foundations License
- Language: English (medical domain)
Quantization Details
Q4_K_M Version
- Approx. ~75% size reduction
- Lower memory footprint (~2.3 GB)
- Best suited for deployment on edge devices or low-resource GPUs
- Slight performance degradation in complex reasoning scenarios
Q5_K_M Version
- Approx. ~69% size reduction
- Higher fidelity (~2.6 GB)
- Better performance retention, recommended when quality is a priority
Key Features
- Expert-level medical image understanding and report generation
- Strong performance on radiology, dermatology, pathology, and ophthalmology benchmarks
- Multimodal instruction following and clinical question answering
- Pretrained with SigLIP vision encoder + medical text encoder
Usage
Below, there are some code snippets on how to get quickly started with running the model. llama.cpp (text-only)
./llama-cli -hf SandLogicTechnologies/MedGemma-4B-IT-GGUF -p "What are the symptoms of diabetes"
llama.cpp (image input)
./llama-gemma3-cli -hf SandLogicTechnologies/MedGemma-4B-IT-GGUF -p "Describe this image." --image ~/Downloads/xray_image.png
Model Data
Dataset Overview
The original MedGemma-4B-IT model is built on top of the Gemma architecture and trained with a strong focus on medical multimodal data:
Image Encoder: A SigLIP-based vision model pre-trained on de-identified medical images, including:
- Chest X-rays
- Dermatology images
- Ophthalmology fundus photos
- Histopathology slides
LLM Component: Trained on diverse medical text datasets related to the above imaging domains, including clinical reports, QA datasets, and biomedical literature.
This combination enables MedGemma to perform visual-text reasoning and clinical instruction following in healthcare applications.
Recommended Use Cases
These quantized models are optimized for efficient inference while preserving core MedGemma capabilities. Suggested use cases include:
Medical visual question answering (VQA)
Analyze and interpret chest X-rays, skin lesions, fundus images, etc.Chatbot and assistant prototypes
Build interactive healthcare chat systems with vision-language capabilities.Research & fine-tuning
Serve as a lightweight base for further task-specific tuning in healthcare AI.Low-resource deployment
Run multimodal reasoning models on CPUs, edge devices, and lightweight GPUs.Rapid prototyping
Ideal for experimentation, prototyping, and integration in clinical R&D.
⚠️ Note: These models are not intended for direct clinical use without appropriate validation.
Acknowledgments
These quantized models are based on the original work by Google and the MedGemma development team.
Special thanks to:
- The Google DeepMind team for developing and releasing the MedGemma-4B-IT model.
- Georgi Gerganov and the entire
llama.cppopen-source community for enabling efficient model quantization and inference via the GGUF format.
Contact
For any inquiries or support, please contact us at support@sandlogic.com or visit our Website.
- Downloads last month
- 109
4-bit
5-bit