Documentation
¶
Overview ¶
Package facts is STABLE — local and remote cluster fact collection. It is part of the stable operator path.
Index ¶
Constants ¶
const LlamaServerDiscoveryScript = `` /* 1891-byte string literal not displayed */
LlamaServerDiscoveryScript is the bash script used to detect a running llama-server process, extract its loaded model from the command line, and report it as a resident model. Works locally and over SSH.
pgrep is trimmed to a single PID with | head -1 to handle multiple instances deterministically. The --model/-m flag is parsed with awk to handle both --model=path and --model path forms and avoid fragile column assumptions.
const MLXDiscoveryScript = `` /* 1872-byte string literal not displayed */
MLXDiscoveryScript detects a running mlx_lm.server process and queries its OpenAI-compatible /v1/models endpoint to enumerate resident models.
mlx_lm is a Python package (pip install mlx-lm), so python3 is used for JSON parsing — it is always present on any node that can run MLX. The server defaults to port 8080; the script respects an explicit --port argument.
Note: llama-server also defaults to port 8080. On nodes running both, only the first server to bind the port will be reachable; the other probe will return an empty resident-model list rather than an error.
const OllamaDiscoveryScript = `` /* 1797-byte string literal not displayed */
OllamaDiscoveryScript is the bash script used to robustly discover Ollama state and models across both local and remote nodes.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Collector ¶
Collector collects facts from a node. Implementations: LocalCollector (direct), RemoteCollector (SSH-based, temporary).
type LocalCollector ¶
LocalCollector collects facts from the local machine.
func NewLocalCollector ¶
func NewLocalCollector(name, role string) *LocalCollector
NewLocalCollector creates a collector for the local node.
type RemoteCollector ¶
RemoteCollector collects facts from a remote node via SSH. The Executor interface keeps the collection path decoupled from the current transport implementation.
func NewRemoteCollector ¶
func NewRemoteCollector(name, role, hostname string, exec transport.Executor) *RemoteCollector
NewRemoteCollector creates a remote fact collector.