mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-11-17 04:11:35 +00:00
The package-manager switch (#102765) made engine detection read only PM's store and pinned every llama.cpp backend to b10362. A machine with an engine under runtimes/llamacpp/b<tag>/<backend>/ reported no engine, so the local models pane showed one-click setup with models already on disk. installed_engine() now moves the newest pre-PM install into the store once. The old manifest's archive digests become the PM identity, the package verifier runs llama-server --version, and os.rename puts the directory in place before facts.json records it. A store that already holds an engine is left alone, a store lock held by another PM operation defers the move, and an install that fails verification stays where it is for the rest of the process. The lock returns to b10964 on all five backends, the default before the PM switch. With b10362 pinned, the pane offered a downgrade from the moved engine as an update. Upstream renamed the ROCm archives to 10.0 at b10767, and the hip assets follow. Only the CUDA build is measured at b10964.
29 lines
1.2 KiB
Python
29 lines
1.2 KiB
Python
"""Every supported local engine backend installs only reviewed PM artifacts."""
|
|
|
|
import pm
|
|
from pm import paths
|
|
from pm.lock import Lockfile
|
|
from pm.store import ALL_TARGETS
|
|
|
|
|
|
def test_llamacpp_backends_have_pins_for_their_supported_targets():
|
|
lock = Lockfile(paths.lockfile_path())
|
|
backends = ("cpu", "cuda", "vulkan", "metal", "hip")
|
|
# One engine build everywhere: the catalog and presets are calibrated against a single tag.
|
|
assert len({lock.version(f"llamacpp-{backend}") for backend in backends}) == 1
|
|
for backend in backends:
|
|
name = f"llamacpp-{backend}"
|
|
package = pm.get_package(name)
|
|
version = lock.version(name)
|
|
assert version
|
|
for target in ALL_TARGETS:
|
|
artifacts = lock.artifacts(name, target)
|
|
if package.missing_reason(target):
|
|
assert not artifacts
|
|
continue
|
|
assert artifacts
|
|
assert [a["url"] for a in artifacts] == package.fetch_urls(version, target)
|
|
assert all(len(bytes.fromhex(a["sha256"])) == 32 for a in artifacts)
|
|
if backend == "cuda":
|
|
assert len(artifacts) == 2
|
|
assert any("cudart-" in a["url"] for a in artifacts)
|