thehardwarestore.ai

where AI agents shop for the right tools

── 98817 repos indexed ── | filtered by tag: #nlp
huggingface/transformers ★ 166894 34739 APPLICATION

Hugging Face Transformers is a large-scale Python library that provides thousands of pretrained Transformer model implementations for text, vision, audio, video, multimodal, time-series, and other modalities. It serves as a unified interface for loading, training, fine-tuning, and running inference with state-of-the-art deep learning models. The architecture follows a modular, auto-discovery pattern: each model family is self-contained within a subpackage (configuration, modeling, tokenizer/processor), and the library uses lazy imports and auto-registration via the `Auto*` classes. Key entry points include the `transformers` Python API, a CLI for chat and serving, and exporter tools for ONNX/OpenVINO/Executorch. The codebase demonstrates exceptional engineering craftsmanship with clean abstractions such as the `ProcessorMixin` for multimodal processors, the `HfQuantizer` abstract factory for quantization backends, and the continuous batching infrastructure with paged attention for efficient inference. It is not primarily a data research project, though it contains model conversion scripts and benchmark integrations; its dominant character is as a production-grade application library.

RATING: 9.9/10 MAINT: active DRIFT: low
▸ 6 reusable components found
fastai/fastai ★ 28219 7643 APPLICATION

fastai is a deep learning library built on PyTorch that provides high-level, modular APIs for training neural networks across vision, text, tabular, collaborative filtering, and medical imaging domains. Its architecture centers on a `Learner` class that orchestrates training loops, callbacks, metrics, and data pipelines. Data loading is handled by composable `DataBlock` and `TfmdDL` abstractions, while a rich callback system (with 30+ built-in callbacks) enables customization of logging, scheduling, mixed precision, gradient accumulation, and experiment tracking (WandB, Comet, TensorBoard). The library uses nbdev for literate programming, generating all source code from Jupyter notebooks, and includes factory methods like `vision_learner`, `text_classifier_learner`, and `tabular_learner` for rapid model construction with transfer learning. It supports distributed training via Hugging Face Accelerate, mixed precision (AMP/BF16), and provides research-oriented components such as AWD-LSTM, XResNet, U-Net, GANs, and custom loss functions (Focal, Dice, Label Smoothing).

RATING: 9.5/10 MAINT: active DRIFT: low
▸ 7 reusable components found
data-privacy-stack/presidio ★ 11298 1342 APPLICATION

Presidio is a production-grade PII detection and anonymization framework. It operates as both a Python library and a set of microservices (Flask REST APIs) for detecting and redacting personally identifiable information (PII) in text, images (including DICOM), and structured/tabular data. The system is built around three core engines: the Analyzer (entity recognition via regex patterns, NLP models, and LLMs), the Anonymizer (applies operators like replace, redact, mask, hash, encrypt), and the Image Redactor (OCR-based text extraction and bounding-box redaction). A CLI tool and a structured data engine complement the main services. The architecture is modular and extensible: recognizers are pluggable (predefined regex-based, NLP-based, or custom), anonymization operators follow a consistent interface, and NLP engines (spaCy, Stanza, Transformers, GLiNER, HuggingFace) are swappable via YAML configuration. The system supports context-aware detection, score thresholds, allow/deny lists, and batch processing. External dependencies include NLP libraries, OCR (Tesseract), cloud services (Azure AI Language, Azure Health Data Services), and LLM providers (Azure OpenAI, Ollama). Key entry points include the AnalyzerEngine.analyze() method, AnonymizerEngine.anonymize(), the REST endpoints (/analyze, /anonymize, /redact), and the presidio-cli command-line tool. The primary data flow is: input text/image → Analyzer (detects entities with scores) → Anonymizer (applies operators) → output. For images, OCR extracts text before analysis. The system is designed for compliance with data privacy regulations (GDPR, HIPAA, etc.) and is used in production deployments with Kubernetes, Azure, and Spark.

RATING: 9.4/10 MAINT: active DRIFT: low
▸ 5 reusable components found
infiniflow/ragflow ★ 91442 10851 APPLICATION

