vector

collection.set_embedding_model

Declare the embedding model a vector collection's vectors come from.

strata vector collection set-embedding-model

wire vector_set_embedding_model

Records, once, which embedding model produces this collection's vectors. A declaration, not a verification: a stored vector carries no model, so this takes the caller's word for the vectors present; from then on `text` on upsert and query is embedded with this model and no other, and a collection with no recorded model cannot embed `text` at all. A vector supplied directly is not checked against the record - it cannot be - so supplying one remains the caller's statement that the recorded model produced it. Declaring the model a collection already records is a no-op and commits nothing. Declaring a different one is refused with `failed_precondition.engine.embedding_model_mismatch`: the stored vectors came from the recorded model, so create a separate collection for the other one. The current wire response uses the collection-list output with one item.

Successful mutations return an acknowledgement of the outcome: for a state-changing write, the affected target with the mutation effect and commit facts; for mutations that produce a domain result (such as a branch or a promotion outcome), that result object.

To see the complete help for this command, run:

strata vector collection set-embedding-model --help

Example

Declare a collection's embedding model so text can be stored and searched.

strata vector collection create docs 3 --metric cosinecreated collection docs (3 dimensions, cosine)strata vector collection set-embedding-model docs openai:text-embedding-3-small  # Declared once; repeating it with the same model is a no-op.updated collection docs: embedding model openai:text-embedding-3-small

Parameters

NameTypeRequiredDescription
collectionstringyesCollection name.
modelstringyesThe model that produced, and will produce, this collection's vectors.
branchstring or nullnoTarget branch. Defaults to the executor handle branch.
spacestring or nullnoTarget product space. Defaults to `"default"`.

Returns

MutationAck

  • dataobject

    Shared pagination continuation facts.

  • typestring

Errors

Recover by code. Retry policy and commit outcome come from the shipped error registry.

← All 24 Vectors commands

agents: this page as markdown → /docs/reference/vector/collection/set_embedding_model.md