New Tool Radar

Local AI

How to Run mxbai-embed-large with Ollama for English Search

Run mxbai-embed-large locally with Ollama and get high-quality English retrieval for short documents.

Schematic illustration with three step boxes for How to Run mxbai-embed-large with Ollama for English Search.

mxbai-embed-large is Mixedbread’s 335M-parameter English embedding model with 1,024 dimensions. It scores well on English retrieval, but it has a hard 512-token input limit, so it suits short chunks. This guide pulls it, embeds a query and two short documents, and checks the match.

Before you start

  • Ollama installed and running.
  • About 1 GB of free disk for the model.
  • A terminal, and curl or Python for the API call.

Pull the model

Download the model:

ollama pull mxbai-embed-large

Keep your chunks short: anything over 512 tokens is truncated.

Embed a query and two documents

Call http://localhost:11434/api/embed with the model name and the input text. The model expects the prefix Represent this sentence for searching relevant passages: on queries.

curl http://localhost:11434/api/embed -d '{"model": "mxbai-embed-large", "input": "Represent this sentence for searching relevant passages: how to change a bicycle tyre"}'

Compare the vectors

Compare the returned 1,024-number vectors with cosine similarity. The document that answers the query should score closest.

Worked example

Sample texts:

Text Role
how to change a bicycle tyre Query
To change a bicycle tyre, release the brake, remove the wheel, lever the tyre off and fit the new one. Document A
How to bake sourdough bread at home in five steps. Document B

Document A should score much closer to the query than Document B. If B wins, check that the query prefix was included.

Expected result

UNTESTED in this guide: no API call was run while writing it. The expected result is that the embed endpoint returns a 1,024-number vector for each text, and Document A scores closer to the query than Document B.

Limitations

The 512-token limit is the main constraint: split long documents into short chunks before embedding. mxbai-embed-large is English-focused; for multilingual corpora use BGE-M3 instead. Vectors from one model cannot be compared with vectors from another.

Sources

See all