multi-model · Xenova/multi-qa-MiniLM-L6-cos-v1 (22.97 MB) → onnx-community/tinyroberta-squad2-ONNX (82.14 MB) · WASM q8
2-stage open-book QA: retrieve, then read
A reader model can only answer from the text it is given, and reading every passage is slow. So chain two local workers: Stage 1 · Multi-QA MiniLM embeds the corpus and picks the top-K passages for the question in milliseconds; Stage 2 · TinyRoBERTa-SQuAD2 reads only those and extracts the exact answer span — or abstains, because SQuAD 2.0 taught it to recognise unanswerable questions.
1 · Workflow models
Stage 1 · Multi-QA MiniLM-L6-cos-v1
feature-extraction · 384-d mean-pooled unit vectors · 22.97 MB q8 · Apache-2.0 · ./worker.js
Stage 2 · TinyRoBERTa-SQuAD2
question-answering · span extraction + null-answer abstention · 82.14 MB q8 · CC-BY-4.0 · reuses ../tinyroberta-squad2/worker.js
2 · Corpus, question & pipeline
Prepare both models above to run the pipeline.
Run the pipeline to get an answer.
3 · Stage 1 shortlist (dense retrieval)
Run Stage 1 to shortlist passages.
4 · Stage 2 readings (extractive QA per passage)
Run Stage 2 to read the shortlist.