unslothai/unsloth · error · ValueError
Add a Provider connection block before running this recipe.
Error message
Add a Provider connection block before running this recipe.
What it means
ValueError raised by _validate_recipe_runtime_support when a recipe declares at least one LLM column (column_type starting with 'llm-') but the model_providers list is empty. LLM columns need a configured model provider connection to execute; with none, the recipe cannot run, so validation fails fast before a job is spawned.
Source
Thrown at studio/backend/core/data_recipe/service.py:166
)
)
return providers
def _recipe_has_llm_columns(recipe: dict[str, Any]) -> bool:
for column in recipe.get("columns", []):
if not isinstance(column, dict):
continue
column_type = column.get("column_type")
if isinstance(column_type, str) and column_type.startswith("llm-"):
return True
return False
def _validate_recipe_runtime_support(recipe: dict[str, Any], model_providers: list[Any]) -> None:
if _recipe_has_llm_columns(recipe) and not model_providers:
raise ValueError("Add a Provider connection block before running this recipe.")
def recipe_has_stdio_mcp(recipe: dict[str, Any]) -> bool:
"""True when the recipe asks for a local (stdio) MCP provider, i.e. a command
this host would run. Routes gate on it to keep that behind a UI session."""
providers = recipe.get("mcp_providers") or []
if not isinstance(providers, list):
return False
return any(
isinstance(provider, dict) and provider.get("provider_type") == "stdio"
for provider in providers
)
def build_mcp_providers(recipe: dict[str, Any]) -> list:
from data_designer.config.mcp import LocalStdioMCPProvider, MCPProvider # pyright: ignore[reportMissingImports]
# Same gate as the chat MCP path: stdio providers spawn a local subprocess,View on GitHub (pinned to 203007d190)
Solutions
- Add a Provider connection block (API key/endpoint for the model backend) in the recipe or workspace settings, then re-run.
- If calling the API programmatically, include the configured model providers in the run payload.
- Or remove/replace the LLM columns if no LLM generation is intended.
Example fix
# before
recipe = {"columns": [{"column_type": "llm-generate", "prompt": "..."}]}
run_recipe(recipe, model_providers=[])
# after
recipe = {
"columns": [{"column_type": "llm-generate", "prompt": "..."}],
"mcp_providers": [],
}
run_recipe(recipe, model_providers=[{"name": "openai", "api_key": os.environ['OPENAI_API_KEY']}]) Defensive patterns
Strategy: validation
Validate before calling
def recipe_has_llm_columns(recipe):
return any(
isinstance(c, dict) and isinstance(c.get('column_type'), str) and c['column_type'].startswith('llm-')
for c in recipe.get('columns', [])
)
assert not (recipe_has_llm_columns(recipe) and not model_providers), 'add a Provider connection first' Type guard
def recipe_has_llm_columns(recipe: dict) -> bool: ... # as above; use to branch UI/validation
Try / catch
try:
run_recipe(recipe, model_providers=providers)
except ValueError as e:
if 'Provider connection' in str(e):
prompt_user_to_add_provider(); return Prevention
- Validate LLM-column vs provider presence client-side before submit.
- Keep provider connections configured at the workspace level so recipes inherit them.
- Re-check provider connections after revoking or rotating keys.
When it happens
Trigger: Submitting a recipe with columns whose column_type is e.g. 'llm-judge' or 'llm-generate' while no Provider connection blocks exist in the runtime; providers configured at the workspace level but not passed into the run request; deleting/disconnecting all providers then re-running an old recipe.
Common situations: New users building their first recipe with an LLM column without adding a Provider connection; provider tokens revoked or connections removed after the recipe was authored; API callers constructing run payloads that omit providers.
Related errors
- This execution artifact is outside the Recipe Studio dataset
- Execution artifact path is not a dataset folder.
- Execution artifacts are no longer available.
- NeMo Data Designer Hugging Face integration is not installed
- job already running
AI-assisted analysis of unslothai/unsloth@203007d190 (2026-08-15).
Data as JSON: /api/errors/29d934de4df50b37.
Report an issue: GitHub.