stanford-oval/storm · critical · Exception

No valid OpenAI API provider is provided. Cannot use default

Error message

No valid OpenAI API provider is provided. Cannot use default LLM configurations.

What it means

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__.

Source

Thrown at knowledge_storm/collaborative_storm/engine.py:140

                model="together_ai/meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo",
                max_tokens=500,
                model_type="chat",
                **together_kwargs,
            )
            self.question_asking_lm = LitellmModel(
                model="together_ai/meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo",
                max_tokens=300,
                model_type="chat",
                **together_kwargs,
            )
            self.knowledge_base_lm = LitellmModel(
                model="together_ai/meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo",
                max_tokens=1000,
                model_type="chat",
                **together_kwargs,
            )
        else:
            raise Exception(
                "No valid OpenAI API provider is provided. Cannot use default LLM configurations."
            )

    def set_question_answering_lm(self, model: Union[dspy.dsp.LM, dspy.dsp.HFModel]):
        self.question_answering_lm = model

    def set_discourse_manage_lm(self, model: Union[dspy.dsp.LM, dspy.dsp.HFModel]):
        self.discourse_manage_lm = model

    def set_utterance_polishing_lm(self, model: Union[dspy.dsp.LM, dspy.dsp.HFModel]):
        self.utterance_polishing_lm = model

    def set_warmstart_outline_gen_lm(self, model: Union[dspy.dsp.LM, dspy.dsp.HFModel]):
        self.warmstart_outline_gen_lm = model

    def set_question_asking_lm(self, model: Union[dspy.dsp.LM, dspy.dsp.HFModel]):
        self.question_asking_lm = model

View on GitHub (pinned to fb951af774)

Solutions

  1. Set the provider key explicitly, e.g. lm_ = {'api_type': 'openai', 'model': 'gpt-4o-mini', 'api_key': ...} (or 'azure' / 'together' with their required fields)
  2. Check the exact casing/spelling expected by engine.py's provider branches and match it
  3. 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

Example fix

// before
lm_ = {'model': 'gpt-4o-mini', 'api_key': 'sk-...'}  # no api_type -> exception

// after
lm_ = {'api_type': 'openai', 'model': 'gpt-4o-mini', 'api_key': 'sk-...'}
Defensive patterns

Strategy: validation

Validate before calling

cfg = {'api_type': 'openai', 'model': 'gpt-4o-mini', 'api_key': '...'}
assert cfg.get('api_type') in ('openai', 'azure', 'together'), 'unsupported api_type'

Try / catch

try:
    engine = CollaborativeSTORM(lm_=cfg)
except Exception as e:
    if 'No valid OpenAI API provider' in str(e):
        raise SystemExit('Fix lm_ api_type') from e
    raise

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of stanford-oval/storm@fb951af774 (2026-08-28). Data as JSON: /api/errors/06faa6f8708ccebf. Report an issue: GitHub.