← All models · LFM2

use case · multi-model

Multi-model: grounded RAG, fully on-device

The retrieval-augmented generation loop, with two models in the browser and no server. MiniLM embeds your knowledge base and retrieves the passages closest to the question; LFM2 then answers using only those passages. You see the retrieved context and the grounded answer — so you can check the model isn't making things up.

1 · MiniLM embedder (retrieval)

2 · LFM2 (grounded answer)

Retrieved context

Grounded answer

Why ground the model? A small LLM asked a bare question may confidently invent an answer. By retrieving real passages and instructing LFM2 to answer only from them (and to say when the answer isn't there), you get responses you can trace back to a source — the core idea behind RAG, here with both models local.

← Wild · Back to LFM2