logs.gokuls.in

2 pull requests merged across 2 repos

bahdotsh/hopchat

What

/pool runs one model across everyone's machines in a group or the lobby, so a room can run a model too big for any single laptop.

alice> /pool give on
bob>   /pool start qwen2.5:72b
🤖 is loading qwen2.5:72b across this machine and alice (16 GB RAM), carol (32 GB RAM). This can take a few minutes.
🤖 qwen2.5:72b is ready, pooled across this machine and alice (16 GB RAM), carol (32 GB RAM). Mention @ai to ask it.
  • /pool give on|off: let pools in your groups use this machine's memory. Off by default.
  • /pool start [MODEL]: an Ollama model name (resolved to its GGUF blob through Ollama's manifest) or a .gguf path. Asks the givers in this conversation, waits up to 20 s, then starts llama-server --rpc … across whoever answered.
  • /pool stop, /pool bin FOLDER, /pool (status).
  • While a pool runs, the host's @ai answers come from it, and lending (/ai share) offers it as MODEL, pooled. @home tool turns stay on Ollama.

How it works

  • Arranging a pool: new hidden one-to-one messages (home::pool::Wire: Give/Keep/Join/Ready/Refuse/Leave), sent over MLS on the same path as model lending. The engine tracks givers, refuses a Join from anyone it doesn't share the group with, and gives home each peer's IP from its direct stream.
  • Workers: each giver starts ggml-rpc-server --host 127.0.0.1 --cache (or the older rpc-server) and opens a tunnel listener.
  • Tunnel (home/tunnel.rs): llama.cpp's RPC has no authentication or encryption, so it never crosses the network as plain RPC.
  • The host mints a 32-byte key per giver per pool and sends it inside Join (MLS-encrypted).
  • Each TCP connection swaps fresh nonces, then derives separate host→worker and worker→host keys with HKDF-SHA256. Frames are length-prefixed ChaCha20-Poly1305 with counter nonces.
  • Nothing reaches the worker's RPC server until a frame has decrypted, and the worker accepts connections only from the host's IP.
  • Before loading, the host probes each giver with an empty sealed frame each way, so a wrong key fails up front without touching the RPC server.
  • Lifecycle:
  • A pool ends if any member leaves or drops off the network, or if llama-server or a giver's RPC server stops by itself.
  • llama.cpp processes are tracked in a registry and killed on /pool stop, on drop, and when hopchat exits.
  • Their output goes to pool.log in the data directory.

Security note

A pool host can run any computation llama.cpp's RPC server allows on a giver's machine, and llama.cpp calls that server a proof of concept. That's why giving is opt-in, limited to groups you share, and announced with a note. The README says so.

Testing

  • cargo clippy --all-targets --locked -- -D warnings is clean, and cargo test --locked passes (267 passed).
  • New unit tests:
  • Tunnel: bytes survive a round trip across several connections and frames; a wrong key reaches nothing; plain RPC is refused; only the host's IP may connect; dropping a listener closes its connections; frames can't be replayed across directions or connections.
  • Pool: the wire format round-trips; Ollama manifest resolution (library, user, and hf.co names, plus path-traversal rejection); .gguf paths.
  • Two end-to-end tests, a_host_and_a_giver_pool_a_model and stopping_while_loading_stops_llama_server, run in CI. They skip themselves when python3 is missing.
  • Two Homes arrange a pool through each other's hidden messages, with Python stand-ins for llama-server and ggml-rpc-server.
  • The stand-in server only answers after echoing 200 KB through each worker's encrypted tunnel.
  • They then check that /pool stop makes the giver leave, and that stopping mid-load kills llama-server.
  • Also covered: late givers let go when gathering ends, /pool give off leaving a served pool, a repeated Join, givers without a direct link, llama.cpp exiting after start on either side, the pooled offer and lending, ask errors, frame size limits, and a probe with the wrong key.

bahdotsh/wrkflw

Why

I checked wrkflw against GitHub on wrkflw's own CI history. It was fast: emulation took 73–93 s on a Mac, where GitHub took 160–269 s. It was not trustworthy:

FindingEffect
wrkflw agreed with GitHub on 2 of 6 commitsfalse passes and false failures
gate on a feature branch or detached HEAD ran 0 workflows and passedpush "verified" with nothing checked
Running from a git worktree lost .gitevery git step failed, masking real failures
Docker Desktop's 8 GB VM killed the linkera failure GitHub's 16 GB runner never sees
itsdangerous planned 6 matrix legs, GitHub ran 7include semantics differed
`runs-on: ${{ matrix.os \\'ubuntu-latest' }}`windows and macOS legs were not flagged as unverified
Workflows without name: failed to parse
Reused jobs looked like ordinary passes
Digests had colour codes, thiserror as an error line, duplicated legs and a canned cargo hint

What changes

  • Verdicts. run_finished and gate gain verdict: verified, partial, or nothing_checked. The gate's passed is false when nothing ran. It still exits 0 then, so pushes that no CI covers aren't blocked.
  • Gate event fallback. Without --event, a workflow a push doesn't fire is checked as a pull_request into the default branch. Each workflow entry says which event and base_branch it was checked as.
  • Matrix include follows GitHub's documented rules. The documented example and itsdangerous are now tests.
  • runs-on expressions that read only matrix are evaluated per leg.
  • Worktrees get a real .git directory, mirrored from the common dir, on the right branch.
  • Memory. A Docker or Podman VM under 14 GB triggers a warning and a limit of one job per 4 GB. WRKFLW_MAX_PARALLEL_JOBS overrides the limit. The digest names an out_of_memory cause.
  • Digest quality. ANSI codes are stripped and error lines match whole words, skipping zero counts. Folded legs go under also_failed_in. The cargo hint is removed.
  • reused is now set on job_finished and on run_finished.jobs.
  • New wrkflw compare <run id|url>. It runs a finished GitHub run locally and lists per-job agreement, with notes on why results may differ.
  • scripts/conformance/plan_corpus.sh plans the latest run of each workflow in 20 public repos and compares job counts. It needs gh and jq, and runs nothing.
  • Parser and schema gaps found by that corpus:
  • a strategy without a matrix (psf/requests)
  • top-level cache-mode, environment.deployment and expression timeout-minutes (ruff)
  • the code-quality permission (clap)
  • empty env values (ripgrep)

Breaking changes are listed in BREAKING_CHANGES.md.

Verified

  • cargo test --workspace --all-features passes all 1,621 tests. clippy -D warnings, fmt --check and check --no-default-features are clean.
  • Compare, on a commit where GitHub passed: all jobs agree. On a commit where GitHub's Ubuntu build failed: one disagreement, noted as "ran as macOS locally".
  • Gate, on a feature branch: CI was checked as a pull request into main, with verdict partial. Before this change it ran nothing and passed.
  • Worktree run: succeeds.
  • Docker build-only run on an 8 GB VM: the memory warning is shown, the digest cause is out_of_memory, and the other legs are folded into also_failed_in.
  • Plan corpus:
  • Every comparable workflow matches GitHub's job count.
  • The six workflows wrkflw could not parse now plan.
  • Workflows are marked n/a when GitHub skipped or cancelled jobs, when they call other workflows, or when no job ran.

Not in this PR

  • A scheduled CI job that runs the corpus or a self-compare. The script is documented, not automated.
  • macOS and Windows jobs still run as Linux or as the host OS. They are reported as partial, not emulated.