{"record":{"id":"06faa6f8708ccebf","repo":"stanford-oval/storm","slug":"no-valid-openai-api-provider-is-provided-cannot-u","errorCode":null,"errorMessage":"No valid OpenAI API provider is provided. Cannot use default LLM configurations.","messagePattern":"No valid OpenAI API provider is provided\\. Cannot use default LLM configurations\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"critical","filePath":"knowledge_storm/collaborative_storm/engine.py","lineNumber":140,"sourceCode":"                model=\"together_ai/meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo\",\n                max_tokens=500,\n                model_type=\"chat\",\n                **together_kwargs,\n            )\n            self.question_asking_lm = LitellmModel(\n                model=\"together_ai/meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo\",\n                max_tokens=300,\n                model_type=\"chat\",\n                **together_kwargs,\n            )\n            self.knowledge_base_lm = LitellmModel(\n                model=\"together_ai/meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo\",\n                max_tokens=1000,\n                model_type=\"chat\",\n                **together_kwargs,\n            )\n        else:\n            raise Exception(\n                \"No valid OpenAI API provider is provided. Cannot use default LLM configurations.\"\n            )\n\n    def set_question_answering_lm(self, model: Union[dspy.dsp.LM, dspy.dsp.HFModel]):\n        self.question_answering_lm = model\n\n    def set_discourse_manage_lm(self, model: Union[dspy.dsp.LM, dspy.dsp.HFModel]):\n        self.discourse_manage_lm = model\n\n    def set_utterance_polishing_lm(self, model: Union[dspy.dsp.LM, dspy.dsp.HFModel]):\n        self.utterance_polishing_lm = model\n\n    def set_warmstart_outline_gen_lm(self, model: Union[dspy.dsp.LM, dspy.dsp.HFModel]):\n        self.warmstart_outline_gen_lm = model\n\n    def set_question_asking_lm(self, model: Union[dspy.dsp.LM, dspy.dsp.HFModel]):\n        self.question_asking_lm = model\n","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/stanford-oval/storm/blob/fb951af7744dab086e34962e9bc6fe878e145f83/knowledge_storm/collaborative_storm/engine.py#L122-L158","documentation":"Co-STORM's default LLM setup path failed to recognize the supplied OpenAI-compatible provider (openai / azure / together), so it cannot construct any default language model and raises this exception inside __init__.","triggerScenarios":"Instantiating CollaborativeSTORM or calling from_dict with a lm_ configs dict whose 'api_type' is missing or not one of the recognized provider keys (e.g. 'openai', 'azure', 'together'), so every provider branch is skipped and the else clause fires.","commonSituations":"Typos or case differences in api_type (e.g. 'OpenAI', 'oai'), using a custom/local OpenAI-compatible endpoint without wrapping it as a dspy.LM yourself, or version changes that renamed provider keys.","solutions":["Set the provider key explicitly, e.g. lm_ = {'api_type': 'openai', 'model': 'gpt-4o-mini', 'api_key': ...} (or 'azure' / 'together' with their required fields)","Check the exact casing/spelling expected by engine.py's provider branches and match it","Alternatively skip default LLM construction: pass your own dspy.dsp.LM instances (e.g. via set_question_answering_lm) instead of the config-dict path"],"exampleFix":"// before\nlm_ = {'model': 'gpt-4o-mini', 'api_key': 'sk-...'}  # no api_type -> exception\n\n// after\nlm_ = {'api_type': 'openai', 'model': 'gpt-4o-mini', 'api_key': 'sk-...'}","handlingStrategy":"validation","validationCode":"cfg = {'api_type': 'openai', 'model': 'gpt-4o-mini', 'api_key': '...'}\nassert cfg.get('api_type') in ('openai', 'azure', 'together'), 'unsupported api_type'","typeGuard":null,"tryCatchPattern":"try:\n    engine = CollaborativeSTORM(lm_=cfg)\nexcept Exception as e:\n    if 'No valid OpenAI API provider' in str(e):\n        raise SystemExit('Fix lm_ api_type') from e\n    raise","preventionTips":["Always specify api_type in lm_ config","Keep provider keys lowercase and matching engine.py branches","Pin the knowledge-storm version so provider keys don't change silently"],"tags":["co-storm","llm-config","provider","initialization"],"backgroundTag":"missing-provider-config","analyzedSha":"fb951af7744dab086e34962e9bc6fe878e145f83","analyzedAt":"2026-08-28T11:56:54.780Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}