A chatbot that has read Chapters 1–6. It finds the passages that answer your question, shows you where to read them, and can explain them in its own words with a small open language model that runs on your device.
The Virtual Prof answers from the book and nothing else. With AI explanations off, it replies instantly with the best passages, highlighted and linked. Turn them on and a language model reads those passages and writes a short answer that cites them; the model is downloaded once from the Materials & the Environment organisation on Hugging Face and then runs in your browser, with no server and no account.
A language model small enough to run in a browser cannot remember a whole book, and when it tries it makes numbers up. The Virtual Prof therefore separates finding from explaining, a design known as retrieval-augmented generation.
Chapters 1–6 are cut into passages of about 170 words at section boundaries, plus fact cards generated from the book's data files: materials, fibres, composites, eco-audit products.
Your question is matched against every passage with BM25, a classic ranking function, with synonyms (stiff → modulus, CO₂ → carbon) and a boost for the chapter you are reading.
The best four passages are numbered and given to the model with one instruction: answer only from these notes, cite them, and say so if they do not contain the answer.
Every answer ends with links to the sections it used, so the book, not the model, has the last word.
Retrieval is lexical: it matches words, not meanings. It is fast, transparent and needs no download, and the synonym list covers the vocabulary of the book. You can watch it work below: type a question and see the passages it would hand to the model, with their scores.
Two open models from the Qwen3 family
| Option | Model | Download | Best for |
|---|---|---|---|
| Fast | virtual-prof-qwen3-0.6b | ≈ 0.6 GB | most laptops with WebGPU; short answers in 1–3 s, usually faithful, sometimes too confident |
| Better | virtual-prof-qwen3-1.7b | ≈ 1.4 GB | desktops with a recent GPU and plenty of memory; clearer explanations. Experimental: it may fail to load on smaller machines, in which case use Fast |
With WebGPU (recent Chrome or Edge), answers start within a second or two; on the CPU fallback, expect several seconds per sentence. The download is cached by the browser, so it happens once.
An earlier version of this chapter fine-tuned a 360-million-parameter model (matenv-smollm2-360m) on 2 400 questions generated from nine calculators of Chapters 1–4. It learned to call the right calculator for about 80% of unseen questions, up from 0% for the base model, and its direct answers rose from 16% to 72% correct. It showed that a small model is a good router and a poor memory. The Virtual Prof keeps that lesson and scales it to the whole book: the memory is the book itself, searched exactly; the model only reads and explains. The training material remains in the repository's training folder.
python3 tools/build_prof_index.py rebuilds the knowledge base (data/prof_index.js and .json) from the chapters and their data files; run it after editing a chapter. python3 tools/publish_virtual_prof.py (or training/publish_virtual_prof.ipynb on Colab) copies the two ONNX models and the index to the Hugging Face organisation with model cards. The assistant itself is assets/js/prof.js; the floating button is assets/js/prof-widget.js.