zylon-ai/private-gpt · error · ValueError

Embedding model config '{target_model}' not found. Available

Error message

Embedding model config '{target_model}' not found. Available: {available}

What it means

ValueError from EmbeddingComponent.get_config when target_model resolves to a name that has no entry in the embed_models config dict. The message lists the available config keys (list(self.embed_models.keys())), which may differ from the registry aliases shown by get_embed — a model can be instantiated (registry hit) yet lack a config entry, so the two errors are not interchangeable.

Source

Thrown at private_gpt/components/embedding/embedding_component.py:136

    def get_alias(self, model_id: str | None = None) -> str | None:
        target_model = model_id or self._default_model_id
        if not target_model:
            return None
        aliases = self.registry.get_aliases(target_model)
        return aliases.pop() if aliases else None

    def get_config(self, model_id: str | None = None) -> EmbeddingModelConfig:
        target_model = model_id or self._default_model_id

        if not target_model:
            raise ValueError(
                "No embedding model specified and no models are configured"
            )

        model_config = self.embed_models.get(target_model)
        if not model_config:
            available = list(self.embed_models.keys())
            raise ValueError(
                f"Embedding model config '{target_model}' not found. Available: {available}"
            )

        return model_config

    @property
    def embedding_model(self) -> BaseEmbedding:
        return self.get_embed()

    @property
    def alias(self) -> str | None:
        return self.get_alias()

    @property
    def config(self) -> EmbeddingModelConfig:
        return self.get_config()

View on GitHub (pinned to 4a030776a3)

Solutions

  1. Use one of the keys printed in 'Available: [...]'
  2. Add a matching entry for the model under embed_models in embedding settings
  3. Keep registry aliases and embed_models keys in sync when models are registered programmatically
  4. Prefer component.get_embed()/get_alias() when you only need the model instance, not its config

Example fix

# before
cfg = component.get_config('old-name')  # ValueError: config not found

# after
cfg = component.get_config(list(component.embed_models)[0])
Defensive patterns

Strategy: validation

Validate before calling

keys = list(component.embed_models)
if target_model not in keys:
    raise ValueError(f'no config for {target_model!r}; available keys: {keys}')

Try / catch

try:
    cfg = component.get_config(model_id)
except ValueError as e:
    if 'model config' in str(e) and 'Available:' in str(e):
        cfg = component.get_config(list(component.embed_models)[0])
    else:
        raise

Prevention

When it happens

Trigger: Calling get_config(model_id) with a name not present in the configured embedding models mapping; or a default model whose id is registered in the registry but was never added to embed_models (e.g. programmatically registered models).

Common situations: Registering models at runtime without a matching config entry; renaming a model in the models list while callers still request config by the old key; inconsistency between registry aliases and settings keys.

Related errors


AI-assisted analysis of zylon-ai/private-gpt@4a030776a3 (2026-08-15). Data as JSON: /api/errors/fc3a8a239ad03d01. Report an issue: GitHub.