CH·02CLI reference

gpu chat

Run a chat completion (streams tokens by default)

Run a chat completion (streams tokens by default)

Synopsis

Runs a chat completion against a serverless model and streams the response tokens to stdout. The prompt comes from -m/--message flags, trailing arguments, or piped stdin (in that order). Append :economy to the model id to use the economy tier. Requires a key with the serverless:write scope.

Chat writes the model's text to stdout and ignores --output (it is not a structured resource). Use --no-stream to print the full response at once.

gpu chat <model> [prompt...] [flags]

Examples

# One-shot prompt as arguments (streams the reply)
gpu chat gpuai/qwen2.5-7b-instruct "Explain WireGuard in one sentence"

# System prompt + sampling controls
gpu chat gpuai/qwen2.5-7b-instruct -m "Write a haiku about GPUs" --system "You are concise." --temperature 0.7

# Economy tier
gpu chat gpuai/qwen2.5-7b-instruct:economy "hello"

# Pipe the prompt in from stdin
echo "Summarize WireGuard." | gpu chat gpuai/qwen2.5-7b-instruct

# Non-streaming (print the full response at once)
gpu chat gpuai/qwen2.5-7b-instruct "hi" --no-stream

Options

  -h, --help                  help for chat
      --max-tokens int        Maximum completion tokens
  -m, --message stringArray   User message (repeatable); alternative to a positional prompt
      --no-stream             Disable streaming; print the full response
      --system string         Optional system prompt
      --temperature float     Sampling temperature

Options inherited from parent commands

      --api-base string   API base URL (override with GPUAI_API_BASE env) (default "https://api.gpu.ai/v1")
      --debug             Enable debug logging to stderr
  -o, --output string     Output format: table|json (default table on TTY, json otherwise)

SEE ALSO

  • gpu - GPU.ai command-line interface

← The gpu CLI