← All models · Mistral 7B Instruct

use case · multi-model · RAG

Multi-model: retrieval-augmented chat

One model rarely ships alone. Here two run side by side: all-MiniLM-L6 (Transformers.js) turns a pasted document into vectors and retrieves the passages closest to your question, then Mistral 7B Instruct (WebLLM) answers using only those passages. That's RAG — grounded, less prone to making things up — and the whole pipeline runs in this tab with no server and no vector database. The retriever is a 25 MB CPU model; the generator is the ~4 GB flagship.

Retriever · all-MiniLM-L6 (Transformers.js · WASM, no GPU needed)

Generator · Mistral 7B Instruct (WebLLM · WebGPU only · ~4 GB)

Retrieved passages (MiniLM)

The top matching chunks appear here, with cosine scores.

Grounded answer (Mistral 7B Instruct)

The answer streams here, using only the retrieved passages.

Why two models beat one

Even a capable 7B model doesn't know your documents, and asking it to memorise them in a prompt gets expensive and unreliable. Instead, MiniLM (a 25 MB embedding model) indexes the text once; each question is embedded and matched by cosine similarity, and only the closest few chunks are handed to Mistral. The LLM's job shrinks to "read these passages and answer" — cheaper, faster, and grounded in source you control. Pairing the flagship generator with a tiny CPU retriever is exactly how you keep a strong answer honest. Swap the corpus for a product manual, a policy doc, or your own notes.

← Wild · Mistral 7B Instruct