gliner2
GLiNER2: Unified Schema-Based Information Extraction and Text Classification
What it is and what it does
GLiNER2 is a unified information extraction model that handles named entity recognition, text classification, structured data extraction, and relation extraction in a single forward pass. It combines these four NLP tasks into one 205M parameter model, eliminating the need to chain multiple specialized models or external APIs. The base install provides schema validation, API client utilities, and training data tools without requiring PyTorch, while the [local] extra enables full model inference and fine-tuning on standard hardware.
The package is designed for privacy-first workflows: all processing happens locally with no external dependencies beyond its own runtime requirements (peft, pydantic, requests, urllib3). It supports both CPU and GPU inference, with optional quantization and torch.compile for performance optimization. A larger GLiNER XL 1B model is available via cloud API for users who prefer managed inference.
Use it for:
- Extract medical entities (medications, dosages, symptoms) from clinical notes or patient records with domain-specific descriptions.
- Classify customer support tickets by sentiment and category in a single pass without chaining separate models.
- Parse structured data like contact information or product details from unstructured text or web content.
- Build a privacy-compliant information extraction pipeline that runs entirely on-premises without cloud API calls.
- Fine-tune domain-specific extractors for legal documents, financial reports, or scientific papers using LoRA adapters.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
GLiNER2 extracts entities, classifies text, parses structured data, and identifies relations from unstructured text using a single 205M parameter model that runs efficiently on CPU without external API dependencies.
Yes. GLiNER2 is worth installing if you need unified entity extraction, classification, or structured data parsing without external dependencies or GPU requirements. Low install friction, active maintenance, permissive license, and no known vulnerabilities make it a solid choice. Install the base package for schema validation and API access; add [local] only if you need to run models locally.
Install
gliner2 on PyPI
pip
pip install gliner2uv
uv add gliner2poetry
poetry add gliner2Installing gliner2
Before you install
Low friction install with optional local inference. Base install pulls only peft, pydantic, requests, and urllib3—no PyTorch by default. The [local] extra adds model loading and training capabilities. Repository is active with recent commits and moderate adoption.
License in practice
Apache 2.0 permissive license allows commercial use, modification, and redistribution with attribution. No copyleft restrictions; safe for proprietary projects.
Quickstart
pip install gliner2
from gliner2 import GLiNER2
extractor = GLiNER2.from_pretrained("fastino/gliner2-base-v1")
result = extractor.extract_entities(
"Apple CEO Tim Cook announced iPhone 15 in Cupertino.",
["company", "person", "product", "location"]
)
print(result)
Loading and running models locally requires the [local] extra (pip install gliner2[local]), which installs PyTorch and transformers. Base install supports schema validation and API calls only.
Verify before relying
- Whether the 205M parameter model size is sufficient for production accuracy on domain-specific extraction tasks.
- Inference latency and throughput benchmarks on typical CPU hardware.
- Whether fine-tuning via Pioneer is the only supported training path or if local training is also available.
- Supported Python versions beyond the stated >=3.8 requirement.
Package facts
| License | Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — peft, pydantic, requests, urllib3 |
| Maintenance | actively maintained — 45 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 181,844/month — #10,113 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: gliner2-1.3.2-py3-none-any.whl
Tags
More Artificial Intelligence packages
LiteLLM provides a unified Python interface to…
permissive · top 100 on PyPI
huggingface-hubClient library and CLI tool for downloading,…
permissive · top 100 on PyPI
langchainLangChain provides a framework for building…
permissive · top 1,000 on PyPI
hf-xethf-xet provides chunk-based deduplication and…
permissive · top 1,000 on PyPI
tokenizersTokenizers converts raw text into token…
permissive · top 1,000 on PyPI
transformersTransformers provides a unified framework for…
permissive · top 1,000 on PyPI
glinerGLiNER is a lightweight framework for named…
permissive · top 15,000 on PyPI
openmedExtracts medical entities and personally…
permissive · top 5,000 on PyPI
langextractLangExtract uses LLMs to extract and ground…
permissive · top 15,000 on PyPI
acryl-datahub-classifyPredicts sensitive data types (infotypes) in…
permissive · top 15,000 on PyPI
recognizers-text-date-timeRecognizes and resolves date and time entities…
permissive · top 15,000 on PyPI
recognizers-text-numberRecognizes and extracts numeric entities…
permissive · top 15,000 on PyPI
recognizers-textRecognizes and extracts entities like numbers,…
permissive · top 15,000 on PyPI
spark-nlpSpark NLP provides distributed natural language…
permissive · top 5,000 on PyPI
quantulum3Extracts quantities, measurements, and their…
permissive · top 15,000 on PyPI
recognizers-text-choiceRecognizes and resolves entities like numbers,…
permissive · top 15,000 on PyPI