Instructions to use cyberandy/sangue-e-grafi-gemma4-e2b-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use cyberandy/sangue-e-grafi-gemma4-e2b-gguf with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="cyberandy/sangue-e-grafi-gemma4-e2b-gguf", filename="sangue-e-grafi-gemma-Q4_K_M.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use cyberandy/sangue-e-grafi-gemma4-e2b-gguf with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf cyberandy/sangue-e-grafi-gemma4-e2b-gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf cyberandy/sangue-e-grafi-gemma4-e2b-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 cyberandy/sangue-e-grafi-gemma4-e2b-gguf:Q4_K_M # Run inference directly in the terminal: llama-cli -hf cyberandy/sangue-e-grafi-gemma4-e2b-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 cyberandy/sangue-e-grafi-gemma4-e2b-gguf:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf cyberandy/sangue-e-grafi-gemma4-e2b-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 cyberandy/sangue-e-grafi-gemma4-e2b-gguf:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf cyberandy/sangue-e-grafi-gemma4-e2b-gguf:Q4_K_M
Use Docker
docker model run hf.co/cyberandy/sangue-e-grafi-gemma4-e2b-gguf:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use cyberandy/sangue-e-grafi-gemma4-e2b-gguf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cyberandy/sangue-e-grafi-gemma4-e2b-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": "cyberandy/sangue-e-grafi-gemma4-e2b-gguf", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/cyberandy/sangue-e-grafi-gemma4-e2b-gguf:Q4_K_M
- Ollama
How to use cyberandy/sangue-e-grafi-gemma4-e2b-gguf with Ollama:
ollama run hf.co/cyberandy/sangue-e-grafi-gemma4-e2b-gguf:Q4_K_M
- Unsloth Studio
How to use cyberandy/sangue-e-grafi-gemma4-e2b-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 cyberandy/sangue-e-grafi-gemma4-e2b-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 cyberandy/sangue-e-grafi-gemma4-e2b-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for cyberandy/sangue-e-grafi-gemma4-e2b-gguf to start chatting
- Pi
How to use cyberandy/sangue-e-grafi-gemma4-e2b-gguf with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf cyberandy/sangue-e-grafi-gemma4-e2b-gguf:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "cyberandy/sangue-e-grafi-gemma4-e2b-gguf:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use cyberandy/sangue-e-grafi-gemma4-e2b-gguf with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf cyberandy/sangue-e-grafi-gemma4-e2b-gguf:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default cyberandy/sangue-e-grafi-gemma4-e2b-gguf:Q4_K_M
Run Hermes
hermes
- Atomic Chat new
- Docker Model Runner
How to use cyberandy/sangue-e-grafi-gemma4-e2b-gguf with Docker Model Runner:
docker model run hf.co/cyberandy/sangue-e-grafi-gemma4-e2b-gguf:Q4_K_M
- Lemonade
How to use cyberandy/sangue-e-grafi-gemma4-e2b-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull cyberandy/sangue-e-grafi-gemma4-e2b-gguf:Q4_K_M
Run and chat with the model
lemonade run user.sangue-e-grafi-gemma4-e2b-gguf-Q4_K_M
List all available models
lemonade list
🩸 Sangue e Grafi — Gemma 4 E2B GGUF (Q4_K_M)
Ready-to-run quantized model — Gemma 4B with SFT + GRPO fully merged and converted to GGUF for local inference.
Model Description
This is the fully merged and quantized version of the Sangue e Grafi Gemma pipeline:
google/gemma-4-E2B-it
+ SFT adapter (merged)
+ GRPO adapter (merged)
→ GGUF Q4_K_M quantization
→ ~3.3 GB single file
All training stages (SFT on 500 adversarial scenarios + GRPO reinforcement learning) are baked into a single GGUF file, ready for local inference with llama.cpp, llama-cpp-python, or ollama.
File Details
| Property | Value |
|---|---|
| Format | GGUF (Q4_K_M quantization) |
| Size | ~3.3 GB |
| Base model | google/gemma-4-E2B-it (4B params) |
| Training | SFT + GRPO, fully merged before quantization |
| Compatible with | llama.cpp, llama-cpp-python, ollama, LM Studio |
Benchmark Results 📊
| Benchmark | KG Agent (this model) | Gemini 2.5 Flash (no KG) |
|---|---|---|
| Easy (10 seeds) | 10/10 (100%) | 3/10 (30%) |
| Hard dev-set (10 seeds) | 5/10 (50%) | — |
Usage
With llama-cpp-python
from llama_cpp import Llama
llm = Llama.from_pretrained(
repo_id="cyberandy/sangue-e-grafi-gemma4-e2b-gguf",
filename="*.gguf",
n_ctx=4096,
)
output = llm.create_chat_completion(
messages=[{"role": "user", "content": "Your kinship question here..."}]
)
With ollama
# Download and run
ollama run hf.co/cyberandy/sangue-e-grafi-gemma4-e2b-gguf
With llama.cpp CLI
# Download the GGUF file, then:
./llama-cli -m sangue-e-grafi-gemma4-e2b.gguf -p "Your prompt here" -n 512
Intended Uses & Limitations
Intended uses:
- Local/edge deployment of the KG-grounded agent
- Quick experimentation without GPU or adapter merging
- Integration with llama.cpp-based toolchains
Limitations:
- Q4_K_M quantization may slightly reduce accuracy vs full-precision
- Still requires the KG agent framework for full pipeline performance
- Domain-specific to Italian kinship / inheritance law
Source Adapters
This GGUF was built from:
- SFT adapter: sangue-e-grafi-gemma4-e2b-sft-adversarial-v7
- GRPO adapter: sangue-e-grafi-gemma4-e2b-grpo-run-f-v7
Project Links
| Resource | Link |
|---|---|
| 🚀 Live Demo | HF Space |
| 📦 GitHub | cyberandy/sangue-e-grafi |
| 📄 Paper | RLM-on-KG (arXiv:2604.17056) |
| 📊 Agent Traces Dataset | sangue-e-grafi-agent-traces |
Citation
@misc{sangue-e-grafi-2026,
title = {Sangue e Grafi: Small Models Beat Frontier LLMs on Adversarial Kinship Reasoning with Knowledge Graph Agents},
author = {Andrea Volpini},
year = {2026},
url = {https://github.com/cyberandy/sangue-e-grafi},
note = {Hugging Face Build Small Hackathon 2026}
}
- Downloads last month
- 131
4-bit
Model tree for cyberandy/sangue-e-grafi-gemma4-e2b-gguf
Paper for cyberandy/sangue-e-grafi-gemma4-e2b-gguf
Evaluation results
- Easy Benchmark Accuracy (Agent)self-reported100.000
- Hard Dev-Set Accuracy (Agent)self-reported50.000