quizforge
Generate a deep, mixed-format question bank from any source material, then grade it — deterministic where it can, LLM where it must. Bring your own chat model.
quizforge is the engine behind a training/readiness feature: it drafts far more questions than any single test shows (multiple choice, fill-in-the-blank, match-the-following, short answer, and free-response scenarios), samples a fresh shuffled test on each attempt — so two learners rarely see the same one — and grades every format. MC/fill/match are graded instantly with no model call; open-ended answers are scored 0–1 with coaching feedback by an LLM you provide.
- Model-agnostic — pass any LangChain-style chat model (
with_structured_output). No SDK is bundled. - Deep bank, anti-sharing sampling — unseen-first, difficulty-spread draws per a configurable blueprint.
- Cheap grading — only open-ended answers cost a model call; everything else is local and free.
- Plain dicts in, plain dicts out — YAML/JSON-friendly, easy to store and template.
Install
pip install quizforge
Bring a chat model from whichever provider you use, e.g.:
pip install langchain-openai # or langchain-anthropic, etc.
Quickstart
Generate a bank
from quizforge import generate_bank
from langchain_openai import ChatOpenAI
llm = ChatOpenAI(model="gpt-4.1", temperature=0.4)
material = open("citrix_lesson.md").read()
new_questions = generate_bank(
material, llm,
targets={"mc": 40, "fill_blank": 20, "match": 12, "short": 16, "freetext": 12},
existing=[], # pass your current bank to top it up
coverage="At least half should be applied incident-response scenarios.",
)
# -> list of dicts with id/type/difficulty + per-format fields. Store as you like.
generate_bank only produces the shortfall to reach targets, validates each
question, and never duplicates an existing prompt — safe to re-run to grow a bank.
Sample a test
from quizforge import sample_test, DEFAULT_BLUEPRINT
test = sample_test(bank, blueprint=DEFAULT_BLUEPRINT, seen_ids=already_seen)
# DEFAULT_BLUEPRINT draws mc8 / fill4 / match2 / short4 / freetext2 = 20, shuffled.
Grade
from quizforge import grade_fill_blank, grade_match, grade_open_answer
grade_fill_blank(q, "ICA") # {"score": 1.0, "correct": True, ...}
grade_match(q, {"0": "RDP", "1": "ICA"}) # per-pair partial credit
grade_open_answer(q, learner_text, llm) # QuizGrade(score, verdict, feedback, ...) or None
grade_open_answer returns None if the model was unavailable — exclude that
question from the attempt's max score rather than penalizing the learner.
Question shapes
Each question is a dict with id, type, difficulty, prompt, plus:
mc—choices: [str],answer_idx: int,explanation: strfill_blank—accepted_answers: [str],explanation: strmatch—pairs: [{left, right}],explanation: strshort/freetext—model_answer: str,rubric: [str]
License
MIT
Metadata
Release files for quizforge 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| quizforge-0.3.0.tar.gz | 26.4 kB | With provenance | Details for quizforge-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| quizforge-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for quizforge-0.3.0-py3-none-any.whl |
Total release size: 50.8 kB
Release files / quizforge-0.3.0.tar.gz
| Download URL | quizforge-0.3.0.tar.gz |
|---|---|
| Size | 26.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
038773fccfcebb7957c03e07f13bae1860a7be98fdc2d875afa6edc5927453af
|
|
BLAKE2b-256 checksum How to use checksums |
b7288a053344ca176cd639de98fa2af11729dae5cd92b09e8950c8f6089e7f19
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 29, 2026.
Transparency logRelease files / quizforge-0.3.0-py3-none-any.whl
| Download URL | quizforge-0.3.0-py3-none-any.whl |
|---|---|
| Size | 24.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7a225f33731ba64d1d114e2b6663b8099d137f195d48bff9276e7305c3034f31
|
|
BLAKE2b-256 checksum How to use checksums |
b2dbe4c0fb0e48c612624ddab3b0edc6372de26272c89c91f44521d94ea9613e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 29, 2026.
Transparency logSecurity for quizforge 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for quizforge-0.3.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 29, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.