Instructions to use wredd/medgemma-4b-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use wredd/medgemma-4b-gguf with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="wredd/medgemma-4b-gguf", filename="medgemma-4b-iq1_m.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use wredd/medgemma-4b-gguf with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf wredd/medgemma-4b-gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf wredd/medgemma-4b-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 wredd/medgemma-4b-gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf wredd/medgemma-4b-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 wredd/medgemma-4b-gguf:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf wredd/medgemma-4b-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 wredd/medgemma-4b-gguf:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf wredd/medgemma-4b-gguf:Q4_K_M
Use Docker
docker model run hf.co/wredd/medgemma-4b-gguf:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use wredd/medgemma-4b-gguf with Ollama:
ollama run hf.co/wredd/medgemma-4b-gguf:Q4_K_M
- Unsloth Studio
How to use wredd/medgemma-4b-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 wredd/medgemma-4b-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 wredd/medgemma-4b-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for wredd/medgemma-4b-gguf to start chatting
- Atomic Chat new
- Docker Model Runner
How to use wredd/medgemma-4b-gguf with Docker Model Runner:
docker model run hf.co/wredd/medgemma-4b-gguf:Q4_K_M
- Lemonade
How to use wredd/medgemma-4b-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull wredd/medgemma-4b-gguf:Q4_K_M
Run and chat with the model
lemonade run user.medgemma-4b-gguf-Q4_K_M
List all available models
lemonade list
llm.create_chat_completion(
messages = "No input example has been defined for this model task."
)MedGemma 4B GGUF - Quantized for African Healthcare
Quantized versions of google/medgemma-1.5-4b-it optimized for on-device medical AI in resource-constrained settings.
Available Models
| File | Quantization | Size | RAM | MedQA (vs Unquantized) | Use Case |
|---|---|---|---|---|---|
medgemma-4b-iq2_xs.gguf |
IQ2_XS (2-bit) + Medical imatrix | ~0.85GB | ~1.9GB | 43.8% (63% retained) | Ultra-budget phones |
medgemma-4b-q2_k.gguf |
Q2_K (2-bit) | ~1.3GB | ~2.3GB | 34.7% (50% retained) | Budget phones |
medgemma-4b-q4_k_m.gguf |
Q4_K_M (4-bit) | ~2.3GB | ~3GB | 56.0% (81% retained) | Budget phones |
Medical Importance Matrix
The IQ2_XS model was quantized using a custom importance matrix (imatrix) calibrated on:
- African primary care scenarios (malaria, typhoid, cholera, respiratory infections)
- Maternal and child health (pregnancy complications, childhood diarrhea, nutrition)
- Emergency triage (snake bites, severe dehydration, trauma)
- Multi-language symptoms (Twi, Hausa, Yoruba, English)
This preserves medical diagnostic accuracy while aggressively compressing general knowledge.
Usage with llama.cpp
./llama-cli -m medgemma-4b-iq2_xs.gguf -p "Patient has fever, chills, and headache for 3 days. What could this be?"
License
Subject to Gemma Terms of Use.
Part of the Nku Project
Built for the Google MedGemma Impact Challenge - bringing AI-powered healthcare to underserved African communities.
- Downloads last month
- 57
1-bit
2-bit
4-bit
Model tree for wredd/medgemma-4b-gguf
Base model
google/medgemma-1.5-4b-it
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="wredd/medgemma-4b-gguf", filename="", )