ContextGem 1.0
ContextGem is an open-source Python framework for pulling structured data out of documents with LLMs. Version 1.0 added decision models, which answer yes/no, label and rating questions with a probability for each answer, alongside LLMs for open questions; the current release is 1.4.1.
Why it matters
For developers building contract review, compliance or document-processing tools. It handles the prompts, validation and source references for you, and lets cheaper decision models answer high-volume closed questions.
Highlights
- You describe what to extract in plain language and ContextGem writes the prompts, returning typed output (text, numbers, dates, booleans, labels, ratings, JSON).
- Every extracted item maps back to the paragraph or sentence it came from, with a justification on request.
- Model groups send each question to the model that suits it: an LLM for open answers, a decision model for closed ones, with fallbacks between models.
- Works with cloud or local LLMs through LiteLLM, and with decision models such as TypeSafe Jev and OpenAI's Decisions API.
- Recent releases (1.3 and 1.4) added refusal errors, a `ToolCallError` for tool calls in chat, and sync tool functions that run in a worker thread.
Taken from the project's own README, docs or launch page. Claims about speed or accuracy are the maker's unless stated otherwise.
Worth knowing: Upgrading from 0.x renames or removes some classes and parameters and drops Python 3.10; there's a migration guide. Smaller local LLMs may not follow its extraction instructions well, per the README.
Quick facts
| Pricing | Free; you pay for the model APIs you use |
|---|---|
| Free or paid | Free (open source) |
| License | Apache-2.0 |
| Language | Python (3.11 to 3.14) |
| Platform | Python library (any OS); install from PyPI |
| GitHub stars | ★ 2,021 (as of 2026-10-27) |
| Maker | Shcherbak AI (shcherbak-ai on GitHub) |
Links
- Official site: https://contextgem.shcherbak.ai/
- Repository: https://github.com/shcherbak-ai/contextgem
- Release notes: https://github.com/shcherbak-ai/contextgem/releases
- Docs: https://contextgem.shcherbak.ai/
Related ranking
See how established tools compare in Best AI Coding Tools for Developers. New releases aren't scored until we review them against the rubric.
Checked 2026-10-27 from the tool's own pages. Prices and star counts change, so confirm on the official site. Listing here is not a ranking or an endorsement.
One email a week on AI that saves business owners time
Every Friday: one tool pick with the business use case, what changed in tools you already use, and the week's AI news in plain English. No spam.
Free. Unsubscribe any time. See our privacy policy.