use case · multi-model
Two models, one pipeline, all local. First a StarCoder-family model fills in the middle of a function. Then a code-embedding model — all-MiniLM-L6-v2 — turns the finished function into a vector and ranks a small labelled corpus by cosine similarity, so you can see which known example the generated code most resembles. Generation and retrieval, both on your device, nothing uploaded.
1 · StarCoder (generation)
2 · MiniLM (code embeddings)
The generated function appears here.
The hand-off is just a string and a vector. StarCoder produces the function text; MiniLM's
feature-extraction pipeline (mean-pooled, L2-normalised) maps that text — and every
corpus snippet — to a 384-dimension embedding. Because the vectors are normalised, cosine similarity
is a plain dot product, so ranking is a handful of multiplications. Each model runs in its own Web
Worker, so neither blocks the page or each other.