A press reviewer ran Qwen 27B on a 64 GB RTX Spark and saw single queries take hours. The
causes, and what each part of this change does about them:
- llama-server reads a long prompt for minutes before the first token. Local requests now
always stream and ask for prompt-reading progress, so the stall timers see the server
working and the router notices a hang-up within seconds. They no longer fall back to a
non-streamed request, which the router can't cancel. The status line shows how much of
the prompt the server has read.
- A laptop that sleeps mid-request froze the request, and the stall timer cut it on wake.
Stall timers for a server on the same machine now skip time the process was stopped
(sleep or Modern Standby). Background-call watchdogs run on the awake clock.
- After repeated stalls the breaker failed every later message at once, even after the local
server recovered. At turn start, a local server that answers its health check gets one more
attempt; one more stall shuts the breaker again.
- On Windows unified memory, the GPU carve-out is invisible to Windows, and the model plus
llama-server's default 8 GiB prompt cache overran commit. Free commit now narrows the launch
window (never refusing a model the pool can hold), caps how many models the router holds at
once, and sizes the prompt cache, split across those models.
- Hermes's status reads named the model, and the router loads any model a request names, so
Eject and the idle unload reloaded the model at once. Status reads pass autoload=false; an
unloaded model counts as idle, and the context probe reads the router's launch args.
- The smart-approval verdict has a 16-token budget, and a thinking model spent all of it
thinking (45 of 45 verdicts came back empty). The verdict asks for no thinking unless the
operator set auxiliary.approval.reasoning_effort.
- Compression's 600 s limit counted the time the server spent reading a 150K-token
conversation, which alone can exceed it on a laptop GPU. Prompt reading now pushes the fence
deadline back (CompressionCommitFence.extend_deadline), only while the server reports newly read
tokens, and never past a fence the host closed or one a commit holds. The agent and gateway
hygiene waits read the moved deadline after every slice.
- Desktop keep-awake defaults to "while working". When a timed sleep interrupts a turn with
keep-awake off, the next wake offers it once per computer; the offer survives the next prompt.
(cherry picked from commit 518ce272b9)
45 lines
1.5 KiB
Python
45 lines
1.5 KiB
Python
"""Which endpoint is the llama-server this Hermes manages (sibling of ``auxiliary_client``)."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import json
|
|
import time
|
|
from typing import Optional
|
|
from urllib.parse import urlparse
|
|
|
|
_MANAGED_LOCAL_STATE_TTL_S = 15.0
|
|
_managed_local_cache: tuple[float, str] = (0.0, "")
|
|
|
|
|
|
def _managed_local_netloc() -> str:
|
|
"""host:port of the managed local llama-server ("" when none), read with a short TTL from
|
|
the supervisor state file provider resolution also uses (exact match)."""
|
|
global _managed_local_cache
|
|
now = time.monotonic()
|
|
ts, cached = _managed_local_cache
|
|
if now - ts < _MANAGED_LOCAL_STATE_TTL_S:
|
|
return cached
|
|
try:
|
|
from hermes_cli.local_runtime.supervisor import state_path
|
|
|
|
raw = state_path().read_text(encoding="utf-8-sig")
|
|
base = str((json.loads(raw) or {}).get("base_url", ""))
|
|
netloc = urlparse(base).netloc.lower()
|
|
except (OSError, ValueError, AttributeError): # no state file, bad JSON, or not an object
|
|
netloc = ""
|
|
_managed_local_cache = (now, netloc)
|
|
return netloc
|
|
|
|
|
|
def _is_managed_local_endpoint(base_url: Optional[str]) -> bool:
|
|
"""True when *base_url* targets the llama-server this Hermes manages."""
|
|
if not base_url:
|
|
return False
|
|
managed = _managed_local_netloc()
|
|
if not managed:
|
|
return False
|
|
try:
|
|
return urlparse(str(base_url)).netloc.lower() == managed
|
|
except ValueError:
|
|
return False
|