PERSON and LOCATION; street addresses are
also returned as LOCATION.
The default model is urchade/gliner_multi_pii-v1.
DETECTOR_MODEL accepts a Hugging Face model ID or local directory. Hub models
must contain gliner_config.json; private models require Hugging Face
authentication.
Local Models
Local directories need:pytorch_model.bin is also accepted. Missing or invalid files fail during
startup.
Offline deployments must also cache any tokenizer or encoder referenced by
gliner_config.json.Fine-Tuning
GLiNER can be fine-tuned on your own labeled data, for example on names and places that the default model misses in your domain. See the GLiNER training guide. The resulting checkpoint is a normal local model: pointDETECTOR_MODEL at its
directory, no PasteGuard changes required.
Training happens outside PasteGuard, with whichever GLiNER release you prefer.
The detector ships GLiNER 0.2.x, and the checkpoint has to load there. Confirm
that before deploying, especially after training on a newer release. The
training API differs by version: the 0.2.x line the detector ships trains
through
gliner.training.Trainer, while the train_model() helper shown in
the current upstream README belongs to a newer release. Training also needs
accelerate, which the detector environment does not carry.
Recalibrate the floors.
GLINER_FLOOR_PERSON, GLINER_FLOOR_LOCATION, and
GLINER_FLOOR_ADDRESS are calibrated against the default checkpoint and are
unlikely to fit a fine-tuned one. The benchmarks/pii-accuracy harness in the
repository runs a labeled corpus against a running detector and is the quickest
way to find the values that suit yours.
Docker
The image includes the default model and runs offline. For a custom Hub model, enable downloads on first start and persist the cache:Settings
Floors must be between
0 and 1. The request score_threshold can raise, but
not lower, them.
Legacy DETECTOR_MODEL_PATH, DETECTOR_FLOOR_*, and DETECTOR_MAX_TOKENS
remain supported. DETECTOR_MODEL_PATH wins over DETECTOR_MODEL; GLINER_*
wins over matching legacy variables.