-
Notifications
You must be signed in to change notification settings - Fork 51
docs: Document runpodctl model commands, model-remove endpoint safety, and serverless update model flags #710
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: main
Are you sure you want to change the base?
Changes from all commits
89cca90
88e40ad
47ed281
53d35d4
ccfe15c
861b254
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,9 @@ | ||
| --- | ||
|
Check warning on line 1 in runpodctl/reference/runpodctl-config.mdx
|
||
| title: "config" | ||
| sidebarTitle: "config" | ||
| --- | ||
|
|
||
| Configure the Runpod CLI with your API credentials and API URL to enable programmatic access to your Runpod resources. | ||
|
|
||
| <RequestExample> | ||
| ```bash Command | ||
|
|
@@ -13,7 +13,7 @@ | |
|
|
||
| ## Example | ||
|
|
||
| Configure the CLI with your API key: | ||
|
|
||
| ```bash | ||
| runpodctl config --apiKey "your-api-key-here" | ||
|
|
@@ -35,6 +35,22 @@ | |
| The Runpod API endpoint URL. The default value should work for most users. | ||
| </ResponseField> | ||
|
|
||
| ## Environment variables | ||
|
|
||
| You can also configure the CLI using environment variables. When set, these take precedence over the corresponding values in your config file. | ||
|
|
||
| <ResponseField name="RUNPOD_API_KEY" type="string"> | ||
| Your Runpod API key. Overrides the `apiKey` value in your config file. | ||
| </ResponseField> | ||
|
|
||
| <ResponseField name="RUNPOD_GRAPHQL_URL" type="string"> | ||
| The Runpod GraphQL API endpoint URL. Overrides the `apiUrl` value in your config file. | ||
| </ResponseField> | ||
|
|
||
| <ResponseField name="RUNPOD_API_URL" type="string"> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Verified against |
||
| The Runpod REST API endpoint URL. Overrides the `restApiUrl` value in your config file. | ||
| </ResponseField> | ||
|
|
||
| ## Related commands | ||
|
|
||
| - [`runpodctl doctor`](/runpodctl/reference/runpodctl-doctor) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,151 @@ | ||
| --- | ||
|
Check warning on line 1 in runpodctl/reference/runpodctl-model.mdx
|
||
| title: "model" | ||
| sidebarTitle: "model" | ||
| --- | ||
|
|
||
| Manage models in the Runpod model repository. Use these subcommands to upload model files, list your models, and remove models or individual model versions. | ||
|
|
||
| <RequestExample> | ||
| ```bash Command | ||
| runpodctl model <subcommand> [flags] | ||
| ``` | ||
| </RequestExample> | ||
|
|
||
| ## Subcommands | ||
|
|
||
| ### Add a model | ||
|
|
||
| Add a model to the model repository. You can add a model in two ways: by uploading model files from your local machine, or by mirroring an existing Hugging Face model server-side. | ||
|
|
||
| To upload model files from your local machine, point `--model-path` at the directory that contains them: | ||
|
|
||
| ```bash | ||
| runpodctl model add --name "my-model" --owner "my-team" --model-path ./model | ||
| ``` | ||
|
|
||
| When you upload from a directory in a terminal, `runpodctl` shows a progress bar with upload progress and estimated time remaining, then prints the total model size once the upload finishes. | ||
|
|
||
| If you reuse one local directory across model versions without this flag, a later upload can include a mix of old and new files. Add `--delete-my-model-files-after-upload` to remove exactly the files this run uploaded from `--model-path` once the model version is confirmed deployable server-side. It never touches unrelated files, and it runs only after the version is confirmed deployable, so an upload that fails or whose deployable confirmation times out leaves your files in place. This flag requires both `--model-path` and `--wait-for-hash`. | ||
|
Check warning on line 28 in runpodctl/reference/runpodctl-model.mdx
|
||
|
|
||
| ```bash | ||
| runpodctl model add --name "my-model" --owner "my-team" --model-path ./model --wait-for-hash --delete-my-model-files-after-upload | ||
| ``` | ||
|
|
||
| To mirror an existing Hugging Face model into the Runpod model repository, use `--huggingface-model` with the source model in `owner/repo` form. `--name` sets the destination model name in the Runpod repository, and `--owner` is optional when mirroring. | ||
|
|
||
| The transfer runs server-side, so there is no local upload session, file upload, or progress bar. Runpod creates the new model version right away and transfers the files from Hugging Face in the background. | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: |
||
| Mirroring cannot be combined with the local-upload flags (`--model-path`, `--create-upload`, `--file-name`, `--file-size`, `--part-size`, `--content-type`, and `--wait-for-hash`). Uploading and mirroring are two separate ways to add a model. | ||
|
Check warning on line 38 in runpodctl/reference/runpodctl-model.mdx
|
||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Documented that |
||
|
|
||
| ```bash | ||
| runpodctl model add --name tiny-llm --huggingface-model arnir0/Tiny-LLM | ||
| ``` | ||
|
|
||
| #### Add flags | ||
|
|
||
| <ResponseField name="--name" type="string"> | ||
| Model name. | ||
| </ResponseField> | ||
|
|
||
| <ResponseField name="--owner" type="string"> | ||
| Model owner namespace (a user or team owner ID). | ||
| </ResponseField> | ||
|
|
||
| <ResponseField name="--model-path" type="string"> | ||
| Directory containing the model files to upload. | ||
| </ResponseField> | ||
|
|
||
| <ResponseField name="--huggingface-model" type="string"> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Documented the new |
||
| Hugging Face model to mirror into the Runpod model repository, in `owner/repo` form. Cannot be combined with the local-upload flags (`--model-path`, `--create-upload`, `--file-name`, `--file-size`, `--part-size`, `--content-type`, and `--wait-for-hash`). | ||
| </ResponseField> | ||
|
|
||
| <ResponseField name="--wait-for-hash" type="bool" default="false"> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Documented the new Source: https://github.com/runpod/runpodctl/pull/302/files |
||
| Wait until the uploaded model version is deployable before the command returns; despite the flag name, the wait is for deployability, not just for the file hash. Requires `--model-path`. Once the version is confirmed deployable, `runpodctl` prints a confirmation message, along with the model's URL. | ||
| </ResponseField> | ||
|
|
||
| <ResponseField name="--hash-timeout" type="duration" default="30m0s"> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Documented the new Source: https://github.com/runpod/runpodctl/pull/302/files |
||
| Maximum time to wait when `--wait-for-hash` is set. Set to `0` to wait indefinitely. | ||
| </ResponseField> | ||
|
|
||
| <ResponseField name="--delete-my-model-files-after-upload" type="bool" default="false"> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. runpodctl/reference/runpodctl-model.mdx:70-70 at 53d35d4 Documented the |
||
| Delete the uploaded `--model-path` files after the model version is confirmed deployable server-side. Only the files this run uploaded are deleted, including nested subdirectories, and only after the version is confirmed deployable. If that confirmation times out or fails, no files are deleted. | ||
|
|
||
| Requires both `--model-path` and `--wait-for-hash`. Both are validated before the upload begins, so the command fails immediately if either is missing. | ||
|
|
||
| If a specific file cannot be deleted, the command exits non-zero and names that file, so there is no silent partial success. A stderr confirmation line prints once at least one file has been deleted. The `deletedModelFiles` (count) and `deletedModelFilesBytes` (bytes) fields are added to the JSON output only when `--verbose`, `-v` is set. | ||
| </ResponseField> | ||
|
|
||
| <ResponseField name="--verbose, -v" type="bool" default="false"> | ||
| Include the full upload details in the `--wait-for-hash` output. Without this flag, a compact summary is printed instead. | ||
| </ResponseField> | ||
|
|
||
| <Note> | ||
|
|
||
| `runpodctl model add` also accepts lower-level flags for configuring uploads directly, such as `--content-type`, `--file-name`, `--file-size`, `--part-size`, `--metadata`, and `--model-status`. Run `runpodctl model add --help` to see the complete list. | ||
|
|
||
| </Note> | ||
|
|
||
| ### List models | ||
|
|
||
| List the models in your model repository: | ||
|
|
||
| ```bash | ||
| runpodctl model list | ||
| ``` | ||
|
|
||
| #### List flags | ||
|
|
||
| <ResponseField name="--name" type="string"> | ||
| Filter the results by model name. | ||
| </ResponseField> | ||
|
|
||
| <ResponseField name="--provider" type="string"> | ||
| Filter the results by provider. | ||
| </ResponseField> | ||
|
|
||
| ### Remove a model | ||
|
|
||
| Remove a model from the model repository: | ||
|
|
||
| ```bash | ||
| runpodctl model remove --name "my-model" --owner "my-team" | ||
| ``` | ||
|
|
||
| To remove a single model version instead of the entire model, pass either `--hash` or `--version`. This marks that version as removed and leaves the rest of the model in place. | ||
|
|
||
| ```bash | ||
| runpodctl model remove --name "my-model" --owner "my-team" --version "<version-uuid>" | ||
| ``` | ||
|
|
||
| <Warning> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Documented that |
||
|
|
||
| `runpodctl model remove` refuses to remove a model or version that a Serverless endpoint still references. Removing the whole model is refused if any version is referenced; removing a specific version with `--hash` or `--version` is refused only when that exact version is referenced. The command reports which endpoints block the removal, and nothing is deleted when a removal is refused. | ||
|
|
||
| There is no override or force flag. A model or version in active use cannot be removed until you detach or replace it on the referencing endpoint. If the dependency check cannot complete, for example when the API is unreachable, the removal is also refused, because Runpod treats an unverifiable dependency check as unsafe. | ||
|
|
||
| </Warning> | ||
|
|
||
| To clear a blocked removal, detach or replace the model on the referencing endpoint, then retry the removal. Detach the model with `runpodctl serverless update <endpoint-id> --clear-models`, or replace it with `runpodctl serverless update <endpoint-id> --model-reference <model-reference-url>`. See the [Update an endpoint](/runpodctl/reference/runpodctl-serverless#update-an-endpoint) section for details. | ||
|
|
||
| #### Remove flags | ||
|
|
||
| <ResponseField name="--name" type="string"> | ||
| Model name. | ||
| </ResponseField> | ||
|
|
||
| <ResponseField name="--owner" type="string"> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Documented the new Source: https://github.com/runpod/runpodctl/pull/302/files |
||
| Model owner. | ||
| </ResponseField> | ||
|
|
||
| <ResponseField name="--hash" type="string"> | ||
| Hash of the model version to remove. Cannot be combined with `--version`. | ||
| </ResponseField> | ||
|
|
||
| <ResponseField name="--version" type="string"> | ||
| UUID of the model version to remove. Cannot be combined with `--hash`. | ||
| </ResponseField> | ||
|
|
||
| ## Related commands | ||
|
|
||
| - [`runpodctl serverless`](/runpodctl/reference/runpodctl-serverless) | ||
| - [`runpodctl config`](/runpodctl/reference/runpodctl-config) | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (Line 208) Documented the new |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| --- | ||
|
Check warning on line 1 in runpodctl/reference/runpodctl-serverless.mdx
|
||
| title: "serverless" | ||
| sidebarTitle: "serverless" | ||
| --- | ||
|
|
@@ -75,7 +75,7 @@ | |
| --env MAX_TOKENS=4096 | ||
| ``` | ||
|
|
||
| When using `--hub-id`, GPU IDs and container disk size are automatically pulled from the Hub release config. You can override the GPU type with `--gpu-id`. Environment variables from the Hub release are included automatically, and you can override or add to them with `--env`. | ||
|
|
||
| <Note> | ||
|
|
||
|
|
@@ -165,6 +165,12 @@ | |
|
|
||
| ```bash | ||
| runpodctl serverless update <endpoint-id> --workers-max 5 | ||
|
|
||
| # Cache a model reference on the endpoint | ||
| runpodctl serverless update <endpoint-id> --model-reference https://huggingface.co/<owner>/<model>:<revision> | ||
|
|
||
| # Clear all model references from the endpoint | ||
| runpodctl serverless update <endpoint-id> --clear-models | ||
| ``` | ||
|
|
||
| #### Update flags | ||
|
|
@@ -205,6 +211,18 @@ | |
| Execution timeout in seconds. Jobs that exceed this duration are terminated. | ||
| </ResponseField> | ||
|
|
||
| Attaching model references caches the referenced models on the endpoint so workers start faster and cost less. See [Model caching](/serverless/endpoints/model-caching) for when and why to cache models. | ||
|
|
||
| <ResponseField name="--model-reference" type="string"> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Citation withdrawn. Documented the known limitation that Source: runpod/runpodctl#334 |
||
| Model reference URL to cache on the endpoint, in the same form used by `serverless create` (a Hugging Face reference like `https://huggingface.co/<owner>/<model>:<revision>`). Repeatable: use multiple `--model-reference` flags to cache several models. Replaces the endpoint's existing model references. Cannot be combined with `--clear-models`. | ||
| </ResponseField> | ||
|
|
||
| <ResponseField name="--clear-models" type="bool"> | ||
| Remove all model references from the endpoint. Cannot be combined with `--model-reference`. | ||
| </ResponseField> | ||
|
|
||
| Updating an endpoint's model references with `--model-reference` or `--clear-models` works on both GPU and CPU endpoints. On a GPU endpoint, the update preserves the endpoint's GPU selection, including any excluded GPU types, rather than widening it. The command output includes the endpoint's current model references in the `modelReferences` field, which is an empty array after `--clear-models`. | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Documented that
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Supersedes the withdrawn known-limitation citation (previously sourced to PR #334, anchored at the old line 216): PR #340 (STO-691, merged) fixes |
||
|
|
||
| ### Delete an endpoint | ||
|
|
||
| Delete an endpoint: | ||
|
|
||
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.
Documented the
RUNPOD_API_KEY,RUNPOD_GRAPHQL_URL, andRUNPOD_API_URLenvironment variables and their precedence over config values, based on the newinternal/configenv/configenv.gopackage:APIKeyEnv→apiKey,GraphQLURLEnv→apiUrl,RESTURLEnv→restApiUrl, withenvOrConfiggiving a non-empty env var priority over the config file.Source: https://github.com/runpod/runpodctl/pull/302/files