skillfed

gliner

Generalist model for NER (Extract any entity types from texts)

gliner v0.2.28 788.2K downloads/30d#5,057 on PyPI3,537
Permissive license Apache-2.0 Active released

What it is and what it does

GLiNER is a named entity recognition framework designed to extract entity types from text without requiring labeled training data. It uses a bi-encoder architecture that pre-computes label embeddings, enabling zero-shot recognition across many entity types. The framework is optimized for deployment on CPUs and consumer hardware through quantization and torch.compile, and includes support for streaming NER, joint entity-relation extraction, and multilingual PII detection across 100+ languages.

The package provides both inference and fine-tuning capabilities. For production workloads, it offers Ray Serve integration for high-throughput serving with dynamic batching and horizontal scaling. Pre-trained models are available via Hugging Face Hub, and the framework supports multiple architectures (uni-encoder, bi-encoder, RelEx, decoder, streaming) tailored to different use cases. Training on custom data is supported through JSON-based datasets and programmatic APIs.

Use it for:

  • Extract personal identifiable information (SSN, credit cards, emails) from documents for compliance and redaction workflows.
  • Build knowledge graphs by jointly extracting entities and relations from unstructured text in a single pass.
  • Tag millions of documents against hundreds of entity types in production pipelines using the bi-encoder architecture.
  • Fine-tune on domain-specific corpora (biomedical, legal, financial) with minimal labeled examples.
  • Parse queries and documents in 100+ languages to extract structured data for multilingual applications.
  • Serve NER models at scale with automatic batching and memory-aware GPU allocation via Ray Serve.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

GLiNER is a lightweight framework for named entity recognition that can extract any entity type from text without labeled training data, and also supports relation extraction, PII detection, and token classification tasks.

Yes. GLiNER is actively maintained, has no known vulnerabilities, and offers a practical solution for zero-shot entity extraction without labeled data. The permissive Apache-2.0 license and low install friction make it accessible. Install it if you need flexible NER without task-specific training, or if you want to experiment with entity extraction on diverse entity types. The Ray Serve integration and quantization support make it viable for production, though you should verify performance on your specific hardware and entity types before deploying.

Install

gliner on PyPI

pip

pip install gliner

uv

uv add gliner

poetry

poetry add gliner

Installing gliner

Before you install

Installation is straightforward with low friction; the package depends on torch, transformers, huggingface_hub, tqdm, onnxruntime, and sentencepiece. The project is actively maintained with a recent release and 3537 GitHub stars, indicating solid community adoption and ongoing development.

License in practice

Apache-2.0 is a permissive license, allowing commercial use, modification, and redistribution with minimal restrictions—suitable for most production and research contexts.

Quickstart

pip install gliner

from gliner import GLiNER

model = GLiNER.from_pretrained("gliner-community/gliner_small-v2.5")
entities = model.predict_entities("John works at Google", ["person", "organization"])

Requires Python 3.10 or later; torch and transformers must be installed and compatible with your hardware (CPU or GPU).

Verify before relying

  • Whether pre-trained models are automatically downloaded on first use or require manual setup.
  • Specific performance benchmarks comparing GLiNER to ChatGPT or UniNER on standard NER datasets.
  • Memory footprint and inference latency on typical consumer hardware (e.g., CPU-only, 8GB RAM).
  • Compatibility and performance with ONNX export on edge devices.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 6 — torch, transformers, huggingface_hub, tqdm, onnxruntime, sentencepiece
Maintenance actively maintained — 21 days since the last release
Last repo commit
First released
Downloads 788,163/month — #5,057 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: gliner-0.2.28-py3-none-any.whl

Keywords: named-entity-recognition, ner, data-science, natural-language-processing, artificial-intelligence, nlp, machine-learning, transformers

Tags

zero-shot named entity recognitionNER without labeled dataentity extraction lightweight modelrelation extraction frameworkPII detection multilingualtoken classification transformersinformation extraction CPUstreaming NER
named-entity-recognitionzero-shot-learninginformation-extraction

More Artificial Intelligence packages