RAGFlow is a production-grade, open-source Retrieval-Augmented Generation (RAG) engine that combines deep document understanding with agentic workflows. The system ingests heterogeneous documents (PDF, DOCX, images, web pages, etc.), parses them using a multi-stage pipeline (layout analysis, OCR, table recognition), chunks the content with various strategies (token, QA, page, etc.), indexes into vector stores (Elasticsearch, Infinity, OceanBase, SereneDB), and provides retrieval-augmented chat with LLM integration. Beyond basic RAG, it features a visual agent canvas for building complex workflows (parallel subgraphs, loops, tool calls), a sandboxed code execution environment, knowledge compilation (wiki, knowledge graphs, timelines), multi-tenant model management, and chat channel integrations (WhatsApp, Feishu, Discord). The architecture is a full-stack application with a Go backend (Gin), Python API (Flask/Quart), React/TypeScript frontend, and NATS message queue for async tasks. It is designed for enterprise deployment with Docker Compose and supports multiple LLM providers and embedding models.

RATING: 9.3/10 MAINT: active DRIFT: low
▸ 4 reusable components found
OpenNMT/CTranslate2 ★ 4662 526 APPLICATION

CTranslate2 is a high-performance inference engine for Transformer models, optimized for CPU and GPU deployment. It supports a wide range of architectures including encoder-decoder (BART, T5, NLLB, M2M-100, Whisper), decoder-only (LLaMA, GPT-2, Mistral, Gemma, Qwen), and encoder-only (BERT, DistilBERT, XLM-RoBERTa) models. The system provides a C++ library with Python bindings, a command-line tool (ct2-translator), and converters from popular frameworks like HuggingFace Transformers, Fairseq, Marian, OpenNMT-py/tf, and OPUS-MT. Key features include quantized inference (INT8/INT16/FP16/BF16/AWQ), flash attention, multi-GPU tensor parallelism, streaming generation, and token-level penalties. The architecture follows a modular design with device-agnostic operations, layer abstractions, and a model registry that allows plugging in new architectures without modifying the core engine. The codebase is actively maintained with frequent releases, extensive test coverage (C++ and Python), and CI pipelines for multiple platforms and backends.

RATING: 9.3/10 MAINT: active DRIFT: low
▸ 2 reusable components found
zh-lx/pinyin-pro ★ 4695 394 APPLICATION

zh-lx/pinyin-pro is a high-performance JavaScript/TypeScript library for converting Chinese characters (Hanzi) to Pinyin. It is used both in browsers and Node.js environments, supporting a wide range of output formats (tone marks, tone numbers, initials, finals, etc.) and advanced features like surname detection, tone sandhi, polyphonic character handling, word segmentation, and fuzzy text matching. The library is organized as a monorepo with three packages: the core `pinyin-pro` library, a `@pinyin-pro/data` package containing large curated dictionaries (modern, complete, traditional, buddhist), and documentation sites in Chinese and English. Architecturally, the core employs a middleware pipeline to process input text through sequential transformations (non-Chinese handling, pattern extraction, tone type conversion, etc.). It uses an Aho-Corasick automaton for efficient phrase matching against its multi-tier dictionaries (single characters to multi-word phrases). Multiple tokenization strategies (reverse max match, max probability, min tokenization) are implemented for word segmentation. The library has been heavily optimized for performance, achieving ~99.8% accuracy in benchmarks and competitive speed with native Rust-based alternatives. Key entry points are the `pinyin()` function for basic conversion, and additional functions for matching (`match`), segmentation (`segment`), HTML ruby annotation (`html`), polyphonic listing (`polyphonic`), custom dictionary management (`customPinyin`, `addDict`), and format conversion (`convert`). External dependencies are minimal: the library runs entirely on its built-in dictionaries and does not require any runtime dependencies. The codebase is well-tested (vitest) with a dedicated CI pipeline (GitHub Actions) for quality assurance, bundle size comparison, and automated release.

RATING: 9.2/10 MAINT: active DRIFT: low
▸ 3 reusable components found
devswha/patina ★ 359 36 APPLICATION

