# gpustack-cli **Repository Path**: rxworkspace/gpustack-cli ## Basic Information - **Project Name**: gpustack-cli - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-12-04 - **Last Updated**: 2026-12-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # gpustack-cli — a command-line client for GPUStack [GPUStack](https://github.com/gpustack/gpustack) is an open-source GPU cluster manager for AI model serving. It ships a web UI, but no user-facing CLI: the `gpustack` command that comes with the server image only starts and maintains the server and worker processes on a node, and cannot reach a running cluster. `gpustack-cli` fills that gap. It talks to the same REST API the UI uses, so clusters, workers, model deployments and API keys can be managed from a terminal or a script — over SSH, in CI, or anywhere the web UI is unreachable. ## Install ```bash cargo build --release install -m 0755 target/release/gpustack-cli ~/.local/bin/gpustack-cli ``` Or with Cargo's installer: ```bash cargo install --path . ``` Requires Rust 1.82 or newer. The binary has no runtime dependencies beyond a TLS root store. ## Quick start ```bash # 1. Log in. The session token is stored in the config file. gpustack-cli login --server http://your-gpustack-host # 2. Look around. gpustack-cli cluster list gpustack-cli worker list gpustack-cli model list # 3. Create a cluster and print the command that joins a GPU node to it. gpustack-cli cluster create prod --provider Docker gpustack-cli cluster worker-command 1 --advertise-address 192.168.1.2 # 4. Deploy a model. gpustack-cli model deploy qwen3 --repo Qwen/Qwen3-0.6B --replicas 1 # 5. Follow it. gpustack-cli model instances 1 gpustack-cli model logs 1 --tail 50 # 6. Talk to it. gpustack-cli apikey create ci --scope inference gpustack-cli chat qwen3 "写一首关于 GPU 的诗" ``` ## Configuration Credentials live in `~/.config/gpustack-cli/config.toml` (override the directory with `GPUSTACK_CLI_HOME`): ```toml server = "http://your-gpustack-host" api_key = "sk-..." session_token = "eyJ..." ``` Every setting has a higher-precedence override: | Setting | Flag | Environment variable | |---------|------|----------------------| | Server URL | `--server` | `GPUSTACK_SERVER` | | API key | `--token` | `GPUSTACK_API_KEY` | | Password (login only) | `--password` | `GPUSTACK_PASSWORD` | `--password -` reads the password from stdin, which keeps it out of the process list: ```bash cat password.txt | gpustack-cli login --password - ``` The config file is written with mode `0600`. ### Two kinds of credential The GPUStack server accepts three credential kinds and picks between them in this order: HTTP Basic, the session cookie, then the API key. - **Session token** — issued by `gpustack-cli login` and stored in the config file. It carries the identity of the logged-in user, so it can do anything that user can do. It expires; re-run `gpustack-cli login` when it does. - **API key** — issued by `gpustack-cli apikey create`, with a scope of `inference`, `management` or `*`. The inference gateway authenticates by key only, so `gpustack-cli chat` needs one. The file is mode `0600` because it holds both. ## Commands ### Session | Command | Description | |---------|-------------| | `gpustack-cli login` | Log in and store the session token. Prompts for the password unless `--password` is given. | | `gpustack-cli logout` | Invalidate the session on the server and forget it locally. | | `gpustack-cli whoami` | Show the identity the current credentials resolve to. | ### Clusters | Command | Description | |---------|-------------| | `gpustack-cli cluster list` | List clusters with worker, GPU and readiness counts. | | `gpustack-cli cluster get ` | Show one cluster. | | `gpustack-cli cluster create ` | Create a cluster (`--provider`, `--description`, `--server-url`). | | `gpustack-cli cluster delete --yes` | Delete a cluster. | | `gpustack-cli cluster token ` | Print the registration token and the image to use. | | `gpustack-cli cluster worker-command ` | Print the `docker run` command that joins a worker to the cluster. | `worker-command` assembles the command from the server's own registration token, so it stays correct across GPUStack versions: ```bash gpustack-cli cluster worker-command 1 --advertise-address 192.168.1.2 ``` ### Workers | Command | Description | |---------|-------------| | `gpustack-cli worker list` | List workers with state and address. | | `gpustack-cli worker get ` | Show one worker. | | `gpustack-cli worker gpus ` | Show the GPU inventory of a worker. | ### Models | Command | Description | |---------|-------------| | `gpustack-cli model list` | List model deployments. | | `gpustack-cli model get ` | Show one deployment. | | `gpustack-cli model deploy ` | Deploy a model (see below). | | `gpustack-cli model delete --yes` | Delete a deployment. | | `gpustack-cli model instances ` | List the instances of a deployment. | | `gpustack-cli model logs ` | Show the tail of an instance's logs. | | `gpustack-cli model restart ` | Restart a deployment. | Deployment options: ```bash # Hugging Face (default) gpustack-cli model deploy qwen3 --repo Qwen/Qwen3-0.6B \ --replicas 2 --backend vllm --backend-version v0.9.0 # A single file from a repository gpustack-cli model deploy qwen3 --repo Qwen/Qwen3-0.6B --filename model.safetensors # ModelScope gpustack-cli model deploy qwen3 --source model_scope --model-scope-id Qwen/Qwen3-0.6B # Model files already on the server host gpustack-cli model deploy local --source local_path --local-path /models/qwen3 # Pin the hardware, optionally slicing an accelerator gpustack-cli model deploy qwen3 --repo Qwen/Qwen3-0.6B \ --gpu-type NVIDIA_H100_80GB_HBM3 --gpus-per-replica 1 --slice-memory 50 # Pin every GPU of one worker, for a single-node multi-GPU deployment gpustack-cli model deploy qwen3 --repo Qwen/Qwen3-0.6B \ --gpu-id worker1:cuda:0 --gpu-id worker1:cuda:1 # Backend parameters and environment variables gpustack-cli model deploy qwen3 --repo Qwen/Qwen3-0.6B \ --param max_model_len=8192 --param gpu_memory_utilization=0.9 \ --env CUDA_VISIBLE_DEVICES=0 ``` `--param` and `--env` take `KEY=VALUE` and may be repeated. A `--param` key becomes a command-line flag for the inference engine: `max_model_len=8192` is sent as `--max-model-len=8192`, and a key with no value becomes a bare `--flag`. Underscores in the key become dashes. ### API keys | Command | Description | |---------|-------------| | `gpustack-cli apikey list` | List API keys (values are masked). | | `gpustack-cli apikey create ` | Create a key (`--scope`, `--expires-in`, `--allow-model`). | | `gpustack-cli apikey delete --yes` | Delete a key. | The plain key value is shown once, at creation time: ```bash gpustack-cli apikey create ci --scope inference # Created API key ci (inference). # The key value is shown once; store it now: # sk-xxxxxxxxxxxxxxxx # Saved to the config file; `gpustack-cli chat` will use it. ``` The key is written to the config file so that `gpustack-cli chat` can use it right away. Pass `--no-save` to keep it out of the file. Scopes are `inference` (talk to models), `management` ( administer the cluster) and `*` (both). ### Inference | Command | Description | |---------|-------------| | `gpustack-cli chat ` | Send a chat completion request. | ```bash gpustack-cli chat qwen3 "explain what a KV cache is" gpustack-cli chat qwen3 "explain what a KV cache is" --stream gpustack-cli chat qwen3 --stdin < prompt.txt gpustack-cli chat qwen3 "hello" --system "you are terse" --temperature 0.2 ``` `chat` talks to the OpenAI-compatible endpoint `/v1/chat/completions` and authenticates with an API key. ## Output format Every list command defaults to an aligned table. `--output json` returns the server's raw response instead, which is what you want when piping into `jq`: ```bash gpustack-cli model list --output json | jq '.items[] | select(.state != "Running")' ``` ## Exit codes `gpustack-cli` exits `0` on success and `1` on any error, with the reason on stderr. Destructive commands (`cluster delete`, `model delete`, `apikey delete`) refuse to run without `--yes`. ## A note on the API This client is written against the GPUStack v2 REST API. Endpoint paths and field names follow the server; a server upgrade that renames a field will surface here as a decode error rather than silently dropping data.