# bert-small-pii-detection by Gravitee.io: Open-Weight Model
Source: https://savrn.com/models/bert-small-pii-detection
Markdown alternate of the page above; the site index is https://savrn.com/llms.txt

---

## Runs On

What it takes to serve bert-small-pii-detection (29M parameters): the memory its weights need at each precision, and the cheapest way to rent enough data-center GPUs to hold them.

| Precision | Weights | Memory needed | Cheapest setup | Per hour | Also fits |
| --- | --- | --- | --- | --- | --- |
| 16-bit | 0.1 GB | 0.1 GB | 1x [MI300X](https://savrn.com/ai-index/pricing/gpus/mi300x) (192 GB) Vultr | $1.85 | [1x H100](https://savrn.com/ai-index/pricing/gpus/h100) $1.99 · [1x MI325X](https://savrn.com/ai-index/pricing/gpus/mi325x) $2.00 |
| 8-bit | 0.0 GB | 0.0 GB | 1x [MI300X](https://savrn.com/ai-index/pricing/gpus/mi300x) (192 GB) Vultr | $1.85 | [1x H100](https://savrn.com/ai-index/pricing/gpus/h100) $1.99 · [1x MI325X](https://savrn.com/ai-index/pricing/gpus/mi325x) $2.00 |
| 4-bit | 0.0 GB | 0.0 GB | 1x [MI300X](https://savrn.com/ai-index/pricing/gpus/mi300x) (192 GB) Vultr | $1.85 | [1x H100](https://savrn.com/ai-index/pricing/gpus/h100) $1.99 · [1x MI325X](https://savrn.com/ai-index/pricing/gpus/mi325x) $2.00 |

Memory is the weights at that precision plus 20% for the runtime and a short context; a long context needs more. Prices are the lowest on-demand hourly rates in the [SAVRN Index](https://savrn.com/ai-index/pricing/gpus), read Oct 24, 2026.

[bert-small-pii-detection on every accelerator the SAVRN Index prices, at every precision](https://savrn.com/models/bert-small-pii-detection/gpus)

## SAVRN's Notes on bert-small-pii-detection

Gravitee built this to find personal data in English text so it can be redacted before it leaves your systems. It is tiny, 29M parameters on a BERT small base, which is exactly right for its job: it can sit inline in an API gateway or a logging pipeline without adding meaningful latency.

Apache 2.0 allows commercial use. PII detection is a recall problem, and a model this small will miss things, so pair it with pattern rules for structured identifiers such as card numbers and national IDs. Use it to catch the free-text cases rules cannot, then audit a sample of what it lets through.

SAVRN Research, 2026-09-18

## Model Card

By Gravitee.io, published under apache-2.0, revision f8c27a85c51c.

Token-classification model for PII detection, fine-tuned from prajjwal1/bert-small on [gravitee-io/pii-detection-dataset](https://huggingface.co/datasets/gravitee-io/pii-detection-dataset).

### Label Set

```
AGE, COORDINATE, CREDIT_CARD, DATE_TIME, EMAIL_ADDRESS, FINANCIAL, HONORIFIC, IBAN_CODE, IMEI,
IP_ADDRESS, LOCATION, MAC_ADDRESS, NRP, ORGANIZATION, PASSWORD, PERSON, PHONE_NUMBER,
TITLE, URL, US_BANK_NUMBER, US_DRIVER_LICENSE, US_ITIN, US_LICENSE_PLATE, US_PASSPORT, US_SSN
```

### How to Use

#### Quick start (pipeline)

```
from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline

repo = "gravitee-io/bert-small-pii-detection"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForTokenClassification.from_pretrained(repo)

pipe = pipeline("token-classification", model=model, tokenizer=tok, aggregation_strategy="simple")
text = "Contact John Smith at john@example.com"
pipe(text)
```

#### ONNX

```
pip install transformers onnxruntime huggingface_hub 
```

```
from huggingface_hub import hf_hub_download
from transformers import AutoTokenizer, AutoConfig
import onnxruntime as ort

model_id = "gravitee-io/bert-small-pii-detection"

tokenizer = AutoTokenizer.from_pretrained(model_id)
id2label = AutoConfig.from_pretrained(model_id).id2label
session = ort.InferenceSession(hf_hub_download(model_id, "model.quant.onnx"))

text = "Contact John Smith at john@example.com"
enc = tokenizer(text, return_tensors="np")
inputs = {"input_ids": enc["input_ids"], "attention_mask": enc["attention_mask"]}
logits = session.run(None, inputs)[0][0]

tokens = tokenizer.convert_ids_to_tokens(enc["input_ids"][0])
labels = [id2label[i] for i in logits.argmax(-1)]

for tok, label in zip(tokens, labels):
  print(f"{tok:<20} {label}")
```

### Intended use

[Read the full model card (2,369 words)](https://savrn.com/models/bert-small-pii-detection/card)

## Configuration

Architecture

BertForTokenClassification

Context length (tokens)

512

Layers

4

Hidden size

512

Feed-forward size

2,048

Attention heads

8

Vocabulary size

30,522

Model type

bert

## Identity and Version

Repository

gravitee-io/bert-small-pii-detection

Publisher

Gravitee.io

Task

Token classification

Modality

Text

Library

Not stated by the source

Parameters

29M parameters

Languages

en

Revision

f8c27a85c51c0168f07b9dcf00265bf0a4097939

First published

2025-09-17

Last updated

2026-05-21

## Files and Weights

10 files, 258.0 MB in total. The weights are 3 files totalling 257.0 MB in onnx, safetensors.

Weights3 files · 257.0 MB

Configuration2 files · 3.7 KB

Tokenizer3 files · 944.3 KB

Documentation1 file · 13.5 KB

Repository1 file · 1.5 KB

Every file

| File | Type | Size | SHA-256 |
| --- | --- | --- | --- |
| model.onnx | Weights | 114.2 MB | 5fc1642b7400 |
| model.quant.onnx | Weights | 28.7 MB | b227845ff498 |
| model.safetensors | Weights | 114.1 MB | a6319abf8718 |
| config.json | Configuration | 3.0 KB | — |
| special_tokens_map.json | Configuration | 695 B | — |
| README.md | Documentation | 13.5 KB | — |
| .gitattributes | Repository | 1.5 KB | — |
| tokenizer.json | Tokenizer | 711.4 KB | — |
| tokenizer_config.json | Tokenizer | 1.4 KB | — |
| vocab.txt | Tokenizer | 231.5 KB | — |

## License and Download

License

apache-2.0

Access

Open weights, no gate

Download size

257.0 MB

[Download from Gravitee.io](https://huggingface.co/gravitee-io/bert-small-pii-detection)

Released by Gravitee.io through its official repository on Hugging Face. [Read the license](https://www.apache.org/licenses/LICENSE-2.0).

## Built From

- Derived from prajjwal1/bert-small
- Described by [arXiv:1908.08962](https://savrn.com/papers/well-read-students-learn-better-on-the-importance-of-pre-training-compact-models)
- Described by [arXiv:2110.01518](https://savrn.com/papers/generalization-in-nli-ways-not-to-go-beyond-simple-heuristics)
- Quantized from prajjwal1/bert-small
- Trained on (disclosed) gravitee-io/pii-detection-dataset

## Memory Requirements

| Precision | Weights in memory |
| --- | --- |
| As published | 257.0 MB |
| 16-bit | 0.1 GB |
| 8-bit | 0.0 GB |
| 4-bit | 0.0 GB |

Weights only, from the published parameter count; the key-value cache and runtime add to this.

## Questions About bert-small-pii-detection

### How much GPU memory does bert-small-pii-detection need?

About 0.1 GB at 16-bit and 0 GB at 4-bit: the weights (29M parameters) plus a working margin. A long context needs more.

### What is the cheapest GPU to run bert-small-pii-detection on?

At 16-bit, 1x MI300X from $1.85 an hour; at 4-bit, 1x MI300X from $1.85 an hour, at the lowest on-demand prices the SAVRN Index lists.

### Can I use bert-small-pii-detection commercially?

Yes. bert-small-pii-detection is released under Apache License 2.0. The Apache License 2.0 is a permissive open-source license. It permits commercial use, modification and redistribution. It requires keeping the license and copyright notices and any NOTICE file, stating significant changes, and it includes an express patent grant from contributors.

### What is bert-small-pii-detection's context length?

512 tokens, from the maximum position embeddings in its published configuration.

## Similar Models

Model · Token classification

### [bge-small-ner-early-stopping](https://savrn.com/models/bge-small-ner-early-stopping)

[Arslan Yamaletdinov](https://savrn.com/model-publishers/arslanyam)

This model is a fine-tuned version of BAAI/bge-small-en-v1.5 on an unknown dataset. It achieves the following results on the evaluation set: The following hyperparameters were used during training: - learningrate: 2e-05 - trainbatchsize: 16 - evalbatchsize: 16 - lrschedulertype: linear - numepochs: 10 - Transformers 4.50.0 - Pytorch 2.11.0+cu128 - Datasets 3.4.1 - Tokenizers 0.21.4

Open weights mit 33M parameters 512 tokens transformers

[View model](https://savrn.com/models/bge-small-ner-early-stopping)

Model · Token classification

### [algebra-ai999x](https://savrn.com/models/algebra-ai999x)

[AI999X Labs](https://savrn.com/model-publishers/ai999x)

License: Apache-2.0 · Author: Ibnul Jaif Farabi (creator and engineer) · Organization: AI999X · Version 2.0.0 algebra-ai999x is an offline, deterministic Python solver that answers algebra questions with verified results from 56 certified capabilities, gives 230 documented answers identically on Windows and Linux, and refuses rather than guesses when an answer cannot be verified. algebra-ai999x is a compact, deterministic algebra engine for Python. It reads a question in plain English (or a typed call), picks a certified algebra capability, computes the answer exactly, checks it, and returns the result with its steps, units, LaTeX and assumptions — or an honest refusal that says what is…

Open weights apache-2.0 33M parameters algebra-ai999x

[View model](https://savrn.com/models/algebra-ai999x)

Model · Token classification

### [physics-ai999x](https://savrn.com/models/physics-ai999x)

[AI999X Labs](https://savrn.com/model-publishers/ai999x)

License: Apache-2.0 · Author: Ibnul Jaif Farabi (creator and engineer) · Organization: AI999X · Version 2.0.0 physics-ai999x is an offline, deterministic Python solver that answers physics questions with verified results from 148 certified capabilities, gives 859 documented answers identically on Windows and Linux, and refuses rather than guesses when an answer cannot be verified. physics-ai999x is a compact, deterministic physics engine for Python. It reads a question in plain English (or a typed call), picks a certified physics capability, computes the answer exactly, checks it, and returns the result with its steps, units, LaTeX and assumptions — or an honest refusal that says what is…

Open weights apache-2.0 34M parameters physics-ai999x

[View model](https://savrn.com/models/physics-ai999x)

Model · Token classification

### [zh-pii-tagger-35m](https://savrn.com/models/zh-pii-tagger-35m)

[Chao Ma](https://savrn.com/model-publishers/ickma2311)

A 35M-parameter token tagger for personal data in Chinese and mixed Chinese–English text. It is a fine-tune of cjhwong/seatbelt-pii-tagger with the same architecture, tokenizer and 18 types / 73 BIOES labels. - real Chinese contexts (FineWeb-2) with inserted synthetic private names and addresses; - self-distillation replay, which aims to reduce forgetting of the base model's other types and its English behaviour. - It misses fewer Chinese person names. On test sets never used during development, person recall rises by about 2 to 10 points; precision moves between −3.5 and +3.5 points. - +0.6 to +2.1 on two freshly generated test sets; - +4.2 to +6.7 on an MSRA NER train sample (never used…

Open weights apache-2.0 35M parameters 512 tokens

[View model](https://savrn.com/models/zh-pii-tagger-35m)

Model · Token classification

### [KoELECTRA-small-v3-modu-ner](https://savrn.com/models/koelectra-small-v3-modu-ner)

[Leo Kang](https://savrn.com/model-publishers/leo97)

This model is a fine-tuned version of monologg/koelectra-small-v3-discriminator on an unknown dataset. It achieves the following results on the evaluation set: 태깅 시스템: BIO 시스템 한국정보통신기술협회(TTA) 대분류 기준을 따르는 15 가지의 태그셋 You can use this model with Transformers pipeline for NER. 개체명 인식(NER) 모델 학습 데이터 셋 - https://corpus.korean.go.kr/request/reausetMain.do The following hyperparameters were used during training: - learningrate: 5e-05 - trainbatchsize: 64 - evalbatchsize: 64 - lrschedulertype: linear - lrschedulerwarmupsteps: 15151 - numepochs: 20 - mixedprecisiontraining: Native AMP - Transformers 4.27.4 - Pytorch 2.0.0+cu118 - Datasets 2.11.0 - Tokenizers 0.13.3

Open weights 14M parameters 512 tokens transformers

[View model](https://savrn.com/models/koelectra-small-v3-modu-ner)

Model · Token classification

### [stanford-deidentifier-base](https://savrn.com/models/stanford-deidentifier-base)

[Stanford AIMI](https://savrn.com/model-publishers/stanfordaimi)

Stanford de-identifier was trained on a variety of radiology and biomedical documents with the goal of automatising the de-identification process while reaching satisfactory accuracy for use in production. Manuscript in-proceedings. These model weights are the recommended ones among all available deidentifier weights. This work was supported in part by the Medical Imaging and Data Resource Center (MIDRC), which is funded by the National Institute of Biomedical Imaging and Bioengineering (NIBIB) of the National Institutes of Health under contract 75N92020D00021 and through The Advanced Research Projects Agency for Health (ARPA-H)

Open weights mit 512 tokens transformers

[View model](https://savrn.com/models/stanford-deidentifier-base)

## Gravitee.io

[All models and datasets](https://savrn.com/model-publishers/gravitee-io)

## Versions

- [f8c27a85c51c](https://savrn.com/models/bert-small-pii-detection/versions/f8c27a85c51c) · current 2026-09-18

## Explore More

- [All token classification models](https://savrn.com/models/tasks/token-classification)
- [All models under apache-2.0](https://savrn.com/models/licenses/apache-2-0)
- [Model comparisons](https://savrn.com/models/comparisons)
- [The model directory](https://savrn.com/models)
- [Open model prices by host](https://savrn.com/ai-index/pricing/open-models)

## Source

- Repository metadata, read 2026-10-20.
- [Hugging Face record](https://huggingface.co/gravitee-io/bert-small-pii-detection)
- [How the hub is built](https://savrn.com/model-hub/methodology)