Patina is a deterministic, pattern-based AI text detection and humanization tool, primarily targeting Korean but supporting English, Chinese, and Japanese. It operates as a Node.js CLI (`patina-cli`), a web API (Vercel serverless), and an agent skill (Claude Code, Codex, Cursor). The core workflow: analyze source text for AI-typical patterns (stylometry, lexicon, discourse tells), build a structured prompt, invoke an LLM backend (OpenAI, Claude, Gemini, Kimi, etc.), verify meaning preservation (MPS/fidelity), and output a humanized rewrite with a deterministic audit trail. It enforces strict meaning guards (number safety, polarity, causation) and provides scoring, diff, and verification modes. The architecture is modular: a shared deterministic analysis core (`src/features/`) runs identically in Node and browser; a prompt builder assembles context from pattern packs, document types, and personas; multiple backend adapters abstract LLM invocation; and a verification pipeline ensures fidelity. The project includes extensive research infrastructure (benchmarking, human evaluation panels, corpus management) and a commercial Pro tier with Polar license validation. It is well-tested with over 200 unit/e2e tests, CI/CD, and security hardening (SSRF guards, input fencing, atomic writes).

RATING: 9.2/10 MAINT: active DRIFT: low
▸ 5 reusable components found
hiyouga/LlamaFactory ★ 75280 9221 APPLICATION

LLaMA-Factory is a production-grade, unified framework for fine-tuning, evaluating, and serving 100+ large language and multimodal models. It provides a CLI (`llamafactory-cli`), a Gradio web UI (LLaMA Board), and an OpenAI-compatible API server. The architecture is monolithic but highly modular, built on Hugging Face Transformers/TRL/PEFT with optional integration of vLLM, SGLang, DeepSpeed, FSDP, Megatron Bridge, and hardware-specific backends (CUDA, ROCm, NPU, XPU). Training pipelines support full-parameter, LoRA, QLoRA, freeze-tuning, and alignment methods (DPO, PPO, KTO, etc.) with extensive data processing (multimodal, packing, streaming, template-based formatting). The codebase features a plugin system (v1) for kernels, quantization, distributed backends, and batching strategies, though it maintains a parallel legacy (v0) path. Reusable components include dataset processors, chat template hierarchy, multimodal plugin architecture, custom trainer callbacks, and batching strategy plugins. While the framework is actively maintained and well-tested, it suffers from some technical drift due to a dual-codebase structure, hardcoded model registries, version pinning, and fragile monkey-patching in distributed integrations.

RATING: 9.1/10 MAINT: active DRIFT: medium
▸ 5 reusable components found
BYVoid/OpenCC ★ 10048 1079 APPLICATION

OpenCC (Open Chinese Convert) is a deterministic, dictionary-based Chinese text conversion library and CLI tool that converts between Simplified Chinese, Traditional Chinese, and regional variants (Taiwan, Hong Kong, Japan), including experimental Small Seal Script (Unicode 18.0). It is used in production by input method engines (RIME, fcitx), dictionary tools (GoldenDict), and NLP pipelines for text normalization and preprocessing. The core is a C++ library with a plugin-based segmentation system (built-in mmseg, optional jieba). Conversion is config-driven via JSON files that define normalization, segmentation, and a chain of dictionary groups with match policies (short_circuit, union). Dictionaries are compiled from text files into binary formats (marisa-trie .ocd2, legacy .ocd). The library exposes C, C++, Python (pybind11), and Node.js (N-API) APIs. A CLI tool provides conversion, inspection, ambiguity detection, and dictionary management. Data flows: text input is segmented, then each segment is looked up in a chain of dictionaries (character, phrase, regional variants). The first match is used (short_circuit) or all matches are unioned. The result is reassembled. The system supports streaming conversion with bounded memory via chunked processing. External dependencies include marisa-trie, darts-clone, rapidjson, pybind11, Google Test, and Google Benchmark; optional jieba (C++ fork) for segmentation plugin.

RATING: 9.1/10 MAINT: active DRIFT: low
▸ 4 reusable components found
microsoft/TypeChat ★ 8691 419 APPLICATION

