--- id: curated-transformers version: "2.0.1" license: MIT license_treatment: permissive maintenance: dormant --- # curated-transformers — A PyTorch library of transformer models and components License: permissive · Maintenance: dormant · Downloads: 924.2K/mo ## What it is and what it does Curated Transformers is a PyTorch library that packages state-of-the-art transformer models as composable building blocks. It supports both encoder-only architectures (BERT, RoBERTa, XLM-RoBERTa) and decoder-only models (Llama, Falcon, GPT-NeoX, MPT), with generation wrappers for text generation tasks. Models load directly from Hugging Face Hub, and the library includes support for 4-bit and 8-bit quantization via bitsandbytes. The library is designed around reusable components—a single bugfix or feature (like 4-bit inference or PyTorch meta-device support) benefits all models at once. It emphasizes type safety with full type annotations on public APIs, making it suitable for both production use and education. Explosion AI uses it in production and it serves as the default transformer backend in spaCy 3.7. Use it for: - Load and run inference on large language models (Llama, Falcon) from Hugging Face Hub for text generation tasks. - Build encoder-only models (BERT, RoBERTa) for classification, token tagging, or semantic search tasks. - Quantize transformer models to 4-bit or 8-bit precision to reduce memory and improve inference speed on resource-constrained hardware. - Compose custom transformer architectures by mixing and matching reusable encoder/decoder components. - Integrate transformer inference into spaCy NLP pipelines via spacy-curated-transformers. - Study transformer internals through well-documented, type-annotated building blocks for educational purposes. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Curated Transformers provides PyTorch implementations of state-of-the-art transformer models (BERT, Llama, Falcon, etc.) built from reusable components, with support for loading models from Hugging Face Hub and generation tasks. Yes, with conditions. Install if you need PyTorch transformer inference with clean, composable components and don't mind dormant maintenance (last release 849 days ago). The library is production-tested by Explosion AI and integrated into spaCy 3.7, but the long release gap means you should verify compatibility with your PyTorch and tokenizer versions before relying on it for new projects. No known security vulnerabilities. ## Install pip install curated-transformers uv add curated-transformers poetry add curated-transformers ## Installing curated-transformers Before you install: Low install friction with a pure-Python wheel. Maintenance is dormant—last release was 849 days ago (April 2024)—but the repository remains active and the package is used in production by Explosion AI and integrated into spaCy 3.7. License in practice: MIT license is permissive; you can use this package freely in commercial and private projects with minimal restrictions. Quickstart: pip install curated-transformers import torch from curated_transformers.generation import AutoGenerator, GreedyGeneratorConfig generator = AutoGenerator.from_hf_hub(name="tiiuae/falcon-7b-instruct", device=torch.device("cuda")) results = generator(["What is Python?"], GreedyGeneratorConfig()) Requires PyTorch and CUDA/GPU for practical use; torch must be installed separately. Minimum Python 3.9. Verify before relying: - Whether dormant status (last release 849 days ago) indicates ongoing maintenance or de facto abandonment - Compatibility with recent PyTorch and transformer ecosystem versions - Performance characteristics compared to other transformer libraries ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 924.2K/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags transformer models pytorch, llama falcon bert implementation, huggingface model loading, transformer inference pytorch, reusable transformer components, quantized model inference, text generation transformers, encoder decoder models, transformer-models, llm-inference, quantization [View on SkillFed](https://skillfed.io/packages/curated-transformers) · [View on PyPI](https://pypi.org/project/curated-transformers/)