CH·02CLI reference

gpu functions logs

Print a run's output

Print a run's output

Synopsis

Prints what a run wrote: its standard output and standard error, plus messages from GPU.ai such as dependency installation. The output is printed exactly as it was written, in order, so it can be piped.

With --follow the command keeps printing new output until the run finishes, then reports the run's final status on stderr. Without it, the command prints the output so far and exits.

--prefix starts every line with where it came from (stdout, stderr or system). With --output json each piece of output is one JSON object per line, with its stream, text, cursor and time. GPU.ai keeps up to 4 MB of output per run.

gpu functions logs <function> <run-id> [flags]

Examples

# Everything the run has printed so far
gpu functions logs embed 7b2e4d1c-0a9f-4e3b-8c6d-5f4a3b2c1d0e

# Tail a live run until it finishes
gpu functions logs embed 7b2e4d1c-0a9f-4e3b-8c6d-5f4a3b2c1d0e --follow

# Tell stdout, stderr and GPU.ai's own messages apart
gpu functions logs embed 7b2e4d1c-0a9f-4e3b-8c6d-5f4a3b2c1d0e --prefix

Options

  -f, --follow   Keep printing new output until the run finishes
  -h, --help     help for logs
      --prefix   Start every line with its stream: stdout, stderr or system

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 functions - Inspect and manage your functions (Python functions that run on a GPU.ai GPU)

← The gpu CLI