embeddings

On this page

A Module providing a unified interface for generating text embeddings — with first-class attention to Arabic text — across five backends: local sentence-transformers models, a dedicated Arabic-tuned local pipeline, and three hosted APIs (OpenAI, Google Gemini, Mistral AI), plus a fully local Ollama server backend.

[!NOTE] About this documentation This documentation was generated directly from static analysis of the embeddings package source (embeddings/*.py). Every signature, parameter, default value, and behavior described here is taken from the actual implementation. Where the implementation is ambiguous, incomplete, or appears to contain a defect, that is called out explicitly rather than guessed at — see Known Issues.

The package identifies itself only as embeddings in code (see embeddings/__init__.py); no "zerda" branding, CLI, REST API, plugin system, ORM layer, or test suite exists anywhere in the analyzed source, so those sections are not present in this documentation.

What's in the package

The package exposes eight public symbols from embeddings/__init__.py:

SymbolKindFilePurpose
BaseEmbedderAbstract base classbase_embedder.pyCommon interface, caching, stats, similarity math, async wrappers
EmbedderConfigDataclassconfig_embedder.pyCentral default-value store shared by every embedder
ArabicEmbedderConcrete embedderarabic_embedder.pyLocal sentence-transformers models with Arabic normalization
HuggingFaceEmbedderConcrete embedderhugginface_embedder.pyLocal sentence-transformers models, no Arabic preprocessing
OpenAIEmbedderConcrete embedderopenai_embedder.pyOpenAI Embeddings API (text-embedding-3-*, ada-002)
GeminiEmbedderConcrete embeddergemini_embedder.pyGoogle google-genai Embeddings API
MistralEmbedderConcrete embeddermistral_embedder.pyMistral AI Embeddings API
OllamaEmbedderConcrete embedderollama_embedder.pyLocal Ollama server, no API key

All five concrete embedders subclass BaseEmbedder and implement the same two required members: encode() and the embedding_dim property. This means any embedder can generally be swapped for another without changing calling code, modulo constructor arguments (API keys, etc.).

Where to go next