conductor-oss/conductor · error · RuntimeException

llmProvider not specified: {name}

Error message

llmProvider not specified: {name}

What it means

Thrown by AIModelProvider.getModel() when the LLMWorkerInput.llmProvider field is null. The method looks up the configured AIModel by provider name, and a null name means the workflow task input did not specify which LLM provider to use. The message redundantly appends 'null' since the name is always null at this point.

Source

Thrown at ai/src/main/java/org/conductoross/conductor/ai/AIModelProvider.java:65

                boolean result = new File(payloadStoreLocation).mkdirs();
                log.info(
                        "Created directory {} ? {} for storing worker payload data",
                        payloadStoreLocation,
                        result);
                providerToLLM.put(llm.getModelProvider(), llm);
                for (String alias : llm.getProviderAliases()) {
                    providerToLLM.put(alias, llm);
                }
            } catch (Throwable t) {
                log.error("cannot init {} model, reason: {}", modelConfiguration, t.getMessage());
            }
        }
    }

    public AIModel getModel(LLMWorkerInput input) {
        String name = input.getLlmProvider();
        if (name == null) {
            throw new RuntimeException("llmProvider not specified: " + name);
        }
        AIModel model = providerToLLM.get(name);
        if (model == null) {
            throw new RuntimeException("no configuration found for: " + name);
        }
        return model;
    }

    public Consumer<TokenUsageLog> getTokenUsageLogger() {
        return usageLog -> log.info("{}", usageLog);
    }
}

View on GitHub (pinned to cf7c3e4a8a)

Solutions

  1. Add 'llmProvider' to the task's inputParameters in the workflow definition, e.g. "llmProvider": "openai"
  2. Verify the input mapping references a non-null variable, e.g. "llmProvider": "${llmProvider_input}" where the upstream task actually sets it
  3. Check the registered provider names and aliases in your ModelConfiguration beans to pick a valid value

Example fix

// before (workflow task input missing provider)
{"inputParameters": {"prompt": "Hello"}}
// after
{"inputParameters": {"prompt": "Hello", "llmProvider": "openai"}}
Defensive patterns

Strategy: validation

Validate before calling

// Before calling getModel, validate the input
if (input.getLlmProvider() == null || input.getLlmProvider().isBlank()) {
    throw new IllegalArgumentException("llmProvider must be specified in the task input");
}
AIModel model = aiModelProvider.getModel(input);

Type guard

// Guard on LLMWorkerInput
public boolean hasValidProvider(LLMWorkerInput input) {
    return input != null
        && input.getLlmProvider() != null
        && !input.getLlmProvider().isBlank();
}

Try / catch

try {
    AIModel model = aiModelProvider.getModel(input);
} catch (RuntimeException e) {
    if (e.getMessage().startsWith("llmProvider not specified")) {
        // surface a user-friendly error, mark task as failed with terminal error
        taskResult.setStatus(TaskResult.Status.FAILED_WITH_TERMINAL_ERROR);
        taskResult.setReasonForIncompletion(e.getMessage());
    } else {
        throw e;
    }
}

Prevention

When it happens

Trigger: Calling AIModelProvider.getModel(input) where input.getLlmProvider() returns null. This happens when a workflow task (e.g. LLM_TEXT_COMPLETE, LM_GENERATE) is executed without the 'llmProvider' input parameter set in the task definition or task input.

Common situations: The workflow JSON omits the llmProvider field in the task's inputParameters. The llmProvider was templated from a variable that resolved to null. The task definition was copied from an example but the provider name was never filled in.

Related errors


AI-assisted analysis of conductor-oss/conductor@cf7c3e4a8a (2026-08-14). Data as JSON: /api/errors/7b18151396f53a2f. Report an issue: GitHub.