← Code

embeddings.js logo

await embeddings("Hello World!") returns an embedding. It ran a small local model by default, switched to OpenAI or Mistral with an API key, and cached results so the same text was never embedded twice.

Part of ai.js, which put my AI libraries behind one toolkit.