The official command-line interface for ZeroGPU — run fast, edge-optimized inference models (classification, extraction, redaction, chat, summarization) right from your terminal.
- Installation
- Quick Start
- Authentication
- Commands
- Environment Variables
- Output
- Troubleshooting
- Contributing
- License
npm install -g zerogpu-cli@latestRequires Node.js 20+.
Verify the install:
zerogpu --version
zerogpu --help# 1. Sign in (you'll be prompted for your API key and project ID)
zerogpu login
# 2. Check your session
zerogpu status
# 3. Run your first command
zerogpu summarize "ZeroGPU runs small, fast models at the edge so you can ship AI features without managing GPUs."Every inference command requires a valid API key and a project ID. You can provide them in two ways:
zerogpu login— stores credentials in a local config file and exportsZEROGPU_API_KEYto your shell profile.- Environment variable — set
ZEROGPU_API_KEYdirectly (useful for CI). The project ID still needs to be saved vialoginor supplied through the config file.
Get your API key (zgpu-api-…) and project ID (UUID) from the ZeroGPU dashboard.
All commands follow the pattern:
zerogpu <command> [arguments] [options]Run zerogpu <command> --help for command-level help.
Sign in to ZeroGPU. Prompts for your API key (masked input) and project ID, validates them, and persists the credentials.
zerogpu login
zerogpu login --api-key zgpu-api-xxxxxxxx --project-id 4ed3e5bb-c2ed-4d4a-8a66-2b161a27fd1a| Option | Description |
|---|---|
--api-key <key> |
Provide the API key directly (skips the prompt). |
--project-id <id> |
Provide the project ID directly (skips the prompt). |
Check whether you're signed in and where the API key was loaded from.
zerogpu statusChat with the LFM2.5-1.2B-Instruct model.
zerogpu chat "Explain edge inference in one sentence."
zerogpu chat "Translate to French: Good morning." -i "You are a precise translator."| Option | Description |
|---|---|
-i, --instructions <text> |
System instructions that steer the assistant's behavior. |
Chat with the LFM2.5-1.2B-Thinking model, which returns reasoning alongside its answer.
zerogpu chat_thinking "If a train leaves at 3pm at 60mph, when does it arrive 180 miles later?"Summarize text with the t5-small model.
zerogpu summarize "Long article text goes here..."Generate contextual follow-up questions using the ZeroGPU follow-up edge model.
zerogpu generate_followups "We just shipped a new pricing page focused on enterprise plans."Classify text against the IAB audience and content taxonomy using the ZeroGPU IAB edge model.
zerogpu classify_iab "Tips for first-time homebuyers in 2026."Same as classify_iab but returns enriched output: audience, topics, keywords, and intent.
zerogpu classify_iab_enriched "Best running shoes for marathon training."Classify text against a structured schema of categories and allowed labels using GLiNER2.
zerogpu classify_structured "The product arrived broken and I want a refund." \
--schema '{"sentiment":["positive","negative","neutral"],"intent":["complaint","praise","question"]}'| Option | Description |
|---|---|
-s, --schema <json> |
Required. JSON object mapping category name → allowed labels. |
Zero-shot classification against arbitrary candidate labels using DeBERTa v3.
# Repeat --label for each candidate
zerogpu classify_zero_shot "The stock market dropped 3% today." \
--label finance --label sports --label politics
# Or pass them as a comma-separated list
zerogpu classify_zero_shot "The stock market dropped 3% today." \
--labels finance,sports,politics| Option | Description |
|---|---|
-l, --label <label> |
Candidate label (repeatable). |
--labels <a,b,c> |
Comma-separated list of candidate labels. |
Extract named entities from text using GLiNER2 with custom labels.
zerogpu extract_entities "Tim Cook visited the Cupertino campus on Tuesday." \
--label person --label organization --label location --threshold 0.4| Option | Default | Description |
|---|---|---|
-l, --label <label> |
— | Entity label to extract (repeatable). |
--labels <a,b,c> |
— | Comma-separated entity labels. |
-t, --threshold <number> |
0.3 |
Confidence threshold between 0 and 1. |
Extract structured JSON from text against a provided schema using GLiNER2.
zerogpu extract_json "Email Jane Doe at jane@example.com or call 555-0100." \
--schema '{"contact":["name::str::Full name","email::str::Email address","phone::str::Phone number"]}'| Option | Description |
|---|---|
-s, --schema <json> |
Required. Schema as a JSON string. Field format: name::type::description. |
Extract PII entities (persons, emails, phone numbers, etc.) using gliner-multi-pii-v1.
zerogpu extract_pii "Contact John Smith at john@acme.com or +1-415-555-0100." \
--threshold 0.5 --categories identity,contact| Option | Default | Description |
|---|---|---|
-t, --threshold <number> |
0.5 |
Confidence threshold. |
-c, --categories <list> |
identity,contact |
Comma-separated PII categories. |
Detect and redact PII in text — returns the input with sensitive spans masked by label.
zerogpu redact_pii "Call Sarah at 415-555-0100 or email sarah@acme.com."| Variable | Purpose |
|---|---|
ZEROGPU_API_KEY |
Overrides the API key from the config file. Set automatically by zerogpu login for your default shell. |
The project ID is read from the saved config file written during zerogpu login.
- Inference commands print the model's response to stdout. When the response is valid JSON, it is pretty-printed.
- Errors and diagnostic messages are written to stderr.
- All commands exit with code
0on success and1on failure — safe to use in pipelines and scripts.
Example:
zerogpu classify_iab "Tips for first-time homebuyers." > result.jsonYou're not fully signed in yet.Runzerogpu loginagain, or checkzerogpu status.That doesn't look like a valid API keyKeys must start withzgpu-api-.That doesn't look like a valid project IDProject IDs must be a UUID (e.g.4ed3e5bb-c2ed-4d4a-8a66-2b161a27fd1a).ZEROGPU_API_KEYnot picked up in a new shell: open a new terminal, orsourceyour shell config file (thelogincommand prints the path).- HTTP errors are surfaced with the response status and body — inspect them to debug request issues.
Issues and pull requests are welcome. See CONTRIBUTING.md and our Code of Conduct.
Security concerns? See SECURITY.md.
git clone https://github.com/zerogpu/cli.git
cd cli
npm install
npm run build
npm testReleased under the MIT License.