{"record":{"id":"4ae60debff1a5d32","repo":"zylon-ai/private-gpt","slug":"embedding-mode-mode-is-not-supported-availabl","errorCode":null,"errorMessage":"Embedding mode '{mode}' is not supported. Available: {available}","messagePattern":"Embedding mode '(.+?)' is not supported\\. Available: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":400,"severity":"error","filePath":"private_gpt/components/embedding/factories/factory.py","lineNumber":31,"sourceCode":"}\n\n\ndef register_embedding(mode: str, provider: EmbeddingProvider) -> None:\n    _PROVIDERS[mode] = provider\n\n\nclass EmbeddingFactoryRegistry:\n    \"\"\"Registry of embedding factories by mode.\"\"\"\n\n    def __init__(self, settings: Settings):\n        self._factories: dict[str, EmbeddingFactory] = {\n            mode: provider(settings) for mode, provider in _PROVIDERS.items()\n        }\n\n    def get_factory(self, mode: str) -> EmbeddingFactory:\n        if mode not in self._factories:\n            available = \", \".join(sorted(self._factories)) or \"none\"\n            raise ValueError(\n                f\"Embedding mode '{mode}' is not supported. Available: {available}\"\n            )\n        return self._factories[mode]\n","sourceCodeStart":13,"sourceCodeEnd":35,"githubUrl":"https://github.com/zylon-ai/private-gpt/blob/4a030776a31a901ad80b1bf4d7faa2c1a367efbb/private_gpt/components/embedding/factories/factory.py#L13-L35","documentation":"ValueError from EmbeddingFactoryRegistry.get_factory when the requested embedding mode string has no factory. Factories are pre-instantiated at registry construction from _PROVIDERS (built-ins: 'openai' and 'mock') plus anything added via register_embedding(); the message joins the sorted keys, or 'none' if the table is empty. A mode with no installed dependencies may fail at registration time, shrinking the available set.","triggerScenarios":"Calling get_factory(mode) with a mode not in the provider table — e.g. 'openai-like', 'huggingface', 'local', or a casing variant — or after register_embedding() was never called for a custom backend. Also triggered when a factory's module-level import fails so its entry is dropped.","commonSituations":"settings embedding.mode carries a value from an older release or a different distribution; plugin that registers the custom mode is not imported; users assuming OpenAILikeEmbeddingFactory is built-in because the module exists (it must be registered); typos and casing.","solutions":["Set embedding mode to one of the names in the error's Available list (built-ins: 'openai', 'mock')","For openai-like, ensure the plugin/extra that calls register_embedding('openai-like', OpenAILikeEmbeddingFactory) is installed and imported","Check exact spelling/casing of the mode string in settings","For custom factories, call register_embedding(mode, provider) before creating the registry"],"exampleFix":"# before\nfactory = registry.get_factory('openai-like')  # not registered by default\n\n# after\nfrom private_gpt.components.embedding.factories.openailike import OpenAILikeEmbeddingFactory\nregister_embedding('openai-like', OpenAILikeEmbeddingFactory)\nfactory = registry.get_factory('openai-like')","handlingStrategy":"validation","validationCode":"from private_gpt.components.embedding.factories.factory import _PROVIDERS\nmode = settings.embedding.mode\nif mode not in _PROVIDERS:\n    raise ValueError(f'unsupported embedding mode {mode!r}; pick from {sorted(_PROVIDERS)}')","typeGuard":null,"tryCatchPattern":"try:\n    factory = registry.get_factory(mode)\nexcept ValueError as e:\n    if 'not supported' in str(e):\n        raise SystemExit(str(e)) from e  # config error: stop, don't fall back\n    raise","preventionTips":["Constrain embedding.mode in config schema to registered values","Import plugin modules that call register_embedding() before constructing the registry","Log available modes at startup"],"tags":["embedding","configuration","registry","factory"],"backgroundTag":null,"analyzedSha":"4a030776a31a901ad80b1bf4d7faa2c1a367efbb","analyzedAt":"2026-08-15T03:51:26.951Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}