---
base_model: google/medgemma-4b-it
inference: false
library_name: transformers
license: other
license_name: health-ai-developer-foundations
license_link: https://developers.google.com/health-ai-developer-foundations/terms
model_creator: Google
model_name: medgemma-4b-it
quantized_by: Second State Inc.
pipeline_tag: image-text-to-text
tags:
- medical
- radiology
- clinical-reasoning
- dermatology
- pathology
- ophthalmology
- chest-x-ray
---
# medgemma-4b-it-GGUF
## Original Model
[google/medgemma-4b-it](https://huggingface.co/google/medgemma-4b-it)
## Run with LlamaEdge
- LlamaEdge version: [v0.18.5](https://github.com/LlamaEdge/LlamaEdge/releases/tag/0.18.5) and above
- Prompt template
- Prompt type: `gemma-3`
- Prompt string
```text
user
{user_message}
model
{model_message}model
```
- Context size: `128000`
- Run as LlamaEdge service
- Chat
```bash
wasmedge --dir .:. --nn-preload default:GGML:AUTO:medgemma-4b-it-Q5_K_M.gguf \
llama-api-server.wasm \
--prompt-template gemma-3 \
--ctx-size 128000 \
--model-name medgemma-4b
```
- Images
**Note that input images are required to be normalized to 896 x 896 resolution and encoded to 256 tokens each**
```bash
wasmedge --dir .:. --nn-preload default:GGML:AUTO:medgemma-4b-it-Q5_K_M.gguf \
llama-api-server.wasm \
--prompt-template gemma-3 \
--llava-mmproj medgemma-4b-it-mmproj-f16.gguf \
--ctx-size 128000 \
--model-name medgemma-4b
```
- Run as LlamaEdge command app
```bash
wasmedge --dir .:. \
--nn-preload default:GGML:AUTO:medgemma-4b-it-Q5_K_M.gguf \
llama-chat.wasm \
--prompt-template gemma-3 \
--ctx-size 128000
```
## Quantized GGUF Models
| Name | Quant method | Bits | Size | Use case |
| ---- | ---- | ---- | ---- | ----- |
| [medgemma-4b-it-Q2_K.gguf](https://huggingface.co/second-state/medgemma-4b-it-GGUF/blob/main/medgemma-4b-it-Q2_K.gguf) | Q2_K | 2 | 1.73 GB| smallest, significant quality loss - not recommended for most purposes |
| [medgemma-4b-it-Q3_K_L.gguf](https://huggingface.co/second-state/medgemma-4b-it-GGUF/blob/main/medgemma-4b-it-Q3_K_L.gguf) | Q3_K_L | 3 | 2.24 GB| small, substantial quality loss |
| [medgemma-4b-it-Q3_K_M.gguf](https://huggingface.co/second-state/medgemma-4b-it-GGUF/blob/main/medgemma-4b-it-Q3_K_M.gguf) | Q3_K_M | 3 | 2.10 GB| very small, high quality loss |
| [medgemma-4b-it-Q3_K_S.gguf](https://huggingface.co/second-state/medgemma-4b-it-GGUF/blob/main/medgemma-4b-it-Q3_K_S.gguf) | Q3_K_S | 3 | 1.94 GB| very small, high quality loss |
| [medgemma-4b-it-Q4_0.gguf](https://huggingface.co/second-state/medgemma-4b-it-GGUF/blob/main/medgemma-4b-it-Q4_0.gguf) | Q4_0 | 4 | 2.36 GB| legacy; small, very high quality loss - prefer using Q3_K_M |
| [medgemma-4b-it-Q4_K_M.gguf](https://huggingface.co/second-state/medgemma-4b-it-GGUF/blob/main/medgemma-4b-it-Q4_K_M.gguf) | Q4_K_M | 4 | 2.49 GB| medium, balanced quality - recommended |
| [medgemma-4b-it-Q4_K_S.gguf](https://huggingface.co/second-state/medgemma-4b-it-GGUF/blob/main/medgemma-4b-it-Q4_K_S.gguf) | Q4_K_S | 4 | 2.38 GB| small, greater quality loss |
| [medgemma-4b-it-Q5_0.gguf](https://huggingface.co/second-state/medgemma-4b-it-GGUF/blob/main/medgemma-4b-it-Q5_0.gguf) | Q5_0 | 5 | 2.76 GB| legacy; medium, balanced quality - prefer using Q4_K_M |
| [medgemma-4b-it-Q5_K_M.gguf](https://huggingface.co/second-state/medgemma-4b-it-GGUF/blob/main/medgemma-4b-it-Q5_K_M.gguf) | Q5_K_M | 5 | 2.83 GB| large, very low quality loss - recommended |
| [medgemma-4b-it-Q5_K_S.gguf](https://huggingface.co/second-state/medgemma-4b-it-GGUF/blob/main/medgemma-4b-it-Q5_K_S.gguf) | Q5_K_S | 5 | 2.76 GB| large, low quality loss - recommended |
| [medgemma-4b-it-Q6_K.gguf](https://huggingface.co/second-state/medgemma-4b-it-GGUF/blob/main/medgemma-4b-it-Q6_K.gguf) | Q6_K | 6 | 3.19 GB| very large, extremely low quality loss |
| [medgemma-4b-it-Q8_0.gguf](https://huggingface.co/second-state/medgemma-4b-it-GGUF/blob/main/medgemma-4b-it-Q8_0.gguf) | Q8_0 | 8 | 4.13 GB| very large, extremely low quality loss - not recommended |
| [medgemma-4b-it-f16.gguf](https://huggingface.co/second-state/medgemma-4b-it-GGUF/blob/main/medgemma-4b-it-f16.gguf) | f16 | 16 | 7.77 GB| |
| [medgemma-4b-it-mmproj-f16.gguf](https://huggingface.co/second-state/medgemma-4b-it-GGUF/blob/main/medgemma-4b-it-mmproj-f16.gguf) | f16 | 16 | 851 MB| |
*Quantized with llama.cpp b5452*