Turn a persona into an interview simulator
Give this page a persona document and a tone guide. It asks a language model to compile them into a knowledge-node corpus — the doors a student has to find, the answers behind them, the route through — then drops that corpus into a fixed, hand-written matching engine and hands you one self-contained HTML file. The model runs once, here. The app it produces has no model in it.
localhost or publish it to GitHub Pages — see Setup.Gemini Nano runs inside Chrome. No key, no download from this page — Chrome fetches the model once (a few GB) and keeps it. Output is constrained to a JSON schema, which is what makes a small model usable for this.
chrome://flags/#prompt-api-for-gemini-nano and chrome://flags/#optimization-guide-on-device-model (set to Enabled BypassPerfRequirement), restart, then open chrome://components and update Optimization Guide On Device Model.Bigger is better at following the schema. On an 8 GB GPU start with Qwen3 4B; a laptop without a discrete GPU should try Llama 3.2 3B and expect a thin corpus.
The browser can only reach Ollama if it was started with OLLAMA_ORIGINS including this page's origin. Exact command in Setup.
Advanced
Useful for hand-tuning: compile once, edit the JSON, rebuild without spending another run.
1 · Serve the folder locally (once)
A PWA needs a real origin — service workers and the model APIs refuse file://. Any static server works:
# Python (already on most machines)
cd elicitation-lab-generator
python3 -m http.server 8080
# or Node
npx serve . # then open the printed URL
# or, on macOS/Linux with Caddy installed
caddy file-server --listen :8080
Open http://localhost:8080. Everything below assumes that origin.
1b · Or host it on GitHub Pages
The folder ships with a Pages workflow. Push it to a repository and enable Pages with the GitHub Actions source:
cd elicitation-lab-generator
git init && git add -A && git commit -m "Elicitation Lab generator"
gh repo create elicitation-lab --public --source=. --push
# then: repository → Settings → Pages → Source: GitHub Actions
A minute later it is live at https://<you>.github.io/elicitation-lab/, installable, and every backend works there: the Claude API and WebLLM accept any HTTPS origin, Chrome's model is local, and Ollama needs that URL in OLLAMA_ORIGINS. Your API key never leaves your browser either way.
2 · Install it as an app
Once the service worker has registered (a second after first load), Chrome and Edge show Install app in the header here and an install icon in the address bar. Safari on macOS: File → Add to Dock. On iOS: Share → Add to Home Screen.
After install the app shell opens offline. What still needs a network: the Claude API (always), and the first download of WebLLM weights or the Chrome built-in model. Once those are cached, compiling works with the cable out.
3 · Claude API
Create a key at console.anthropic.com. Paste it above and press Load models; the list comes from your account, so it is always current. The page sends the key only to api.anthropic.com, with the anthropic-dangerous-direct-browser-access header that Anthropic requires for calls made from a browser. A full compile is roughly 60–90k tokens.
4 · Chrome built-in model (Gemini Nano)
- Chrome 148 or newer on desktop (Windows 10+, macOS 13+, Linux). Check
chrome://version. - Hardware: 22 GB free disk, and either a GPU with more than 4 GB VRAM or 16 GB RAM with 4+ cores.
- On a Chrome older than 148, or if the tab above says unavailable: open
chrome://flags/#prompt-api-for-gemini-nano→ Enabled, andchrome://flags/#optimization-guide-on-device-model→ Enabled BypassPerfRequirement. Relaunch. - Open
chrome://components, find Optimization Guide On Device Model, press Check for update. The version stops being0.0.0.0when the model has landed. - Reload this page. The Chrome built-in tab should read ready. The first compile may still show a download bar.
It is a small model. Expect 30–45 nodes rather than 60+, and read the validation report before trusting the route.
5 · WebLLM
Needs WebGPU: Chrome or Edge 113+, Safari 18+, Firefox 141+ on Windows. Check chrome://gpu for WebGPU: Hardware accelerated. On Linux you may need chrome://flags/#enable-unsafe-webgpu.
Pick a model and press Download & load now. Weights come from Hugging Face on the first run only and land in the browser's Cache Storage, so the next run is offline. Sizes are in the dropdown; a 7B model wants roughly 6 GB of GPU memory. Inference runs in a Web Worker, so the page stays responsive, but a full compile on a laptop GPU takes 10–25 minutes.
Cache the runtime for offline stores the 6 MB WebLLM library itself, so the whole thing works without a network after that.
6 · Ollama
Install from ollama.com, then start it with this page's origin allowed — otherwise the browser's cross-origin check blocks every call:
# macOS / Linux
OLLAMA_ORIGINS="http://localhost:8080" ollama serve
ollama pull qwen2.5:7b # in a second terminal
# Windows (PowerShell)
$env:OLLAMA_ORIGINS="http://localhost:8080"; ollama serve
The origin above is this page's own, filled in live, so it is right whether you serve from localhost or from GitHub Pages. Press Detect models above; anything you have pulled appears in the list. Ollama accepts a JSON schema for its format field, so output is constrained the same way as Chrome's model. A 7B–14B model here produces the best local corpora.
What the compiler actually does
Four passes, each a single JSON reply: frame (client, latent needs, data sources, ledger, topic clusters) → nodes, one cluster per call → voice (fallback replies and jargon) → path (the reference interview). Small models get smaller batches and a schema to decode against; every reply that fails to parse is retried once with a sharper instruction.
Then, without a model: every path question is replayed, in order, through the exact matcher and the exact prerequisite gate the app ships with, so the report tells you whether the route reaches the nodes it names and never asks for something the client would shut down. Unreachable needs, dangling node references and out-of-order steps are listed, not hidden.
The design follows jacoblee93/fully-local-pdf-chatbot: one interface over WebLLM-in-a-worker, Ollama over HTTP and Chrome's built-in model, with the cloud API as the fourth option.