Skip to content

Concept

Vector size

/embed and /embed/batch return one vector per item. The optional dimension parameter sets how many values each vector has. Allowed values are 128, 256 and 384. The default is 128.

dimensionBytes per vector1 million items (raw)
128 (default)512 B~512 MB
2561 KB~1 GB
3841.5 KB~1.5 GB

Sizes assume each value is stored as a 32-bit float. Your vector database adds its own indexing overhead on top.

Setting it

Leave dimension out to get the default:

Python
resp = requests.post(f"{BASE}/embed", headers=headers,
    json={"items": menu_items})

data = resp.json()
data["dimension"]   # 128
data["count"]       # number of items embedded

Pass it to pick another size:

Python
resp = requests.post(f"{BASE}/embed", headers=headers,
    json={"items": menu_items, "dimension": 256})

The response's dimension field always tells you the size of the vectors you got back.

Keep one size per index

Vectors can only be compared with vectors of the same size. Pick one value for a catalog and use it for every item you store and every query you embed against it. If you change the value later, re-embed the whole catalog.

Where it applies

dimension exists only on /embed and /embed/batch, where you store the vectors yourself. /search, /classify, /match, /suggest, /dedup and /report take text and handle the comparison for you, so there's nothing to set on those. /search can also take corpus_embeddings you got from /embed; see Search integration.