Liking cljdoc? Tell your friends :D

hive-system.gpu.ollama

OllamaGpuExecutor — IGpuExecutor + IGpuStatus over the ollama HTTP API.

First concretion of hive-system.protocols.gpu. Mirrors hive-system.secrets/* placement: protocol in hive-system.protocols.*, concrete adapter in a sibling sub-namespace.

Capabilities: :embed — POST /api/embed :generate — POST /api/generate (single-shot, no streaming for now)

What we deliberately don't do here:

  • Pool / retry classification — that's the caller's job via hive-weave.gpu/gpu-fork-join + hive-dsl rescue helpers.
  • Streaming / SSE — generate returns once, no incremental delta.
  • Model autoload — assumes ollama pull <model> already happened.

Construct via (->ollama-executor opts) — never the raw record ctor.

OllamaGpuExecutor — IGpuExecutor + IGpuStatus over the ollama HTTP API.

First concretion of hive-system.protocols.gpu. Mirrors hive-system.secrets/*
placement: protocol in hive-system.protocols.*, concrete adapter in a
sibling sub-namespace.

Capabilities:
  :embed     — POST /api/embed
  :generate  — POST /api/generate (single-shot, no streaming for now)

What we deliberately don't do here:
  - Pool / retry classification — that's the caller's job via
    hive-weave.gpu/gpu-fork-join + hive-dsl rescue helpers.
  - Streaming / SSE — generate returns once, no incremental delta.
  - Model autoload — assumes `ollama pull <model>` already happened.

Construct via (->ollama-executor opts) — never the raw record ctor.
raw docstring

hive-system.gpu.probe

nvidia-smi probe satisfying IGpuStatus.

Authoritative source for VRAM observability. The OllamaGpuExecutor's gpu-status returns -1 for VRAM fields because ollama doesn't expose them reliably; this probe shells out to nvidia-smi for the truth.

Uses hive-system.protocols/IShell so a mock shell can drive tests without launching real subprocesses (DIP). Default ctor wires the stateless hive-system.shell.core/exec! convenience.

Output schema (ok branch): {:vram-free-mb long :vram-total-mb long :inflight 0 ; probe doesn't track in-flight calls :queued 0 ; idem :backend-id :nvidia-smi}

Err branch tags: :gpu/no-driver — nvidia-smi missing on PATH or returned non-zero :gpu/probe-parse — nvidia-smi output couldn't be parsed :gpu/transport-failed — exec layer raised

nvidia-smi probe satisfying IGpuStatus.

Authoritative source for VRAM observability. The OllamaGpuExecutor's
gpu-status returns -1 for VRAM fields because ollama doesn't expose them
reliably; this probe shells out to nvidia-smi for the truth.

Uses hive-system.protocols/IShell so a mock shell can drive tests
without launching real subprocesses (DIP). Default ctor wires the
stateless hive-system.shell.core/exec! convenience.

Output schema (ok branch):
  {:vram-free-mb  long
   :vram-total-mb long
   :inflight      0          ; probe doesn't track in-flight calls
   :queued        0          ; idem
   :backend-id    :nvidia-smi}

Err branch tags:
  :gpu/no-driver       — nvidia-smi missing on PATH or returned non-zero
  :gpu/probe-parse     — nvidia-smi output couldn't be parsed
  :gpu/transport-failed — exec layer raised
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close