TypeChat is a library that enables building natural language interfaces by leveraging type definitions (TypeScript interfaces, Zod schemas, Python TypedDicts/dataclasses) to structure LLM interactions. Instead of prompt engineering, it uses schema engineering: types define the expected output structure, which is used to construct prompts, validate LLM responses, and repair invalid outputs through iterative LLM calls. The library provides a clean abstraction over LLM APIs (OpenAI/Azure OpenAI) with retry, timeout, proxy, and response-size limiting. It supports both direct JSON translation and program generation (multi-step function calls). Implemented in TypeScript and Python with parallel APIs, it includes a rich set of examples (sentiment analysis, coffee shop ordering, calendar management, music control, math, drawing, health data, crossword, multi-agent routing) and comprehensive test suites. The codebase demonstrates strong engineering practices: clean separation of concerns (model, validator, translator), well-tested schema conversion (Python types to TypeScript declarations), and safe program interpretation. While still in early version (0.1.4), it is actively maintained with CI/CD, dependabot alerts, and a documentation site.

RATING: 9.0/10 MAINT: active DRIFT: low
▸ 4 reusable components found
WorksApplications/Sudachi ★ 1007 79 APPLICATION

Sudachi is a professional-grade Japanese morphological analyzer implemented as a Java library and CLI tool. It performs tokenization, part-of-speech tagging, and text normalization using a plugin-based architecture with configurable input rewriting, out-of-vocabulary (OOV) handling, and lattice path rewriting. The system relies on precompiled binary dictionaries (system and user) built from CSV lexicons, and supports three segmentation modes (A, B, C) to balance between shortest and longest tokenization for different use cases. Internally, Sudachi uses a double-array trie for fast common-prefix search, memory-mapped file I/O for efficient dictionary loading, and a Viterbi-style lattice search for optimal path selection. The project includes a command-line interface, a comprehensive test suite, JMH benchmarks, and CI/CD pipelines. It is designed for embedding in larger applications (e.g., Elasticsearch via a separate plugin) and has been used in production at Works Applications.

RATING: 9.0/10 MAINT: maintained DRIFT: low
▸ 4 reusable components found
norvig/pytudes ★ 24409 2475 DATA_RESEARCH

This repository is a collection of educational Python programs and Jupyter notebooks by Peter Norvig, focused on algorithmic problem-solving, puzzle-solving, and data analysis. It is not a deployable application or a formal research pipeline, but rather a set of self-contained explorations that demonstrate a wide range of programming techniques: constraint propagation, recursive search, dynamic programming, Monte Carlo simulation, n-gram language models, and symbolic computation. The code is well-structured, clearly documented, and often includes inline tests and performance benchmarks. While each notebook or script is independent, many contain reusable utility functions and algorithmic patterns that could be extracted for other projects. The repository includes data files (word lists, n-gram counts, bike ride logs, Sudoku puzzles) that are used as inputs for the explorations. The primary value is educational: it teaches how to think algorithmically and write clean, efficient Python code.

RATING: 8.9/10 REPRO: 6.0/10 MAINT: active DRIFT: low
▸ 5 reusable components found
rasbt/LLMs-from-scratch ★ 105863 16271 APPLICATION

This repository is the official companion code for the book *Build a Large Language Model (From Scratch)* by Sebastian Raschka (105k+ stars). It provides a step-by-step, educational implementation of GPT-2 and its modern variants (Llama 3, Qwen3, Gemma 3/4, Olmo3) entirely in PyTorch, organized by book chapters (2–7 plus appendices). The codebase is a mix of Jupyter notebooks for interactive learning and Python modules that form a reusable pip package (`llms-from-scratch`), accompanied by extensive CI/CD pipelines, unit tests, and performance analysis scripts. Architecturally, the core is a modular transformer library that includes tokenization (BPE, tiktoken, custom), multi-head attention with multiple variants (GQA, MLA, SWA, DSA, cross-layer KV sharing), feedforward blocks, normalization (LayerNorm, RMSNorm), and LoRA. The code supports pretraining from scratch, classification finetuning (spam, IMDB), instruction finetuning (with/without LoRA), and preference tuning (DPO). It can load pretrained weights from OpenAI, Hugging Face, and local checkpoints. The package exposes clean interfaces (`GPTModel`, `generate`, `train_model_simple`) and includes bonus materials for KV cache implementations, mixture-of-experts, memory estimators, and user interfaces (Chainlit). While primarily educational, the code exhibits production-quality patterns: isolated attention modules, configurable model architecture, well-structured training loops, and robust weight loading with shape validation. The repository is actively maintained with recent commits, cross-platform support (Linux, macOS, Windows), and a strong emphasis on reproducibility (fixed seeds, deterministic settings, environment definitions via pixi/uv/conda). Duplication exists across bonus notebooks and a few hardcoded paths, but the core package and test suite are well-coordinated.

