Instructions to use gabriellarson/Anonymizer-4B-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use gabriellarson/Anonymizer-4B-GGUF with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("gabriellarson/Anonymizer-4B-GGUF", dtype="auto") - llama-cpp-python
How to use gabriellarson/Anonymizer-4B-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="gabriellarson/Anonymizer-4B-GGUF", filename="Anonymizer-4B-F16.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 gabriellarson/Anonymizer-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 gabriellarson/Anonymizer-4B-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf gabriellarson/Anonymizer-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 gabriellarson/Anonymizer-4B-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf gabriellarson/Anonymizer-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 gabriellarson/Anonymizer-4B-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf gabriellarson/Anonymizer-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 gabriellarson/Anonymizer-4B-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf gabriellarson/Anonymizer-4B-GGUF:Q4_K_M
Use Docker
docker model run hf.co/gabriellarson/Anonymizer-4B-GGUF:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use gabriellarson/Anonymizer-4B-GGUF with Ollama:
ollama run hf.co/gabriellarson/Anonymizer-4B-GGUF:Q4_K_M
- Unsloth Studio new
How to use gabriellarson/Anonymizer-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 gabriellarson/Anonymizer-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 gabriellarson/Anonymizer-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 gabriellarson/Anonymizer-4B-GGUF to start chatting
- Pi new
How to use gabriellarson/Anonymizer-4B-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf gabriellarson/Anonymizer-4B-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": "gabriellarson/Anonymizer-4B-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use gabriellarson/Anonymizer-4B-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 gabriellarson/Anonymizer-4B-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 gabriellarson/Anonymizer-4B-GGUF:Q4_K_M
Run Hermes
hermes
- Docker Model Runner
How to use gabriellarson/Anonymizer-4B-GGUF with Docker Model Runner:
docker model run hf.co/gabriellarson/Anonymizer-4B-GGUF:Q4_K_M
- Lemonade
How to use gabriellarson/Anonymizer-4B-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull gabriellarson/Anonymizer-4B-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.Anonymizer-4B-GGUF-Q4_K_M
List all available models
lemonade list
Model Card for eternisai/Anonymizer-4B
SLMs for semantically similar replacement of PII to provide better end-user privacy.
Model description
The Anonymizer-4B is the strongest model in the Enchanted anonymizer series. Effectively matching GPT-4.1 while being thousands of times smaller.
It is the most accurate variant available and powers advanced anonymization in Enchanted.
Intended use
- Primary use: High-accuracy anonymizer inside Enchanted.
- Secondary use: Deployments where top-quality anonymization is critical (enterprise, research).
Training details
- Base: Qwen3-4B.
- Data: ~30k samples covering PII replacement + non-replacement categories.
- Method: Supervised fine-tuning โ GRPO with GPT-4.1 as judge.
- Score: 9.55/10 on anonymization quality.
- Latency: <250ms TTFT, <2s full completion (quantized).
Limitations
- Largest model in the series, not suitable for mobile inference as of August 2025.
- Requires MacBook-class hardware or above for real-time use.
Usage example
<tool_call>
{"name": "replace_entities", "arguments": {"replacements": [
{"original": "Marc", "replacement": "Robert"},
{"original": "cloud infrastructure", "replacement": "enterprise software"}
]}}
</tool_call>
Usage prompt template
The models expect input in this specific format:
[BEGIN OF TASK INSTRUCTION]
You are an anonymizer. Your task is to identify and replace personally identifiable information (PII) in the given text.
Replace PII entities with semantically equivalent alternatives that preserve the context needed for a good response.
If no PII is found or replacement is not needed, return an empty replacements list.
REPLACEMENT RULES:
โข Personal names: Replace private or small-group individuals. Pick same culture + gender + era; keep surnames aligned across family members. DO NOT replace globally recognised public figures (heads of state, Nobel laureates, A-list entertainers, Fortune-500 CEOs, etc.).
โข Companies / organisations: Replace private, niche, employer & partner orgs. Invent a fictitious org in the same industry & size tier; keep legal suffix. Keep major public companies (anonymity set โฅ 1,000,000).
โข Projects / codenames / internal tools: Always replace with a neutral two-word alias of similar length.
โข Locations: Replace street addresses, buildings, villages & towns < 100k pop with a same-level synthetic location inside the same state/country. Keep big cities (โฅ 1M), states, provinces, countries, iconic landmarks.
โข Dates & times: Replace birthdays, meeting invites, exact timestamps. Shift day/month by small amounts while KEEPING THE SAME YEAR to maintain temporal context. DO NOT shift public holidays or famous historic dates ("July 4 1776", "Christmas Day", "9/11/2001", etc.). Keep years, fiscal quarters, decade references unchanged.
โข Identifiers: (emails, phone #s, IDs, URLs, account #s) Always replace with format-valid dummies; keep domain class (.com big-tech, .edu, .gov).
โข Monetary values: Replace personal income, invoices, bids by ร [0.8 โ 1.25] to keep order-of-magnitude. Keep public list prices & market caps.
โข Quotes / text snippets: If the quote contains PII, swap only the embedded tokens; keep the rest verbatim.
[END OF TASK INSTRUCTION]
[BEGIN OF AVAILABLE TOOLS]
[{"type": "function", "function": {"name": "replace_entities", "description": "Replace PII entities with anonymized versions", "parameters": {"type": "object", "properties": {"replacements": {"type": "array", "items": {"type": "object", "properties": {"original": {"type": "string"}, "replacement": {"type": "string"}}, "required": ["original", "replacement"]}}}, "required": ["replacements"]}}}]
[END OF AVAILABLE TOOLS]
[BEGIN OF FORMAT INSTRUCTION]
Use the replace_entities tool to specify replacements. Your response must use the tool call wrapper format:
<|tool_call|>{"name": "replace_entities", "arguments": {"replacements": [{"original": "PII_TEXT", "replacement": "ANONYMIZED_TEXT"}, ...]}}</|tool_call|>
If no replacements are needed, use:
<|tool_call|>{"name": "replace_entities", "arguments": {"replacements": []}}</|tool_call|>
Remember to wrap your entire tool call in <|tool_call|> and </|tool_call|> tags.
[END OF FORMAT INSTRUCTION]
[BEGIN OF QUERY]
Your text to anonymize goes here
[END OF QUERY]
- Downloads last month
- 112
2-bit
3-bit
4-bit
5-bit
6-bit
8-bit
16-bit
Model tree for gabriellarson/Anonymizer-4B-GGUF
Base model
eternisai/Anonymizer-4B