inference
embed
Embed one or more texts into vectors.
strata inference embeddb.ai.embed(input: 'Union[str, Sequence[str]]', *, model: 'str', dimensions: 'Optional[int]' = None, normalize: 'Optional[bool]' = None, input_type: 'Optional[str]' = None, instruction: 'Optional[str]' = None) -> 'Embeddings'wire inference_embed
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.
To see the complete help for this command, run:
strata inference embed --helphelp(db.ai.embed)
Example
No CLI example in this release.
db.ai.embed(["hello", "world"],Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| model | string | yes | Model spec. |
| request | EmbeddingsRequest | yes | Embedding request. |
Returns
EmbeddingsResponse
- dataEmbeddingsResponse
- typestring
Errors
Recover by code. Retry policy and commit outcome come from the shipped error registry.
| Code | Retry | Commit outcome |
|---|---|---|
| failed_precondition.engine.runtime_closed | never | not_started |
| not_found.engine.branch | never | not_applicable |
| inference.unsupported_operation | never | not_applicable |
| inference.missing_model | after_state_change | not_applicable |
| inference.model_load_failed | after_state_change | not_applicable |
| inference.local_runtime_failed | unknown | not_applicable |
| inference.missing_api_key | after_state_change | not_applicable |
| inference.provider_unavailable | same_request | not_applicable |
| inference.provider_malformed_response | unknown | not_applicable |
| inference.unsupported_provider | never | not_applicable |
| inference.unsupported_parameter | never | not_applicable |
| inference.registry_corrupt | never | not_applicable |