Skip to content

Commit 6eef165

Browse files
committed
chore: address few nits
Signed-off-by: Krishna Gupta <Krishnagupta.kg2k6@gmail.com>
1 parent 62c3fd5 commit 6eef165

1 file changed

Lines changed: 16 additions & 12 deletions

File tree

docs/proposals/KEP#0001.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ creation-date: 2025-06-02
88

99
# KEP: Katib (Optimizer) Client Support for kubeflow-mcp-server
1010

11+
> **Terminology**: This document uses "Katib" when referring to the Kubeflow
12+
> product and "optimizer" when referring to the `kubeflow_mcp.optimizer` module.
13+
1114
## Summary
1215

1316
The Kubeflow MCP Server exposes Kubeflow Training operations as
@@ -18,9 +21,9 @@ workflow -- remains inaccessible through MCP.
1821

1922
This KEP proposes implementing the **Optimizer client module** for
2023
`kubeflow-mcp-server`, exposing Katib's Experiment, Trial, and Suggestion
21-
lifecycle as 16 MCP tools across 5 categories. This implements the
22-
"Optimizer (Planned: Phase 2)" node already identified in the architecture
23-
and stub module (`kubeflow_mcp.optimizer`).
24+
lifecycle as 17 MCP tools across 5 categories. This implements the
25+
Phase 2 optimizer node (module: `kubeflow_mcp.optimizer`) already identified
26+
in the architecture (see Architecture Context below).
2427

2528
Katib is the natural second client after TrainerClient because hyperparameter
2629
tuning is the immediate next step after training infrastructure is in place,
@@ -47,7 +50,7 @@ The existing stub (`kubeflow_mcp.optimizer`) declares 8 planned tools with
4750
```
4851
CLIENT_MODULES = {
4952
"trainer": "kubeflow_mcp.trainer", # Phase 1: Implemented (23 tools)
50-
"optimizer": "kubeflow_mcp.optimizer", # Phase 2: This KEP (16 tools)
53+
"optimizer": "kubeflow_mcp.optimizer", # Phase 2: This KEP (17 tools)
5154
"hub": "kubeflow_mcp.hub", # Phase 3: Planned
5255
}
5356
```
@@ -69,7 +72,7 @@ and namespace enforcement infrastructure.
6972

7073
## Goals
7174

72-
1. Implement 16 MCP tools across 5 categories for Katib experiment, trial,
75+
1. Implement 17 MCP tools across 5 categories for Katib experiment, trial,
7376
and suggestion lifecycle (see MCP Tools tables)
7477
2. Decompose experiment creation into agent-friendly tools, following the
7578
trainer's `fine_tune`/`run_custom_training`/`run_container_training` pattern
@@ -186,6 +189,7 @@ in `common/utils.py`. Lazy import -- `kubeflow.katib` is only imported when
186189

187190
All read-only tools: `readOnlyHint=True`, `idempotentHint=True`.
188191
Mutating tools: `create_*` are not idempotent; `delete_experiment` is destructive; `update_experiment` is idempotent.
192+
`wait_for_experiment`: `readOnlyHint=True`, blocking. Default `polling_interval=15s`, `timeout_seconds` capped at 3600s. Agents should prefer `get_experiment_status()` for non-blocking polling.
189193

190194
`list_suggestions`, `update_experiment`, `get_experiment_events`, and
191195
`katib_pre_flight` use `CustomObjectsApi`/`CoreV1Api` directly where the SDK
@@ -195,7 +199,7 @@ lacks coverage, following the trainer's pattern for suspend/resume.
195199

196200
| Persona | Optimizer Tools |
197201
|---------|----------------|
198-
| `readonly` | All read-only tools (12 tools: planning + discovery + monitoring) |
202+
| `readonly` | All read-only tools (13 tools: planning + discovery + monitoring) |
199203
| `data-scientist` | readonly + `create_hpo_experiment`, `wait_for_experiment`, `delete_experiment` (MCP-owned only) |
200204
| `ml-engineer` | data-scientist + `create_experiment_from_spec`, `update_experiment` |
201205
| `platform-admin` | all (wildcard) |
@@ -211,10 +215,9 @@ TOOL_PHASES.update({
211215
],
212216
"optimizer_optimization": [
213217
"create_hpo_experiment", "create_experiment_from_spec",
214-
"get_best_trial",
215218
],
216219
"optimizer_monitoring": [
217-
"get_experiment_trials", "get_suggestion",
220+
"get_experiment_trials", "get_best_trial", "get_suggestion",
218221
"wait_for_experiment", "get_experiment_trial_logs",
219222
"get_experiment_events",
220223
],
@@ -226,7 +229,7 @@ PHASE_TO_SECTION = {
226229
"optimizer_discovery": None,
227230
"optimizer_optimization": "optimization",
228231
"optimizer_monitoring": "monitoring",
229-
"optimizer_lifecycle": "monitoring",
232+
"optimizer_lifecycle": "monitoring", # lifecycle instructions folded into monitoring section
230233
}
231234
```
232235

@@ -372,8 +375,9 @@ client modules.
372375

373376
Agent may assume trainer tools are available during optimizer workflows.
374377

375-
**Mitigation**: `katib_pre_flight` checks trainer client availability.
376-
Cross-client hints only injected when both modules are active.
378+
**Mitigation**: `katib_pre_flight` reports whether the trainer client is
379+
loaded (see Cross-Client Integration). Cross-client hints only injected
380+
when both modules are active.
377381

378382
## Testing Plan
379383

@@ -410,7 +414,7 @@ Cross-client hints only injected when both modules are active.
410414

411415
### MCP Inspector
412416

413-
- All 16 tools in registry with correct descriptions and annotations
417+
- All 17 tools in registry with correct descriptions and annotations
414418
- Progressive mode discovery matches `TOOL_PHASES`
415419

416420
## References

0 commit comments

Comments
 (0)