Embeds text with an embedding-capable model and returns one vector per input, in order. The input field takes either a single string or an array of strings, so single and batch embedding share one command. The vector dimension is fixed by the model. Local embedding models require a build with the local execution feature; cloud embedding providers (OpenAI, Google) require the matching provider feature and an API key.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
model | string | yes | Model spec. |
dimensions | integer | no | Truncate to this many dimensions (matryoshka), then renormalize. |
input | EmbedInput | yes | Text(s) to embed. |
input_type | InputType | no | Query vs document role for instruction-tuned embedders. |
instruction | string | no | Explicit instruction prefix override. |
normalize | boolean | no | Force L2 normalization on/off (default per-model). |
Returns
EmbeddingsResponse.
Errors
failed_precondition.engine.runtime_closednot_found.engine.branchinference.unsupported_operationinference.missing_modelinference.model_load_failedinference.local_runtime_failedinference.missing_api_keyinference.provider_unavailableinference.provider_malformed_responseinference.unsupported_providerinference.unsupported_parameterinference.registry_corrupt
Invocation
- CLI:
strata inference embed - Wire type:
inference_embed