embeddings.js
Text embeddings from a local model, OpenAI or Mistral behind one function, with caching.

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.