Instructions to use XythicK/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 XythicK/medgemma-4b-it-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="XythicK/medgemma-4b-it-GGUF", filename="medgemma-4b-it-BF16.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use XythicK/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 XythicK/medgemma-4b-it-GGUF:UD-Q4_K_XL # Run inference directly in the terminal: llama-cli -hf XythicK/medgemma-4b-it-GGUF:UD-Q4_K_XL
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf XythicK/medgemma-4b-it-GGUF:UD-Q4_K_XL # Run inference directly in the terminal: llama-cli -hf XythicK/medgemma-4b-it-GGUF:UD-Q4_K_XL
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 XythicK/medgemma-4b-it-GGUF:UD-Q4_K_XL # Run inference directly in the terminal: ./llama-cli -hf XythicK/medgemma-4b-it-GGUF:UD-Q4_K_XL
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 XythicK/medgemma-4b-it-GGUF:UD-Q4_K_XL # Run inference directly in the terminal: ./build/bin/llama-cli -hf XythicK/medgemma-4b-it-GGUF:UD-Q4_K_XL
Use Docker
docker model run hf.co/XythicK/medgemma-4b-it-GGUF:UD-Q4_K_XL
- LM Studio
- Jan
- vLLM
How to use XythicK/medgemma-4b-it-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "XythicK/medgemma-4b-it-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "XythicK/medgemma-4b-it-GGUF", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/XythicK/medgemma-4b-it-GGUF:UD-Q4_K_XL
- Ollama
How to use XythicK/medgemma-4b-it-GGUF with Ollama:
ollama run hf.co/XythicK/medgemma-4b-it-GGUF:UD-Q4_K_XL
- Unsloth Studio
How to use XythicK/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 XythicK/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 XythicK/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 XythicK/medgemma-4b-it-GGUF to start chatting
- Docker Model Runner
How to use XythicK/medgemma-4b-it-GGUF with Docker Model Runner:
docker model run hf.co/XythicK/medgemma-4b-it-GGUF:UD-Q4_K_XL
- Lemonade
How to use XythicK/medgemma-4b-it-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull XythicK/medgemma-4b-it-GGUF:UD-Q4_K_XL
Run and chat with the model
lemonade run user.medgemma-4b-it-GGUF-UD-Q4_K_XL
List all available models
lemonade list
llm.create_chat_completion(
messages = [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image in one sentence."
},
{
"type": "image_url",
"image_url": {
"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
}
}
]
}
]
)🧠 medgemma-4b-it-GGUF
A GGUF-quantized version of the
medgemma-4b-itmodel for efficient local inference on CPUs and low-VRAM GPUs. Fine-tuned for medical use cases with instruction-following capabilities.
📦 Model Details
- Base Model:
medgemma-4b - Instruction-Tuned Variant:
medgemma-4b-it - Format: GGUF (
.gguf) - Quantization Levels:
Q4_0,Q5_1,Q8_0, etc. - Architecture: Based on GEMMA, optimized for medical domains.
🧠 About the Model
medgemma-4b-it is a specialized variant of Google's GEMMA model, fine-tuned on medical instructions and dialogues. It aims to provide accurate and safe responses to healthcare-related queries. This GGUF release makes it easy to run the model locally with llama.cpp, llm, koboldcpp, or text-generation-webui.
🚀 How to Use
With llama.cpp
./main -m medgemma-4b-it.Q4_0.gguf -p "What are the symptoms of Type 2 Diabetes?"
With text-generation-webui
- Drop the
.gguffile into your/modelsdirectory. - Launch the UI and select
medgemma-4b-it. - Start generating!
⚠️ Disclaimer
- This model is intended for research and educational purposes only.
- It should not be used as a substitute for professional medical advice, diagnosis, or treatment.
- Always consult a qualified healthcare provider with any questions regarding medical conditions.
📝 License
The original model is released under Google’s GEMMA license. This GGUF version follows the same license terms.
✨ Acknowledgments
- Google DeepMind for creating GEMMA and Med-GEMMA.
- ggerganov for
llama.cpp. - Hugging Face and the open-source community 💛
💬 Contact
If you have questions or improvements for this repo, feel free to open an issue or reach out!
- Downloads last month
- 159
1-bit
2-bit
3-bit
4-bit
5-bit
6-bit
8-bit
16-bit
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="XythicK/medgemma-4b-it-GGUF", filename="", )