Search over your own documents, clustering, deduplication — all of it stands on embeddings, and all of it can be done for free: vector models are part of the free tiers at Cloudflare, Mistral, Gonka and Hugging Face. Here is how vectorization works, which models to take, and how to turn it into working search.
What an embedding is, in one paragraph
A model turns text into a vector of numbers (for example, 1024 dimensions): texts close in meaning get vectors close to each other. Comparison is done by cosine similarity. This is the foundation of RAG (searching your base before answering), clustering, deduplication and semantic search. The key difference from chat models: embedding calls are cheap, fast and generate no text.
Where to get them for free
| Platform | Model | Budget | Comment |
|---|---|---|---|
| Cloudflare Workers AI | bge-m3 | 10,000 neurons/day | Cheap in neurons, resets daily |
| Mistral | embedding models of the lineup | a billion tokens/month | Per-second limit, huge monthly volume |
| Gonka Broker | BAAI/bge-m3 | ~1 million tokens/month (the cheap model stretches into ~6 million) | Bonus quota |
| Hugging Face | hundreds of embedding models | credits + serverless <10 GB | Maximum choice |
| ModelScope | vector models from the catalog | 2000 RPD | Requires verification |
Entry points with commands are in the providers directory; Cloudflare’s conversion of neurons into vectors is the most predictable one.
A working loop: documents → search
- Chunking: the document is split into chunks of 300–800 tokens with 10% overlap.
- Vectorization: each chunk → a request to the embedding model → a vector into the store (you can keep them even in SQLite/JSON — up to tens of thousands of vectors).
- Search: the user’s query → a vector → the nearest chunks by cosine similarity → handed over to the chat model’s context (RAG).
# векторизация через OpenAI-совместимый эндпоинт
r = client.embeddings.create(model="bge-m3", input=["текст куска 1", "текст куска 2"])
vectors = [d.embedding for d in r.data]For personal libraries (hundreds of documents) the loop is completely free: vectorization on Cloudflare’s daily neurons, storage locally, search locally. For bigger bases — vector databases (FAISS, Qdrant) on top of the same vectors.
Practical techniques
- Batch vectorization: send a batch of chunks in a single request — the limits drain more slowly.
- Don’t vectorize junk: headers and footers, menus, repeating blocks — they pollute the base and burn quota.
- Version your vectors: when you change models, re-vectorize the whole base — vectors from different models are incompatible.
- Hybrid search: embeddings plus keywords give a better result than pure semantics; for most cases a vector database isn’t needed — Elasticsearch/Supabase is enough.
Frequently asked questions
Do you need a vector database? Up to tens of thousands of vectors — no: an array in memory with an exact scan is faster than setting up a database. A database pays off at larger volumes.
Which model is better for Russian? bge-m3 is multilingual and proven; the starting point for any language.
How many chunks per day are possible? On Cloudflare neurons — thousands of short chunks; on the Mistral billion — hundreds of thousands. Real bases get vectorized in days, for free.
Are embeddings “smart”? They don’t reason — vectors only. The intelligence in the loop is added by a chat model on top of the found chunks.
How do embedding calls differ from chat requests in practice? A chat model generates text and costs noticeably more; an embedding model returns a vector of numbers in a fraction of a second. That is exactly why vectorizing large bases fits even into modest quotas such as Cloudflare’s daily neurons.
Can you mix vectors from different models in one base? No: vectors from different models live in different spaces, and cosine similarity between them loses meaning. When you change models, re-vectorize the whole base and store next to it the name of the model that produced the vectors.
What to do with tables and code inside documents? Chunk them separately and label the source: mixing tables, code and prose in one chunk degrades search quality. For code it helps to keep function boundaries; for tables, the header row in every chunk.
How do you check search quality before vectorizing the whole base? Take twenty to thirty questions with known answers and measure whether the right chunk lands in the top five results. Such a mini-test shows the quality of the chunking and of the chosen model before you run the entire library.
Mini case: search over personal notes without a vector database
The task: find the right note by meaning among hundreds of files. The solution is a local loop on free quotas: chunk the document, vectorize through an OpenAI-compatible endpoint, store the vectors in JSON and search by brute force with cosine similarity. The model comes from the table above: for Russian text the starting point is bge-m3.
import json, math
# base.json: [{"text": "...", "vector": [...]}, ...]
base = json.load(open("base.json"))
def cosine(a, b):
dot = sum(x * y for x, y in zip(a, b))
norm_a = math.sqrt(sum(x * x for x in a))
norm_b = math.sqrt(sum(x * x for x in b))
return dot / (norm_a * norm_b)
def search(query_vec, top=5):
scored = [(cosine(query_vec, row["vector"]), row["text"])
for row in base]
scored.sort(reverse=True)
return scored[:top]With a few thousand chunks the scan takes milliseconds and the memory for vectors is measured in tens of megabytes: a vector database gets connected later, when the volumes become noticeable. The loop is assembled in an evening and serves a personal library at no cost.
For a team version, add a shared repository with the base and a weekly script that vectorizes new documents: Cloudflare’s daily neurons cover an inflow of dozens of files, and a full run over the whole base is needed only when you change models.
What to improve as the base grows: hybrid search with keywords on top of semantics, caching the vectors of repeated queries, and versioning vectors in case of a model change. Every step stays within the free tiers from the table above.
Estimate the volume before starting: a 500-token chunk is 500 tokens of quota for vectorization; a library of five hundred documents with ten chunks each will require on the order of 2.5 million tokens. That volume is covered by Gonka’s bonus quota or by a several-day plan on Cloudflare neurons — without money and without exceeding the limits. Count the budget before chunking, not after the first request that runs into a limit.
Embeddings are the cheapest layer of the AI stack, and the free tiers have enough of them for real bases. The loop “chunking → vectors → search → RAG” is assembled in an evening. Models and limits are current as of autumn 2026.
