Skip to main content

Module pipe

Module pipe 

Source
Expand description

Stdin/stdout pipe support (PMAT-261)

Enables POSIX-standard - convention for stdin/stdout in CLI commands. Model data from stdin is buffered to a temporary file so that mmap-based operations (GGUF, SafeTensors) work transparently.

Structs§

TempModelFile
Temporary file that holds stdin data for mmap-based operations. Automatically deleted when dropped.

Functions§

is_stdin
Check if a path string indicates stdin.
is_stdout
Check if a path string indicates stdout.
read_stdin_to_tempfile
Read all of stdin into a temporary file.
resolve_input
Resolve an input path: if “-”, read stdin to tempfile; otherwise return the path as-is.
with_stdin_support
Run a command with stdin pipe support: if file is -, buffer stdin to a tempfile; otherwise pass the path through.
write_stdout
Write bytes to stdout (for - output paths).