#3232nd of 93 in Data and scraping for AIFor data and documents, documents and ocr

contextgem

Python library for extracting typed, source-referenced data from documents

Run it:Vast.ai ↗ (opens in a new tab)Clore.ai ↗ (opens in a new tab)Affiliate links, no effect on a rank.

Releases and problems feed (RSS)

Stars
2.1k
License
Apache-2.0
Last commit
Nov 2026
Last release
Nov 2026
Language
Python
Stars, last 30 weeks+294
28 Apr 2026: 1,804 stars5 May 2026: 1,807 stars12 May 2026: 1,823 stars19 May 2026: 1,827 stars26 May 2026: 1,828 stars2 Jun 2026: 1,828 stars9 Jun 2026: 1,829 stars16 Jun 2026: 1,832 stars23 Jun 2026: 1,837 stars30 Jun 2026: 1,838 stars7 Jul 2026: 1,841 stars14 Jul 2026: 1,842 stars21 Jul 2026: 1,845 stars28 Jul 2026: 1,853 stars4 Aug 2026: 1,858 stars11 Aug 2026: 1,958 stars18 Aug 2026: 1,976 stars25 Aug 2026: 1,982 stars1 Sept 2026: 1,987 stars8 Sept 2026: 1,991 stars15 Sept 2026: 1,995 stars22 Sept 2026: 1,996 stars29 Sept 2026: 1,999 stars6 Oct 2026: 2,000 stars13 Oct 2026: 2,002 stars20 Oct 2026: 2,007 stars27 Oct 2026: 2,026 stars3 Nov 2026: 2,060 stars10 Nov 2026: 2,082 stars17 Nov 2026: 2,093 stars24 Nov 2026: 2,098 stars

1,804 on 28 Apr 20262,098 on 24 Nov 2026

From GitHub's daily star counts.

Checked on GitHub.

Overview

ContextGem is a Python library that extracts structured data from documents using declarative aspects and concepts instead of hand-written prompts. It generates the prompts, validates output into typed items (text, numbers, dates, booleans, labels, ratings, JSON), and maps each item back to source paragraphs or sentences. LLMs run through LiteLLM, and version 1.0 adds decision models that return probabilities for closed questions.

Who it is for: Python developers building document extraction pipelines, e.g. contracts

Strengths

  • Items carry references to source paragraphs or sentences, with optional justifications
  • Works with any LLM supported by LiteLLM, including Ollama and LM Studio
  • Decision models return per-answer probabilities with configurable thresholds
  • Optional Docling extra converts PDF, DOCX, PPTX, XLSX, HTML and many other formats

Weaknesses

  • Tested with hosted LLMs; smaller local models may not follow extraction instructions
  • Decision models need an external provider such as TypeSafe Jev or OpenAI Decisions API
  • Some formats need LibreOffice (DOC, PPT, XLS, RTF) when converting through Docling
  • 1.0 renamed or removed classes and dropped Python 3.10, so 0.x code needs migration

What it needs

  • GPU optional
  • Needs LiteLLM, Docling (optional), LibreOffice (some formats)
  • Models: OpenAI, Anthropic, Google, Azure OpenAI, xAI

What changed

  1. v1.6.0 ↗ (opens in a new tab)Security fix

    “Upgraded pinned dependency versions: litellm==1.108.8, openai==3.51.0, genai-prices==0.2.3. ContextGem now requires openai 3: code of your own that uses the OpenAI SDK in the same environment must wo…”

From the release notes. No flag means the note does not say so, not that the upgrade is safe.

Also in Data and scraping for AI

See all 93
Also in Data and scraping for AI
RankProjectScore
#30chandraOCR model that converts PDFs and images to Markdown, HTML or JSON with layout Live demo ↗ (opens in a new tab)12.8k starsApache-2.073 out of 100
#31data-juicerOperator-based pipelines for cleaning and deduplicating multimodal training data Live demo ↗ (opens in a new tab)7.3k stars+96 (+1.3%) in 30 daysApache-2.073 out of 100
#33doctrTwo-stage OCR library for PDFs and images, built on PyTorch Live demo ↗ (opens in a new tab)6.4k starsApache-2.069 out of 100
#34datachainPython library that indexes cloud files into versioned, typed datasets2.8k starsApache-2.069 out of 100
#35webclawRust CLI and MCP server that turns web pages into clean markdown or JSON2.4k stars+70 (+2.9%) in 30 daysAGPL-3.069 out of 100