Skip to main content
Infino is bring-your-own-embeddings: it does not call an embedding model for you. You compute vectors with whatever model you like, store them in a vector column, and Infino builds the vector index over them.

The pattern

  1. Declare a fixed-width vector column whose dimension matches your model’s output.
  2. Declare a vector index on it with the same dimension and a distance metric.
  3. Embed your text and append the vectors alongside the rows.
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("all-MiniLM-L6-v2")   # 384-dim
def embed(text): return model.encode(text).tolist()

# dim (384) must match the model and the index spec:
docs = db.create_table(
    "docs", schema,
    infino.IndexSpec().fts("body").vector("embedding", 384, 64, "cosine"),
)
docs.append([{"doc_id": "1", "body": text, "embedding": embed(text)}])
Embed your queries with the same model at search time, and pass the query vector to vector_search (see Search).

Choosing a metric

Match the index metric to how your embeddings are produced:
MetricUse when
cosineembeddings are normalized (most sentence-transformer and OpenAI models)
l2sqyou want squared Euclidean distance
negdotyou want dot-product similarity over unnormalized vectors

See also

Last modified on June 29, 2026