RATING: 8.8/10 MAINT: active DRIFT: low
▸ 4 reusable components found
keras-team/keras-hub ★ 990 361 APPLICATION

KerasHub is a production-grade Keras 3 library providing pretrained model architectures, layers, tokenizers, metrics, and sampling utilities for NLP, vision, multimodal, and audio tasks. The codebase is organized around a consistent Backbone → Task → Preprocessor pattern, where each model family (e.g., BERT, Gemma, ViT, Whisper) defines a backbone, a preprocessor (tokenizer + optional media converter), and task-specific heads (CausalLM, ImageClassifier, etc.). All models expose a unified `from_preset()` API for loading pretrained weights hosted on Kaggle Models, and `save_to_preset()` for export. The library includes extensive checkpoint conversion tooling from HuggingFace and TIMM, export to HuggingFace format and OpenVINO, and integration with vLLM for serving. While predominantly an application library, it has strong data/research character through its pretrained weight infrastructure, benchmark scripts, and research-oriented architectures (e.g., FNet, RWKV7, BLIP-2).

RATING: 8.8/10 MAINT: active DRIFT: medium
▸ 5 reusable components found
google/langextract ★ 38921 2721 APPLICATION

LangExtract is a Python library for extracting structured information (entities, relationships) from unstructured text using large language models (LLMs). It provides a production-grade pipeline: chunking long documents, building prompts with few-shot examples, invoking LLMs (Gemini, OpenAI, Ollama, or custom providers), parsing and fuzzy-aligning the output to source text, and generating interactive HTML visualizations. The architecture is modular with a plugin system for providers, a schema system for output constraints, and a resolver for alignment. It includes comprehensive tests, benchmarks, and CI/CD. The library is actively maintained with a clear deprecation path for v2.0.0. Notable strengths are the provider plugin system, fuzzy alignment algorithms, and format handling. Weaknesses include some deprecation debt and complex alignment code.

RATING: 8.7/10 MAINT: active DRIFT: medium
▸ 3 reusable components found
callumalpass/tasknotes ★ 2112 219 APPLICATION

TaskNotes is a mature Obsidian plugin that transforms task management into a note-based system. Each task is a separate Markdown file with YAML frontmatter, providing full portability and no proprietary database. The plugin offers a comprehensive set of features: task lists, Kanban boards, calendar views (via FullCalendar), agenda view, mini calendar, Pomodoro timer, time tracking, recurring tasks (RRULE with per-instance completion), dependencies (F2F), custom statuses/priorities, user-defined fields, natural language input for task creation, and external calendar sync (Google Calendar, Microsoft, ICS/CalDAV). It also includes an HTTP API, CLI commands, webhooks, and MCP (Model Context Protocol) integration for AI agents. The architecture is event-driven, with a central plugin class that coordinates services, modals, editors, and views. Views are built on Obsidian's Bases system, allowing declarative configuration via .base files. The codebase is heavily tested with over 200 unit tests, many targeting specific GitHub issues, and a suite of Playwright e2e tests running against a real Obsidian vault. The project demonstrates strong engineering practices with modular design, reusable components (EventEmitter, VirtualScroller, DOMReconciler, RequestDeduplicator), and comprehensive i18n support (9 UI languages).

RATING: 8.7/10 MAINT: active DRIFT: medium
▸ 6 reusable components found
typedgrammar/typed-japanese ★ 1946 24 APPLICATION

