Embedding converts text into binary vectors for encrypted storage and search. The embed_len dimension must match the value set on your ExecutionContext.
Supported providers:
- Ollama — local, no API key required
- Sentence Transformers — local, models downloaded from Hugging Face (requires the
[embedding]extra) - OpenAI — cloud-based
INFERENCE_API_KEY environment variable is read automatically when api_key is not passed explicitly.
Ollama
Sentence Transformers
Models are downloaded from Hugging Face on first use. See the pretrained models list for available models. Requirespip install "xtrace-ai-sdk[embedding]".
OpenAI
Set your OpenAI API key via theINFERENCE_API_KEY environment variable or pass it directly as api_key.
Bring your own vectors
If you already have float vectors from another source, convert them to the binary format XTrace expects usingEmbedding.float_2_bin. The length of the resulting list must match embed_len on your homomorphic client.