Kubeflow Katib: run a hyperparameter tuning Experiment with the Katib Python SDK (or Experiment YAML)

domain: ml-ops · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Install the Katib control plane and Katib Python SDK (`katib` package) per the installation guide
  2. Define a Python objective function that computes and prints your target metric in `<metric-name>=<metric-value>` format, and a search space with `katib.search.int(min=, max=)`, `katib.search.double(...)`, or categorical values
  3. Launch the Experiment via `KatibClient(namespace="kubeflow").tune(name=..., objective=objective, parameters=parameters, objective_metric_name="result", max_trial_count=12, resources_per_trial={"cpu": "2"})`
  4. For non-Python or more complex training code, instead package training code in a container and configure an Experiment YAML with `objective` (type maximize/minimize, objectiveMetricName), `algorithm`, `parallelTrialCount`, `maxTrialCount`, `maxFailedTrialCount`, `parameters`, and `trialTemplate`, then `kubectl create -f experiment.yaml`
  5. Wait for completion with `katib_client.wait_for_experiment_condition(name=name)` and fetch the winner with `katib_client.get_optimal_hyperparameters(name)` (or `kubectl get experiment <name> -o jsonpath='{.status.currentOptimalTrial}'`)
  6. Review all Trials and their metrics in the Katib UI

Known gotchas

Related routes

control kubeflow pipelines v2 task caching to force re-execution when needed
kubeflow.org/docs · 5 steps · unrated
Configure Airflow KubernetesExecutor with pod templates and per-task pod overrides for resource isolation
airflow.apache.org · 6 steps · unrated
Kubeflow Trainer v2: run a distributed PyTorch training job with TrainJob and the torch-distributed runtime
ml-ops · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans