{"record":{"id":"5bcfe089af0a7ee1","repo":"Fosowl/agenticSeek","slug":"unknown-provider-provider-name","errorCode":null,"errorMessage":"Unknown provider: {provider_name}","messagePattern":"Unknown provider: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sources/llm_provider.py","lineNumber":48,"sourceCode":"            \"openai\": self.openai_fn,\n            \"lm-studio\": self.lm_studio_fn,\n            \"huggingface\": self.huggingface_fn,\n            \"google\": self.google_fn,\n            \"deepseek\": self.deepseek_fn,\n            \"together\": self.together_fn,\n            \"dsk_deepseek\": self.dsk_deepseek,\n            \"openrouter\": self.openrouter_fn,\n            \"anthropic\": self.anthropic_fn,\n            \"minimax\": self.minimax_fn,\n            \"litellm\": self.litellm_fn,\n            \"test\": self.test_fn\n        }\n        self.logger = Logger(\"provider.log\")\n        self.api_key = None\n        self.internal_url, self.in_docker = self.get_internal_url()\n        self.unsafe_providers = [\"openai\", \"deepseek\", \"dsk_deepseek\", \"together\", \"google\", \"openrouter\", \"anthropic\", \"minimax\"]\n        if self.provider_name not in self.available_providers:\n            raise ValueError(f\"Unknown provider: {provider_name}\")\n        if self.provider_name in self.unsafe_providers and self.is_local == False:\n            pretty_print(\"Warning: you are using an API provider. You data will be sent to the cloud.\", color=\"warning\")\n            self.api_key = self.get_api_key(self.provider_name)\n        elif self.provider_name != \"ollama\":\n            pretty_print(f\"Provider: {provider_name} initialized at {self.server_ip}\", color=\"success\")\n\n    def get_model_name(self) -> str:\n        return self.model\n\n    def get_api_key(self, provider):\n        load_dotenv()\n        api_key_var = f\"{provider.upper()}_API_KEY\"\n        api_key = os.getenv(api_key_var)\n        if not api_key:\n            raise ValueError(\n                f\"API key {api_key_var} not found in .env file. \"\n                \"Please add it to your .env file and restart the server.\"\n            )","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/Fosowl/agenticSeek/blob/ae57a2357745a9706cb12d0fd76d954c84d166fa/sources/llm_provider.py#L30-L66","documentation":"LLMProvider.__init__ validates the `provider_name` argument against its `available_providers` dict and raises this ValueError if the name is not registered. It is a configuration-time guard: no network calls or API keys are touched, the provider simply is not supported/known to this library version.","triggerScenarios":"Instantiating LLMProvider('gpt4') or any name not exactly matching a key in available_providers; passing a provider added in a newer version while running an older checkout; case/spacing mistakes ('OpenAI' vs 'openai'); misspelling local providers like 'ollama'.","commonSituations":"Typos or wrong casing in config files/env-driven provider selection; upgrading the app but not the library so a newly supported provider is unknown; copying a provider name from another tool (e.g. 'azure-openai') that this library does not define.","solutions":["Use one of the exact keys in available_providers (e.g. 'openai', 'deepseek', 'dsk_deepseek', 'together', 'google', 'openrouter', 'anthropic', 'minimax', 'ollama').","Inspect provider.available_providers (or the class source) to list valid names before instantiating.","Update the library to the latest version if the provider you need was added recently.","Fix casing/whitespace in the provider string from your config or environment."],"exampleFix":"// before\nprovider = LLMProvider(\"chatgpt\")  # ValueError: Unknown provider: chatgpt\n// after\nprovider = LLMProvider(\"openai\")  # exact key from available_providers","handlingStrategy":"validation","validationCode":"available = set(LLMProvider.__init__.__code__.co_consts)  # or read provider.available_providers on an instance/docs\nname = (config[\"provider\"] or \"\").strip().lower()\nif name not in available:\n    raise ValueError(f\"provider must be one of {sorted(available)}, got {name!r}\")","typeGuard":"def is_known_provider(name, known: set) -> bool:\n    return isinstance(name, str) and name.strip().lower() in known","tryCatchPattern":"try:\n    provider = LLMProvider(requested)\nexcept ValueError as e:\n    logger.warning(f\"{e} - falling back to ollama\")\n    provider = LLMProvider(\"ollama\")","preventionTips":["Centralize the provider name in one config constant instead of scattering literals.","Validate provider names at startup with a fail-fast check against available_providers.","Always lowercase/strip provider strings coming from env/config files.","Pin the library version and check its release notes when adding a new provider."],"tags":["configuration","validation","llm","python"],"backgroundTag":"unknown-provider","analyzedSha":"ae57a2357745a9706cb12d0fd76d954c84d166fa","analyzedAt":"2026-08-30T02:49:05.834Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}