Text Generation
Transformers
Safetensors
English
qwen3
privacy
pii
pii-removal
sanitization
redaction
conversational
text-generation-inference
Instructions to use nvidia/Privasis-Cleaner-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nvidia/Privasis-Cleaner-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nvidia/Privasis-Cleaner-4B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("nvidia/Privasis-Cleaner-4B") model = AutoModelForCausalLM.from_pretrained("nvidia/Privasis-Cleaner-4B", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use nvidia/Privasis-Cleaner-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nvidia/Privasis-Cleaner-4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nvidia/Privasis-Cleaner-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/nvidia/Privasis-Cleaner-4B
- SGLang
How to use nvidia/Privasis-Cleaner-4B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "nvidia/Privasis-Cleaner-4B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nvidia/Privasis-Cleaner-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "nvidia/Privasis-Cleaner-4B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nvidia/Privasis-Cleaner-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use nvidia/Privasis-Cleaner-4B with Docker Model Runner:
docker model run hf.co/nvidia/Privasis-Cleaner-4B
File size: 8,235 Bytes
187da88 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | ---
license: other
license_name: nvidia
license_link: LICENSE
pipeline_tag: text-generation
library_name: transformers
language:
- en
base_model:
- Qwen/Qwen3-4B-Instruct-2507
tags:
- text-generation
- privacy
- pii
- pii-removal
- sanitization
- redaction
- qwen3
---
# Privasis-Cleaner-4B Overview
## Description:
Privasis-Cleaner-4B is a lightweight text-sanitization model designed to remove or abstract sensitive information from text according to a user-provided sanitization instruction. Given raw text and an instruction specifying which categories of information to sanitize (e.g., names, dates, locations, identifiers), the model outputs a cleaned and compliant version of the text. The model is built on Qwen3 4B Instruct and fine-tuned on 37K instruction–input–output triplets.
_This model is for research and non-commercial use only._
### License/Terms of Use:
NVIDIA License (Non-Commercial)
### Deployment Geography:
Global
### Use Case:
Data engineers, ML practitioners, and organizations handling sensitive text for automatic redaction of PII/PHI, preprocessing for privacy-preserving research, content sanitization, and compliance pipelines (GDPR, HIPAA, etc.)
### Release Date:
**Github:** June 29th
**HuggingFace:** June 29th
## Reference(s):
[Privasis: Synthesizing the Largest “Public” Private Dataset from Scratch](https://arxiv.org/abs/2602.03183)
## Model Architecture:
**Architecture Type:** Decoder-only Transformer with attention mechanisms, built on Qwen3 4B Instruct model
**Number of model parameters:** 4B
The model utilizes supervised fine-tuning (SFT) with a base of Qwen3 4B Instruct, optimized for text sanitization via user-specified instruction.
## Input:
**Input Type(s):** Text
**Input Format(s):** String
**Input Parameters:** 1D Sequence
**Other Properties Related to Input:** Text input, up to 262,144 tokens (including restrictions).
## Output:
**Output Type(s):** Text
**Output Format:** "String"
**Output Parameters:** 1D
**Other Properties Related to Output:** None Applicable
## Software Integration:
**Runtime Engine(s):** Privasis-Cleaner-4B
**Supported Hardware Microarchitecture Compatibility:** NVIDIA H100-80GB, NVIDIA A100
**[Preferred/Supported] Operating System(s):** Linux
The integration of foundation and fine-tuned models into AI systems requires additional testing using use-case-specific data to ensure safe and effective deployment. Following the V-model methodology, iterative testing and validation at both unit and system levels are essential to mitigate risks, meet technical and functional requirements, and ensure compliance with safety and ethical standards before deployment.
## How to Use:
Privasis-Cleaner takes a **sanitization instruction** (which categories of information to remove or abstract) together with the **raw text**, and returns the sanitized text. The model is prompted with a single user turn in the following format (matching the [Privasis benchmark code](https://github.com/skywalker023/privasis)):
```
**Sanitization Instruction:**
{instruction}
Do not output any explanation or other comment than the sanitized text.
**Text to sanitize:**
{text}
**Sanitized Text:**
```
### Transformers
```python
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "nvidia/Privasis-Cleaner-4B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="auto", device_map="auto")
instruction = "Remove all person names, exact dates, and exact locations."
text = "On March 3, 2021, Jane Doe visited the clinic in Boston for a follow-up."
prompt = (
f"**Sanitization Instruction:**\n{instruction}\n"
"Do not output any explanation or other comment than the sanitized text.\n\n"
f"**Text to sanitize:**\n{text}\n\n"
"**Sanitized Text:**"
)
inputs = tokenizer.apply_chat_template(
[{"role": "user", "content": prompt}],
add_generation_prompt=True,
enable_thinking=False, # emit the sanitized text directly
return_tensors="pt",
).to(model.device)
output = model.generate(inputs, max_new_tokens=4096, do_sample=False)
response = tokenizer.decode(output[0][inputs.shape[-1]:], skip_special_tokens=True)
# The model may echo the "Sanitized Text:" header — strip it if present
if "Sanitized Text:" in response:
response = response.split("Sanitized Text:")[-1]
print(response.strip())
```
### vLLM (OpenAI-compatible server)
Serve the model:
```bash
vllm serve nvidia/Privasis-Cleaner-4B --port 8000
```
Then query it:
```python
from openai import OpenAI
client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")
instruction = "Remove all person names, exact dates, and exact locations."
text = "On March 3, 2021, Jane Doe visited the clinic in Boston for a follow-up."
prompt = (
f"**Sanitization Instruction:**\n{instruction}\n"
"Do not output any explanation or other comment than the sanitized text.\n\n"
f"**Text to sanitize:**\n{text}\n\n"
"**Sanitized Text:**"
)
resp = client.chat.completions.create(
model="nvidia/Privasis-Cleaner-4B",
messages=[{"role": "user", "content": prompt}],
temperature=0.0,
max_tokens=4096,
)
print(resp.choices[0].message.content.strip())
```
Check out the [Privasis benchmark](https://github.com/skywalker023/privasis) for evaluation.
## Model Version(s):
Privasis-Cleaner-4B
(Optional) The Privasis-Cleaner-4B model can be integrated into an AI system via API calls, accepting natural-language instructions and raw text as input, and returning sanitized text as output, suitable for data pipelines requiring automated text sanitization.
## Training, Testing, and Evaluation Datasets:
### Training Dataset:
**Link:** Not Specified
**Data Modality:** Text
**Audio Training Data Size (If Applicable):** Not Applicable
**Image Training Data Size (If Applicable):** Not Applicable
**Text Training Data Size (If Applicable):** Less than a Billion Tokens
**Video Training Data Size (If Applicable):** Not Applicable
**Non-Audio, Image, Text Training Data Size (If Applicable):** Not Applicable
**Data Collection Method by dataset:** Synthetic
**Labeling Method by dataset:** Synthetic
**Properties (Quantity, Dataset Descriptions, Sensor(s)):** 36,723 text-based triplets (text, sanitization instruction, sanitized text); Non-sensitive public and internally generated synthetic text; No personal data, copyright-protected, or IoT/synthetic data mentioned; Linguistic characteristics not specified; No specific sensor type mentioned
**Dataset License(s):** Governing term is CC-BY-NC, but each subset follows the generator models' original license.
### Testing Dataset:
**Link:** Not Specified
**Data Collection Method by dataset:** Synthetic
**Labeling Method by dataset:** Synthetic
**Properties (Quantity, Dataset Descriptions, Sensor(s)):** 3,041 text-based triplets (text, sanitization instruction, sanitized text); Non-sensitive public and internally generated synthetic text; No personal data, copyright-protected, or IoT/synthetic data mentioned; Linguistic characteristics not specified; No specific sensor type mentioned
**Dataset License(s):** Governing term is CC-BY-NC, but each subset follows the generator models' original license.
## Inference:
**Acceleration Engine:** vLLM
**Test Hardware:** GPU (NVIDIA H100)
## Ethical Considerations:
NVIDIA believes Trustworthy AI is a shared responsibility and we have established policies and practices to enable development for a wide array of AI applications. When downloaded or used in accordance with our terms of service, developers should work with their internal model team to ensure this model meets requirements for the relevant industry and use case and addresses unforeseen product misuse.
For more detailed information on ethical considerations for this model, please see the Model Card++ Explainability, Bias, Safety & Security, and Privacy Subcards None.
Please report model quality, risk, security vulnerabilities or concerns https://qwen3.ai/support/report.
**Generated by NVIDIA Model Card Generator Toolkit.** |