multi-model Β· ~50 MB open-book QA Β· Arctic Embed XS (23.0 MB) β†’ MobileBERT-SQuAD2 (26.9 MB)

2-Stage Ultra-Light Open-Book QA Studio

Chain two ultra-compact on-device WASM models totaling ~49.9 MB: Stage 1 embeds your question and multi-document knowledge base with Snowflake/snowflake-arctic-embed-xs (23.0 MB q8 CLS bi-encoder, Apache-2.0) to shortlist Top-K passages, then Stage 2 reads each shortlisted passage with onnx-community/mobilebert-uncased-squad-v2-ONNX (26.9 MB q8, MIT) to extract exact answer spans β€” or abstain corpus-wide when no passage supports the question.

1 Β· Independent pipeline stages (~50 MB combined)

Stage 1 Β· Snowflake Arctic Embed XS (23.0 MB Β· Apache-2.0)

Stage 2 Β· MobileBERT SQuAD v2 Reader (26.9 MB Β· MIT)

2 Β· Choose a document library & run Open-Book QA

Add your own .txt or .md document to the local knowledge base (stays 100% on-device).
Inspect document library (6 passages)

Initialise Stage 1 (Arctic Embed XS) and Stage 2 (MobileBERT-SQuAD2) above to run Open-Book QA.

Waiting for stages

β€”

Stage 1 ranks every document by 384-d CLS cosine similarity, then Stage 2 extracts exact answer spans or abstains.

Stage 1 Retrievalβ€”
Stage 2 Readingβ€”
Combined Latencyβ€”
Top Doc Cosineβ€”
Winning Span / Nullβ€”
Total Payload~49.9 MB q8

Retrieved Passages & Per-Document MobileBERT Readings

3 Β· Show the code

Show the code β€” qa-core.mjs 2-stage span synthesis & corpus-wide abstention
Show the code β€” qa.js Stage 1 Snowflake Arctic Embed XS FIFO worker client