--- id: gliner2 version: "1.3.2" 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) license_treatment: permissive maintenance: active --- # gliner2 — GLiNER2: Unified Schema-Based Information Extraction and Text Classification License: permissive · Maintenance: active · Downloads: 181.8K/mo ## 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 above — 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 pip install gliner2 uv add gliner2 poetry add gliner2 ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 181.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags named entity recognition NER, text classification schema-based, structured data extraction JSON, relation extraction entities, information extraction local inference, zero-shot entity extraction, CPU-based NLP inference, information-extraction, text-classification, cpu-inference [View on SkillFed](https://skillfed.io/packages/gliner2) · [View on PyPI](https://pypi.org/project/gliner2/)