capabilities.work

Embeddings Pair

A 3-step recipe with Hugging Face. We can help you get access.

Recipe · 3 steps

Embeddings Pair

with Hugging Face · Artificial Intelligence Management

Embed a query and a document with the same model for similarity comparison.

  1. List the models available through the router to confirm the requested embedding model can be served before embedding.
  2. Create an embedding vector for the query text using the requested model.
  3. Create an embedding vector for the document text using the same model so it can be compared to the query vector.
What you'll need to have ready
  • hfToken: Hugging Face access token used as a Bearer credential.
  • modelId: The embedding model id to use.
  • query: The query text to embed.
  • document: The document text to embed for comparison against the query.
For your developer

Arazzo workflow hugging-face:embeddings-pair, 3 operations: getV1Models → createEmbeddings → createEmbeddings. Specs on APIs.io.