Semantic Embedder

Turn text into on-device vectors and compare their meaning.

This API is in an early developer trial. Use Chrome Canary and enable #semantic-embedder-api in chrome://flags. The shape of the API may still change.
1

Configuration

Under discussion

An optional hint to optimize embedding quality for a use case. Browsers may safely ignore it.

Advanced Session Configuration
Use Abort Signal for Cancellations
2

Check Availability

View Initialization Code
3

Create Session

Initialize the embedder with the configuration defined above. The model downloads on first use.

View Session Creation Code
4

The Input

3 input(s)

One input embeds a single string; two or more are sent as a batch in a single embed() call. The API does not chunk for you — keep each passage within the model's token limit.

1
2
3
5

Execution

View Execution Code
Execution Output
Generate embeddings to see the vectors.