Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

fix recipe validation for hf seed endpoints

Nilay150423786cdc
diff --git a/studio/backend/routes/data_recipe/validate.py b/studio/backend/routes/data_recipe/validate.py
index 5a79b303840..f57c0441475 100644
--- a/studio/backend/routes/data_recipe/validate.py
+++ b/studio/backend/routes/data_recipe/validate.py
@@ -23,6 +23,8 @@ from loggers import get_logger
from models.data_recipe import RecipePayload, ValidateError, ValidateResponse
from utils.utils import safe_error_detail, safe_curated_detail, log_and_http_error
+from .jobs import _resolve_seed_endpoint
+
logger = get_logger(__name__)
router = APIRouter()
@@ -149,6 +151,7 @@ def validate(payload: RecipePayload, via_api_key: ViaApiKey = False) -> Validate
require_ui_session_for_local_commands(via_api_key)
_patch_local_providers(recipe)
+ _resolve_seed_endpoint(recipe)
github_source = _github_seed_source(recipe)
if github_source is not None:
diff --git a/studio/backend/tests/test_data_recipe_seed.py b/studio/backend/tests/test_data_recipe_seed.py
index 316527c2845..6a4d32b470c 100644
--- a/studio/backend/tests/test_data_recipe_seed.py
+++ b/studio/backend/tests/test_data_recipe_seed.py
@@ -430,3 +430,34 @@ def test_a_backend_executed_seed_resolves_the_endpoint_on_the_backend(monkeypatc
assert "endpoint" not in other["seed_config"]["source"]
_resolve_seed_endpoint({})
_resolve_seed_endpoint({"seed_config": "nope"})
+
+
+def test_validate_resolves_the_hf_seed_endpoint_like_jobs(monkeypatch):
+ pytest.importorskip("fastapi")
+ backend_root = Path(__file__).resolve().parent.parent
+ monkeypatch.syspath_prepend(str(backend_root))
+ monkeypatch.setenv("HF_ENDPOINT", "http://127.0.0.1:9700")
+
+ from models.data_recipe import RecipePayload
+ from routes.data_recipe import validate as validate_module
+
+ seen = {}
+ monkeypatch.setattr(validate_module, "validate_recipe", lambda recipe: seen.update(recipe))
+
+ response = validate_module.validate(
+ RecipePayload(
+ recipe = {
+ "seed_config": {
+ "source": {
+ "seed_type": "hf",
+ "path": "datasets/a/b/**/*.parquet",
+ "endpoint": None,
+ }
+ },
+ "columns": [{"column_type": "expression", "name": "x", "expr": "{{ q }}"}],
+ }
+ )
+ )
+
+ assert response.valid is True
+ assert seen["seed_config"]["source"]["endpoint"] == "http://127.0.0.1:9700"