Skip to content

nas: 4 new CLI commands + --group on model list (G4)#474

Open
probicheaux wants to merge 1 commit intomainfrom
peter/nas-cli
Open

nas: 4 new CLI commands + --group on model list (G4)#474
probicheaux wants to merge 1 commit intomainfrom
peter/nas-cli

Conversation

@probicheaux
Copy link
Copy Markdown
Contributor

Description

Wraps the new public API routes from the agentic-surface-area onsite plan as CLI commands. Companion backend PRs:

New CLI commands

roboflow train cancel <project>/<version> [--continue-if-no-refund]
roboflow train stop   <project>/<version>
roboflow train results <project>/<version>
roboflow model star   <model-id> [--unstar]

Plus roboflow model list -p <project> -g/--group <modelGroup> — the canonical "list NAS models per run" path. When --group is set, the list command hits the public /models endpoint with the enriched projection (hardware/latency/map5095/paretoOptimalFor/recommended) instead of walking versions via the SDK.

Adapter additions

In roboflow/adapters/rfapi.py:

  • cancel_version_training, stop_version_training
  • get_training_results
  • list_project_models (with optional group=), get_model_by_url
  • favorite_nas_model

Tests

+13 cases across test_train_handler.py and test_model_handler.py covering register, happy paths, the 409/CANNOT_CANCEL hint surfacing, the MODEL_NOT_NAS hint, the unstar flow, and the --group endpoint switch. 298/298 CLI tests pass locally; ruff check + ruff format clean.

CLI-COMMANDS.md got two new sections — Train, monitor, cancel, stop and NAS models — list, star, deploy.

E2E

Driven against staging (api.roboflow.one) on peter-robicheaux/beer-can-hackathon:

$ roboflow --json train results peter-robicheaux/beer-can-hackathon/410
  jobType: nas, modelGroup: pVYKOWUB6AUIVJMgPc7u-410-rfdetrNasGroup,
  modelCount: 52, recommendedByHardware: {gpu: ...}, mining bundle present

$ roboflow model list -p peter-robicheaux/beer-can-hackathon -g pVYKOWUB6AUIVJMgPc7u-410-rfdetrNasGroup
  53-row leaderboard table with HARDWARE / LATENCY / MAP50 / MAP5095 / REC columns

$ roboflow --json -w peter-robicheaux model star 14CwSGmGetWh6rB0EnjL
  {"success": true, ...}    ← real NAS child id from train results
$ roboflow --json -w peter-robicheaux model star 14CwSGmGetWh6rB0EnjL --unstar
  {"success": true, ...}    ← favorites map flips

$ roboflow --json train cancel peter-robicheaux/beer-can-hackathon/318
  {"error": {"message": "...", "hint": "Cancel only applies to in-flight runs..."}}
  ← 409 from server surfaces with actionable hint

E2E exposed one error-shape mismatch on the backend (flat {error: "Conflict", message: ...} lost the descriptive message through the CLI's parser); fixed in roboflow#11610 (nested {error: {message, code, type}}).

How tested

python -m pytest tests/cli/ (298 passing) + manual roboflow ... invocations against staging.

Wraps the new public API routes from the agentic-surface-area onsite plan:

  roboflow train cancel <project>/<version> [--continue-if-no-refund]
  roboflow train stop   <project>/<version>
  roboflow train results <project>/<version>
  roboflow model star   <model-id> [--unstar]

Plus extends `roboflow model list -p <project>` with `-g/--group <modelGroup>`,
the canonical "list NAS models per run" path. When --group is set, the list
command hits the public /models endpoint (full enriched projection: hardware,
latency, map5095, paretoOptimalFor, recommended ★) instead of walking versions
via the SDK.

Adapter additions in roboflow/adapters/rfapi.py:
  cancel_version_training, stop_version_training, get_training_results,
  list_project_models (with optional group), get_model_by_url,
  favorite_nas_model

Backend companions:
  - roboflow#11603 (G1, validator)
  - roboflow#11605 (G6, projection + ?group=)
  - roboflow#11610 (G2, public train cancel/stop + favorite)
  - roboflow#11612 (G3, training results)

Tests: +13 cases across test_train_handler.py and test_model_handler.py
covering register, success paths, 409 + MODEL_NOT_NAS hint surfacing,
unstar flow, and the --group endpoint switch. All 298 CLI tests pass
locally; ruff check + ruff format clean.

CLI-COMMANDS.md updated with two new sections (train lifecycle + NAS
list/star/deploy).

E2E: driven against staging (api.roboflow.one) on
peter-robicheaux/beer-can-hackathon:
  - `train results .../410` returned full NAS bundle (52 models,
    recommendedByHardware, modelGroup)
  - `model list -p ... -g <modelGroup>` rendered 53-row leaderboard
    table with HARDWARE / LATENCY / MAP50 / MAP5095 / REC columns
  - `model star 14CwSGmGetWh6rB0EnjL` → success, favorites reflected
  - `model star --unstar` flips state
  - `train cancel .../318` (finished version) → 409 surfaces hint
    "Cancel only applies to in-flight runs."

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant