
ContextGem
Extract data from documents using LLMs and decision models
137 followers
Extract data from documents using LLMs and decision models
137 followers
A free, open-source Python framework: describe what to extract from documents, and it generates the prompts, validates the output and traces every fact to its source.
This is the 2nd launch from ContextGem. View more

ContextGem 1.0
Launching today
New in 1.0: decision models next to LLMs. They answer closed questions with the probability of each answer, fast and at a low cost, and a model group sends each question to the model that suits it. Also new: Docling for your files, and tools for agents.







Free
Launch Team / Built With

Dropbox SignSimple, secure eSignatures for the way your team works.
Promoted




Hi Product Hunt! I'm Sergii, and I build ContextGem.
ContextGem launched here in April 2025, at version 0.2. It has since reached 1.0, and enough has changed to show it to you again.
Why it exists
Reliable extraction from documents usually means writing prompts, designing validation models, mapping the output back to the source and tracking usage across models. With ContextGem, you describe what you need from a document in plain words, and it does that work. It generates the prompts, validates the output into typed values, and traces every fact to the paragraph or sentence it came from, with a justification if you ask for one.
What's new since the first launch
Decision models next to LLMs. A decision model answers closed questions (yes or no, one of your labels, a level of a scale) with the probability of each possible answer, and writes no text. It is fast and low-cost for the questions you ask in volume, and you set the threshold.
The right model for each question. A model group sends the open questions to an LLM and the closed ones to a decision model, and any model can fall back on others.
Your files as they are. With Docling, ContextGem starts from PDF (scanned too), Office files, email, images, audio, video and more. Table rows keep their column headers, and the items from paged files come back with their page numbers.
Agentic workflows. Extract the metadata of documents as they arrive, call an extraction from an agent's tool, or let a decision model choose the next step.
Cloud or local. LLMs through LiteLLM (OpenAI, Anthropic, Google, Ollama, LM Studio and more), and decision models from TypeSafe, OpenAI, Microsoft Foundry or your own server.
What it is not
ContextGem reads one document in depth, every paragraph of it. It does not search across a corpus, which RAG frameworks do better.
It's free and open source (Apache 2.0):
I'd love your feedback. Which questions about your documents would you give to a decision model rather than an LLM? And what is missing for your use case?
GitHub: https://github.com/shcherbak-ai/contextgem
Docs: https://contextgem.shcherbak.ai