Pulling structured data out of documents usually means writing prompts, building validation models and checking every result by hand. ContextGem 1.0 aims to remove most of that work: describe what you want to extract, and this free, open-source Python framework generates the prompts, validates the output and traces every fact back to its source.
ContextGem (Credits: Product Hunt)
ContextGem first launched on Product Hunt in April 2025 at version 0.2. Version 1.0, launching today, is a major step forward, headlined by a new idea: decision models working alongside large language models.
ContextGem 1.0 decision models explained
Here is the problem ContextGem 1.0 is trying to solve. Reliable extraction is not just about asking a language model a question. You also need to turn its answer into a typed value, check it is valid, map it back to the paragraph or sentence it came from, and track usage across models.
ContextGem handles that pipeline for you. You describe the fields you need in plain words, it generates the prompts, validates the output into typed values, and traces each fact to its source, with a justification if you ask for one.
The new decision models handle closed questions: yes or no, one of your labels, or a level on a scale. Instead of writing text, a decision model answers with the probability of each possible answer. That makes it fast and low-cost for questions you ask in volume, and you can set the threshold for accepting an answer.
How ContextGem 1.0 routes each question
A model group sends each question to the model that suits it. Open questions go to a large language model, closed questions go to a decision model, and any model can fall back on others if needed.
On the input side, ContextGem 1.0 adds Docling support, so it can start from PDFs, including scanned PDFs, Office files, email, images, audio, video and more. Table rows keep their column headers, and items from paged files come back with their page numbers.
It also works for agentic workflows: extract document metadata as files arrive, call an extraction from an agent’s tool, or let a decision model choose the next step. Language models can run through LiteLLM, covering OpenAI, Anthropic, Google, Ollama and LM Studio, while decision models can come from TypeSafe, OpenAI, Microsoft Foundry or your own server.
One honest limit is worth noting. ContextGem reads one document in depth, paragraph by paragraph. It does not search across a whole corpus, which retrieval-augmented generation frameworks do better. For that job, use a different tool.
For developers drowning in contracts, reports, invoices or research papers, though, ContextGem 1.0 looks like a practical shortcut: describe what you need, let the right model answer each question, and keep a trace back to the source for every fact.
Also Read: Off Grid AI: Private AI on Your Phone and Computer, Free and Open Source and vLLM Semantic Router Releases d3-ultra: A 27B Open Multimodal Decision Model
Source: Product Hunt — read the full story there.
