multi-model · multilingual E5 retrieval (118 MB) → mDeBERTa-v3 SQuAD2 reader (333.45 MB) · MIT

Cross-Lingual Open-Book QA: Multilingual E5 → mDeBERTa-v3

Chain two independent WASM models totaling 451.45 MB offline: Stage 1 (Xenova/multilingual-e5-small, 118 MB q8, MIT, reusing ../multilingual-e5-small/worker.js) embeds queries and 100-language passages with query: / passage: prefixes to shortlist top-K documents, then Stage 2 (onnx-community/mdeberta-v3-base-squad2-ONNX, 333.45 MB q8, MIT) extracts the cited span or triggers corpus-wide abstention.

1 · Two Independent On-Device Models (451.45 MB Total)

Stage 1 · Multilingual E5 Small (118 MB WASM q8 · MIT · 384-d)

Stage 2 · mDeBERTa-v3-base SQuAD2 (333.45 MB WASM q8 · MIT · 12L)

2 · Cross-Lingual Corpus & Open-Book Query

Upload local .txt / .md files to add documents to the active multilingual corpus.

Initialise both Stage 1 (Multilingual E5) and Stage 2 (mDeBERTa-v3-base SQuAD2) above to run cross-lingual open-book QA.

Waiting for stages

—

Stage 1 embeds all corpus documents once and shortlists top-K passages; Stage 2 extracts exact citations or abstains corpus-wide.

Stage 1 Retrieval—
Stage 2 Extraction—
Winner Cosine—
Winner Span Score—
Docs Read—
Finite Check—

Stage 1 Shortlisted Passages → Stage 2 mDeBERTa-v3 Readings

3 · Show the code

View mdeberta-client.js · MultilingualE5StageClient (lines 261–442)
View mdeberta-core.mjs · aggregateOpenBookResults() (lines 560–612)