bge-m3 embeddings: dimensions, limits, and English and French in one index.
bge-m3 is an open embedding model from the Beijing Academy of Artificial Intelligence (BAAI): 1,024 dimensions, inputs up to 8,192 tokens, more than 100 languages, MIT licence. A French question and its English answer land close together, so one index serves both languages. Here are the model card’s facts, what Canner’s endpoint returns, and what we measured.
Facts checked
What BAAI says about the model
The “M3” stands for multi-functionality, multi-linguality and multi-granularity. The paper describes one model that can produce three kinds of output for retrieval: a dense vector, sparse lexical weights, and multiple vectors per text (ColBERT-style late interaction).
- BAAI recommends hybrid retrieval plus re-ranking for retrieval-augmented generation: combine dense search with a keyword or sparse score, then re-rank the top results.
- No prefixes. Some multilingual models want
query:andpassage:in front of every text. bge-m3 doesn’t, which keeps ingestion and search code identical.
| Property | bge-m3, per BAAI |
|---|---|
| Retrieval modes † † | Dense, sparse (lexical weights), multi-vector |
| Dense dimensions † | 1,024 |
| Languages † † | More than 100 “working languages” |
| Maximum input † | 8,192 tokens |
| Query instructions † | Not needed: queries and passages are embedded the same way |
| Licence † | MIT |
† Competitor details come from each vendor’s own published pages on the dates shown; prices and plans change, so check the vendor before you decide. Retrieval modes (2026-11-23) · Retrieval modes (2026-11-23) · Dense dimensions (2026-11-23) · Languages (2026-11-23) · Languages (2026-11-23) · Maximum input (2026-11-23) · Query instructions (2026-11-23) · Licence (2026-11-23)
What Canner’s endpoint returns
Canner serves bge-m3 at POST /v1/embeddings, the OpenAI format, on its own server in Montréal (AI endpoints). The texts are processed in memory and not stored. We checked each of these against the live endpoint on 2026-11-23:
- Dense vectors only. The response is the OpenAI shape:
data[].embedding,data[].index, andusage.prompt_tokens. There are no sparse weights or multi-vector outputs, so the lexical half of hybrid search comes from Postgres full-text search instead. - 1,024 dimensions, normalised to length 1. We measured a norm of 1.000000. The dot product is the cosine similarity, and
vector_cosine_opsandvector_ip_opsrank the same way. - No `dimensions` parameter. Asking for fewer dimensions returns
400with “dimensions is not supported: bge-m3 returns 1024 dimensions.” If you need a smaller index, store the column ashalfvec(1024). - Up to 128 texts per request. 129 returns
400with “At most 128 inputs per request.” - Up to 8,192 tokens per text, refused rather than cut short. A text over the limit fails the request with an error instead of being silently truncated. Split documents into passages of a few hundred words before embedding.
- The OpenAI SDKs work unchanged. We ran the Node and Python SDKs below; both return each embedding as a plain array of 1,024 numbers.
- No content check. Unlike chat, embeddings aren’t passed through the safety model, so they’re never blocked by the content policy.
Embed in batches of 128
In a project with an attached endpoint, OPENAI_BASE_URL and OPENAI_API_KEY are set on the next deploy, so the client needs no configuration. The models answer one request at a time across the service; a batch of 128 short texts is one turn in the queue instead of 128. With maxRetries, the SDK waits out a 429 server_busy using its Retry-After header. We ran both versions below against the endpoint.
import OpenAI from "openai";
// OPENAI_BASE_URL and OPENAI_API_KEY come from the attached endpoint.
// maxRetries: the SDK waits out a 429 server_busy (it reads Retry-After) and tries again.
const ai = new OpenAI({ maxRetries: 5 });
// Any number of texts, 128 per request (the endpoint's limit).
export async function embedAll(texts) {
const vectors = [];
for (let i = 0; i < texts.length; i += 128) {
const r = await ai.embeddings.create({ model: "bge-m3", input: texts.slice(i, i + 128) });
for (const d of r.data) vectors[i + d.index] = d.embedding;
}
return vectors;
}
// The vectors are normalised to length 1, so the dot product is the cosine similarity.
export const similarity = (a, b) => a.reduce((sum, x, i) => sum + x * b[i], 0);The same in Python
from openai import OpenAI
client = OpenAI(max_retries=5) # OPENAI_BASE_URL + OPENAI_API_KEY; retries wait out 429 server_busy
def embed_all(texts: list[str]) -> list[list[float]]:
vectors: list[list[float]] = []
for i in range(0, len(texts), 128):
r = client.embeddings.create(model="bge-m3", input=texts[i : i + 128])
vectors.extend(d.embedding for d in sorted(r.data, key=lambda d: d.index))
return vectorsStore and search in Postgres
A vector(1024) column holds one bge-m3 embedding, well under pgvector’s 2,000-dimension limit for indexing. We ran this SQL against pgvector with four English and French passages: the French question “Est-ce que je peux amener mon chien?” came back with the English pets clause first. On Canner, pgvector needs the Dedicated Postgres add-on; the full pipeline with chunking and hybrid search is in RAG with pgvector.
-- Needs the vector extension (Dedicated Postgres: canner db extensions <db> install vector)
CREATE TABLE passages (
id bigserial PRIMARY KEY,
lang text NOT NULL, -- 'en' or 'fr'
content text NOT NULL,
embedding vector(1024) NOT NULL
);
CREATE INDEX ON passages USING hnsw (embedding vector_cosine_ops);
-- $1 = the question's embedding, as '[0.012, -0.034, ...]'
SELECT lang, content, 1 - (embedding <=> $1) AS similarity
FROM passages
ORDER BY embedding <=> $1
LIMIT 3;English and French: what we measured
We embedded six English sentences, their French translations, and four questions, in one request, and compared every pair. These are our own sentences, so treat the numbers as an illustration, not a benchmark.
- Every sentence’s nearest neighbour in the other language was its translation. Six out of six.
- The question’s own language scores slightly higher. Both versions of the right passage beat everything else, but the same-language one came first each time. If your documents exist in both languages, you will usually get both back; deduplicate by document, not by passage.
- Don’t use a fixed threshold. An unrelated pair reached 0.649, while the correct passage for “How do I stop my plan?” (the cancellation clause) scored only 0.506 and its French version fell outside the top three. Rank results and keep the top few, then let a chat model or a person decide.
- Paraphrases are the weak spot. Questions that share no words with the answer (“stop my plan” vs “cancel your subscription”) get much lower scores than questions that do. Adding Postgres full-text search with the right
englishorfrenchconfiguration helps on exact terms; it can’t help on paraphrase.
| Comparison | Cosine similarity |
|---|---|
| A sentence and its translation (6 pairs) | 0.878 to 0.932 |
| An English sentence and an unrelated French one (30 pairs) | 0.338 to 0.649 |
| “Can I bring my dog?” → English pets clause / French pets clause | 0.720 / 0.690 |
| “Quand dois-je payer le loyer?” → French rent clause / English rent clause | 0.787 / 0.758 |
Other embedding models, from their own pages
Dimensions decide the column width and index size. pgvector indexes vector up to 2,000 dimensions and halfvec up to 4,000, so models with 3,072 dimensions need a shorter output or halfvec (pgvector). Vectors from different models can’t be compared: switching models means re-embedding everything.
- Prices aren’t in the table. They change often; check each vendor.
- Longer input limits don’t replace chunking. One vector for a 100-page document averages away the passage you want to find. Embed passages of a few hundred words whatever the limit.
| Model | Dimensions | Max input | Licence | How you run it |
|---|---|---|---|---|
BAAI bge-m3 † | 1,024 | 8,192 tokens | MIT | Open weights; or Canner’s AI endpoints in Montréal |
intfloat multilingual-e5-large † | 1,024 | 512 tokens | MIT | Open weights; needs query: / passage: prefixes |
Qwen Qwen3-Embedding-0.6B † | Up to 1,024 (32 to 1,024) | 32K tokens | Apache 2.0 | Open weights |
OpenAI text-embedding-3-small / -large † | 1,536 / 3,072 (shorter with dimensions) | 8,192 tokens | Proprietary | OpenAI’s API |
Cohere embed-v4.0 † | 256, 512, 1,024 or 1,536 | 128K tokens | Proprietary | Cohere’s API |
Google gemini-embedding-001 † | 128 to 3,072 (default 3,072) | 2,048 tokens | Proprietary | Gemini API |
† Competitor details come from each vendor’s own published pages on the dates shown; prices and plans change, so check the vendor before you decide. BAAI `bge-m3` (2026-11-23) · intfloat `multilingual-e5-large` (2026-11-23) · Qwen `Qwen3-Embedding-0.6B` (2026-11-23) · OpenAI `text-embedding-3-small` / `-large` (2026-11-23) · Cohere `embed-v4.0` (2026-11-23) · Google `gemini-embedding-001` (2026-11-23)
When bge-m3 on Canner is the wrong fit
The models run on processors, one request at a time across the service. Embedding a short text takes about a second or less once it’s your turn, and a batch of 128 is far cheaper in queue time than 128 calls. That suits steady ingestion and search queries. It doesn’t suit re-embedding millions of passages in an afternoon: run that on a GPU or a provider built for volume, with the same model if you want to keep your vectors comparable. Usage is measured in model time against a monthly allowance per plan; see AI endpoints for current allowances.
The endpoint takes text only. Images and scanned PDFs need OCR first. Embed in a background job, not in the request that uploads the document (background jobs).
Questions
How many dimensions does bge-m3 have?
1,024 for its dense vectors, per BAAI’s model card. Canner’s endpoint returns exactly 1,024 and doesn’t accept a dimensions parameter, so the pgvector column is vector(1024).
What is the maximum input length of bge-m3?
8,192 tokens per text. Canner’s endpoint refuses a longer text with an error instead of truncating it, so split documents into passages first.
Does Canner’s bge-m3 endpoint return sparse or ColBERT vectors?
No. It returns dense embeddings only, in the OpenAI format. For the lexical side of hybrid search, use Postgres full-text search next to pgvector.
Can I search French documents with an English question?
Yes. In our test every English sentence’s closest French sentence was its translation, and questions found the right passage in both languages. The question’s own language scores slightly higher, so expect both versions of a bilingual document near the top.
Are bge-m3 embeddings normalised?
Canner’s are: we measured a length of 1.000000. The dot product then equals the cosine similarity, and cosine and inner-product indexes rank results the same way.
Related
- GuideAIDA is dead: what governs AI in Canada now
- GuideCPU-only LLM inference: what’s realistic
- GuideHost a remote MCP server
- GuideA support chatbot that answers from your docs
- GuideContent moderation and spam filtering with calibrated labels
- GuideRelated articles, recommendations and reranking
Embeddings that stay in Montréal.
Create an AI endpoint with bge-m3, attach it to a project, and store the vectors in your own Postgres.