Configuration

On this page

EmbedderConfig

config_embedder.py defines a single dataclass, EmbedderConfig, holding every default value referenced elsewhere in the package. It takes no required arguments — every field has a default — so EmbedderConfig() always succeeds.

Python · 4 lines
from zerda.embeddings import EmbedderConfig

config = EmbedderConfig()
config = EmbedderConfig(batch_size=64, normalize_embeddings=False)
FieldTypeDefaultUsed by (as constructor default)
model_namestr"multilingual"Not actually read as a default by any embedder constructor
deviceOptional[str]NoneNot read as a default by any embedder constructor
cache_dirOptional[str]NoneNot read as a default by any embedder constructor
batch_sizeint32BaseEmbedder, ArabicEmbedder, OllamaEmbedder
normalize_embeddingsboolTrueBaseEmbedder, ArabicEmbedder, OllamaEmbedder
max_seq_lengthint512ArabicEmbedder (as max_seq_length), BaseEmbedder/OllamaEmbedder (as max_length)
enable_preprocessingboolTrueArabicEmbedder
enable_arabic_normalizationboolTrueNot read as a default anywhere
enable_cacheboolFalseBaseEmbedder (as cache_embeddings), OllamaEmbedder
cache_sizeint10000Not read as a default anywhere (MistralEmbedder has its own literal default of 5000 for its own cache_size parameter)
show_progress_barboolFalseBaseEmbedder (as show_progress), ArabicEmbedder, OllamaEmbedder
convert_to_numpyboolTrueArabicEmbedder.encode()
skip_preprocessingboolFalseArabicEmbedder.encode()
return_valid_indicesboolFalseArabicEmbedder.encode()
extra_configDict[str, Any]{}Not read anywhere
track_processing_statsboolTrueArabicEmbedder
auto_downloadboolTrueArabicEmbedder
trust_remote_codeboolFalseArabicEmbedder
base_urlstr"http://127.0.0.1:11434"OllamaEmbedder
hoststr"localhost"Not read anywhere
portint11434Not read anywhere
embedding_modelstr"nomic-embed-text"OllamaEmbedder (as model_name)

[!NOTE] Not a global/live config As described in Architecture, each module creates its own EmbedderConfig() instance at import time and reads values from it once, to populate default argument values. There is no mechanism in the source for a single shared, mutable configuration object that affects already-constructed or not-yet-constructed embedders at runtime. To change behavior, pass constructor arguments explicitly to each embedder — that is the only configuration path that reliably works for every embedder.

Per-embedder configuration

The hosted-API and local embedders each define their own additional constructor parameters beyond what EmbedderConfig covers (API keys, rate limits, cost tracking, retry behavior, task types, model dimension overrides, etc.). These are documented on each class's own page:

Arabic normalization tables (__init__.py)

embeddings/__init__.py also defines several module-level constant tables that are not classes but are part of the public surface of the package (accessible as embeddings.__arabic_normalization__, etc., though not listed in __all__ and therefore not imported by from embeddings import *):

  • __arabic_normalization__ — list of the eight normalization pattern names used internally by ArabicEmbedder.ARABIC_NORMALIZATION_PATTERNS.
  • __valid_levels__ — human-readable descriptions of the three normalization levels (minimal, standard, aggressive).
  • __task_types_gemini__ — bilingual (Arabic/English) descriptions of the five Gemini task types, duplicated (with additional status/release_date fields) as GeminiEmbedder.TASK_TYPES.
  • __gemini_embedding_models__ — spec table for older Gemini models, duplicated (with additions) as GeminiEmbedder.MODEL_SPECS.

These four dunder-named module attributes exist only in __init__.py and appear to be reference copies of data that also lives (in expanded form) inside GeminiEmbedder and ArabicEmbedder. They are not consumed programmatically anywhere else in the source.

Related pages