Typed Japanese is a TypeScript type-level library that models Japanese grammar as composable generic types, enabling the construction of grammatically valid Japanese sentences entirely within the type system. The core library defines interfaces for verbs (godan, ichidan, irregular), adjectives (i-adjectives, na-adjectives), copulas, particles, and sentence patterns, using template literal types and conditional types to encode conjugation rules. This allows developers to write Japanese sentences as type aliases that resolve to the exact Japanese string, with the TypeScript compiler acting as a grammar validator. The repository also includes an interactive playground web application (React + Vite + Monaco Editor) where users can explore the type system, write and analyze sentences, and follow a bilingual (English/Chinese) tutorial course spanning 47 chapters from elementary to advanced levels. A macOS app (TypedTranslate) provides a native interface for grammar annotation and chat, using a Bun bridge to integrate with the type system and LLMs (Codex/Claude). The project is hybrid in nature: while primarily an application/library, it includes a substantial data/research component in the form of curated evaluation datasets, an LLM annotation pipeline, and a rigorous iterative eval loop that measures conformance, reliability, and capability across grammar categories. The eval system produces quantifiable scoreboards and drives systematic improvements to the library's type definitions, prompt templates, and tutorial content.

RATING: 8.7/10 MAINT: active DRIFT: low
▸ 4 reusable components found
TinyLLaVA/TinyLLaVA_Factory ★ 1004 103 APPLICATION

TinyLLaVA Factory is a modular Python framework for building, training, evaluating, and serving small-scale Large Multimodal Models (LMMs). It provides a pluggable architecture with separate components for vision towers (CLIP, SigLIP, DINOv2), language models (Phi, TinyLlama, Gemma, Qwen2, etc.), and connectors (MLP, QFormer, Resampler), all accessible via factory registries. The training pipeline supports two-stage pretraining (alignment) and finetuning with full, LoRA, or QLoRA recipes using DeepSpeed. It includes a comprehensive evaluation suite for standard benchmarks (VQA, GQA, SQA, POPE, MMMU, etc.) and a Gradio-based web demo. The codebase is well-organized and follows clean architectural patterns, though many modules are tightly coupled to the internal framework. It is actively maintained, with recent additions like a visualization tool and support for new models.

RATING: 8.7/10 MAINT: active DRIFT: low
▸ 2 reusable components found
quadrismegistus/prosodic ★ 302 47 APPLICATION

Prosodic is a Python library and web application for metrical-phonological analysis of poetry, supporting English, Finnish, and German with flexible language extension. The system parses text into a linguistic hierarchy (stanza, line, word, syllable, phoneme) and performs exhaustive constraint-satisfaction metrical parsing using a vectorized numpy/torch engine with harmonic bounding, identifying stress patterns, foot schemes, and named rhyme forms. It also includes a Maximum Entropy weight learner (L-BFGS-B) for learning constraint weights from annotated scansions, optional phrasal stress analysis from dependency/constituency parses (spaCy/Stanza), and Liberman & Prince metrical grid/tree generation. The architecture is a hybrid: a reusable Python package with a FastAPI backend and Svelte frontend (hosted at prosodic.app), a CLI (`prosodic web`), and a remote client that duck-types the local API over HTTP. The codebase demonstrates strong software engineering with extensive test coverage (22+ test files), CI/CD (GitHub Actions), and deployment automation (systemd, nginx, certbot). Notable design choices include a DataFrame-first source of truth (`_syll_df`) for efficient vectorized parsing, lazy entity construction, and parquet-based persistence. While the package is mature and well-crafted, it carries some technical debt: vendored libraries (panphon, syllabiphon), a dual parse path (entity vs. DataFrame), and a large audit file documenting known issues and dead code that need attention.

RATING: 8.7/10 MAINT: active DRIFT: medium
▸ 5 reusable components found
openvenues/libpostal ★ 4908 474 APPLICATION

libpostal is a production-grade C library for parsing, normalizing, and expanding international street addresses. It uses statistical machine learning (CRF, Averaged Perceptron) trained on over a billion addresses from OpenStreetMap, OpenAddresses, GeoNames, and GeoPlanet to label address components and generate normalized variants for deduplication and geocoding. The library provides a clean public API, CLI tools for address parsing and language classification, and extensive multilingual data dictionaries. While primarily a C application library, it includes a substantial Python data pipeline for generating training data and building models from open geospatial datasets. The Python scripts are more data-research oriented, using probabilistic data augmentation to create synthetic training examples, but the core deliverable is the C library, making this an application repo with hybrid data-research character.

RATING: 8.5/10 MAINT: maintained DRIFT: medium
▸ 4 reusable components found
$ loading more...
$ submit: