diff --git a/docs/source/en/package_reference/cli.md b/docs/source/en/package_reference/cli.md index cb60a58732..aaf9bf562a 100644 --- a/docs/source/en/package_reference/cli.md +++ b/docs/source/en/package_reference/cli.md @@ -328,16 +328,13 @@ Deploy an Inference Endpoint from the Model Catalog. **Usage**: ```console -$ hf endpoints catalog deploy [OPTIONS] NAME +$ hf endpoints catalog deploy [OPTIONS] ``` -**Arguments**: - -* `NAME`: Endpoint name. [required] - **Options**: * `--repo TEXT`: The name of the model repository associated with the Inference Endpoint (e.g. 'openai/gpt-oss-120b'). [required] +* `--name TEXT`: Endpoint name. * `--namespace TEXT`: The namespace associated with the Inference Endpoint. Defaults to the current user's namespace. * `--token TEXT`: A User Access Token generated from https://huggingface.co/settings/tokens. * `--help`: Show this message and exit. diff --git a/src/huggingface_hub/cli/inference_endpoints.py b/src/huggingface_hub/cli/inference_endpoints.py index cfc169672d..f592a480e7 100644 --- a/src/huggingface_hub/cli/inference_endpoints.py +++ b/src/huggingface_hub/cli/inference_endpoints.py @@ -19,6 +19,10 @@ str, typer.Argument(help="Endpoint name."), ] +NameOpt = Annotated[ + Optional[str], + typer.Option(help="Endpoint name."), +] NamespaceOpt = Annotated[ Optional[str], @@ -130,13 +134,13 @@ def deploy( @catalog_app.command(name="deploy") def deploy_from_catalog( - name: NameArg, repo: Annotated[ str, typer.Option( help="The name of the model repository associated with the Inference Endpoint (e.g. 'openai/gpt-oss-120b').", ), ], + name: NameOpt = None, namespace: NamespaceOpt = None, token: TokenOpt = None, ) -> None: diff --git a/tests/test_cli.py b/tests/test_cli.py index 03abb29a36..fb725d2204 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -1344,7 +1344,6 @@ def test_deploy_from_catalog(self, runner: CliRunner) -> None: "endpoints", "catalog", "deploy", - "catalog-endpoint", "--repo", "catalog/model", ], @@ -1353,7 +1352,7 @@ def test_deploy_from_catalog(self, runner: CliRunner) -> None: api_cls.assert_called_once_with(token=None) api.create_inference_endpoint_from_catalog.assert_called_once_with( repo_id="catalog/model", - name="catalog-endpoint", + name=None, namespace=None, token=None, )