-
Notifications
You must be signed in to change notification settings - Fork 815
[CLI] Add Inference Endpoints Commands #3428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: v1.0-release
Are you sure you want to change the base?
Conversation
from ._cli_utils import TokenOpt, get_hf_api, typer_factory | ||
|
||
|
||
logger = logging.get_logger(__name__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not related to this PR, but the logger isn't used here (same in the other command files)
|
||
|
||
@deploy_app.command(name="hub", help="Deploy an Inference Endpoint from a Hub repository.") | ||
def deploy_from_hub( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
splitted the deploy into two subcommands instead of using a flag to deploy from the Model Catalog because Typer doesn't easily allow conditional requirements (i.e., "these parameters are required unless that flag (e.g. --from-catalog
) is set"), which makes validation and type hints messy so using subcommands lets Typer enforce required options cleanly for each case
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
This PR implements a CLI to manage Inference Endpoints, this provides "one liners" to deploy/delete/update/etc. endpoints, which could be handy in many cases. The DX intentionally mirrors a bit the UI instead of the API, to quote @ErikKaum :
I explored a few layouts (e.g. a single deploy command with
--catalog
), but the cleanest UX ended up being two explicit paths:hf inference-endpoints deploy hub ...
– minimal set of hardware/task configs for Hub models.hf inference-endpoints deploy catalog ...
– one liner using optimized configs from the model catalog.happy to more iterate if there are more suggestions to make the DX better (and simpler?)