pymupdf4llm is a library and CLI tool that converts PDFs (and other documents) into clean Markdown, JSON, plain text, or layout-aware chunks specifically optimized for LLM and RAG workflows. It provides a high-level API (`to_markdown`, `to_json`, `to_text`, `to_chunks`) that internally uses either a legacy heuristic approach or an optional GNN-based layout parser (via `pymupdf-layout`) to extract text, tables, images, and reading order. The repository also includes a deterministic chunking pipeline that uses only PDF-native layout signals (box boundaries, font jumps, vertical gaps) to produce context-preserving chunks without embeddings. OCR support is built-in, with a hybrid decision model (ONNX-based) that selectively applies Tesseract, RapidOCR, or PaddleOCR to pages that need it. Framework integrations for LlamaIndex and LangChain are provided. The architecture is primarily a monolithic library with two parallel conversion paths (legacy and layout-based), a chunking subpackage, an OCR subsystem with abstract backends, and a batch converter for large-scale processing. While the code is generally well-structured, the presence of two parallel conversion paths and tight coupling to PyMuPDF internals introduce some maintenance risk.
Attic is a self-hostable Nix binary cache server written in Rust. It provides a multi-tenant, globally deduplicated cache for Nix store paths, supporting both local filesystem and S3-compatible storage backends. The system consists of a server binary (`atticd`) that implements the Nix binary cache HTTP API and a client CLI (`attic`) for authentication, pushing store paths, and managing caches. Authentication is stateless via signed JWTs (RS256/HS256) with fine-grained permissions per cache. The server uses content-defined chunking (FastCDC) to split NAR archives into variable-sized chunks, enabling deduplication at both the NAR and chunk levels. Compression (brotli, zstd, xz) is applied during upload with simultaneous hash computation for integrity verification. Garbage collection supports per-cache retention periods and cascading deletion from local caches to global chunk storage. The codebase is organized as a Cargo workspace with four crates: `attic` (core library with chunking, hashing, Nix store FFI), `server` (HTTP server, database, storage, garbage collection), `client` (CLI with push, watch-store, cache management), and `token` (JWT creation and verification). The architecture is modular, with clear separation between API handlers, database entities, storage backends, and authentication. While the project is still in early prototype stage with many TODOs and some fragile FFI bindings to Nix's C++ store library, it demonstrates solid engineering practices with reusable components like streaming hash readers, compression streams, and a custom serde serializer for Nix manifest format.