Skip to main content

ARGUS

A hardware-adaptive inference runtime for Dense, MoE, and Hybrid models, optimized for heterogeneous and memory-constrained systems.

Built with a native Rust control plane, C++/CUDA libargus kernels for llama.cpp, a quality-preserving hardware auto-tuner, an embedded Ollama-style WebUI, native systemd/Waybar integration, and a zero-dependency Python SDK.

Rust Control Plane CI Packaging & Patch Build License: Apache-2.0 PyPI

Türkçe · Architecture · OpenAI Compatibility · v2.3.0 Multi-Arch Benchmarks · v2.2.1 MoE Ledger · Migration Guide · Changelog


What is ARGUS?

ARGUS is a pure, model-agnostic, hardware-adaptive inference runtime layered over llama.cpp. Rather than assuming a single model family or hardware class, ARGUS inspects both the GGUF model's composable tensor topology and the host's real hardware topology to automatically compute safe, quality-preserving placement and execution policies.

MoE optimizations (P3 async DMA prefill, CPU_REPACK, tiered K1/S1 KV mirror, dynamic moe_top_k, Native VoC) remain first-class architecture-specific modules inside a general-purpose runtime covering:

  • Supported Architecture Classes: Dense Transformers, Sparse MoE Transformers, Hybrid Attention + MoE, Hybrid Attention + SSM/DeltaNet, Pure SSM/Recurrent (e.g. RWKV-7, Mamba), Multimodal Vision (mmproj), Dedicated Embedding (nomic-bert, bert), and safe --fit fallback for unknown future GGUF architectures.
  • Zero Python Required at Runtime: The daemon (argusd, ~12 MiB RSS, OS flock singleton), CLI (argus with 17 native commands including tune, bench, doctor, profile, replay, status --waybar), hardware discovery, universal planner, capability-gated OpenAI /v1/* gateway (scoped to docs/openai-compatibility.md), and embedded bare WebUI all ship as native Rust binaries (verified in a sanitized zero-Python PATH smoke test; not yet validated on a fresh OS image lacking a system Python install).
  • Universal Hardware Discovery & Auto-Tuning (argus tune): Probes physical vs logical cores, hybrid P/E topology, L1/L2/L3 caches, NUMA nodes, SIMD ISA, multi-vendor PCIe link ceilings (clamped against parent PCIe root port wiring), NVML VRAM/temperature, RAM/swap, Linux PSI, and single-stream DDR bandwidth — strictly protecting D3cold GPUs from idle wakeups. Calibration entries are stored atomically in calibration_store.json with a 10-field invalidation key, .corrupt.<ts> quarantine recovery, and swap/thermal/noise/prefill-regression safety gates.
  • Production Guardrails: VRAM-aware mmproj CPU fallback (--no-mmproj-offload) preventing vision projectors from degrading -ngl, p3buf=2, or CPU_REPACK; explicit HTTP 400 (unsupported_for_model_architecture) rejecting MoE knobs on non-MoE models; ephemeral 0600 backend.key blocking direct llama-server bypass (401); GGUF-verified Multi-LoRA hot-swap with KV invalidation; and clean <2s shutdown with zero coredumps.

Measured Performance (v2.3.0)

Verified Hardware Scope & Untested Platforms

  • Verified ONLY on: Consumer laptop with NVIDIA RTX 3050 Ti Laptop GPU (4 GiB GDDR6, PCIe Gen3 ×4 ~3.2 GB/s root-port ceiling) + Intel Core i5-11300H (4P/8T, AVX-512 VNNI) + 32 GiB DDR4 (Linux, nice -n 5, equal-quality greedy temperature=0, seed=42).
  • Untested Hardware Platforms (UNTESTED — NO performance claims made): GPUs with >=8 GiB VRAM (e.g., L40S, RTX 4090, GB10), AMD ROCm, Intel/AMD Vulkan, Apple Metal, unified-memory (UMA) hosts, and Multi-GPU setups have architectural abstractions in place only and have not been benchmarked.

7-Model Multi-Architecture Matrix (full raw JSON ledger)

Architecture Class Model (Size) Placement & Key Flags Decode / Throughput Prefill Peak VRAM Greedy Parity
Embedding nomic-embed-text-v1.5.Q8_0 (139 MiB, nomic-bert) Full-GPU ngl=13/12, auto --embeddings --pooling mean 133.0 req/s (7.52 ms, CPU 41.12 req/s) — (dim=768) 600 MiB N/A
Pure-Recurrent rwkv7-1.5B-world-f16-q4_k (1.25 GiB, rwkv7, 0 KV, 12.38 MiB O(1) state) Full-GPU ngl=25/24, ctx=16384 103.05 tok/s (IQR 0.34) 302.4 tok/s 1,606 MiB PASS (+cancel iso)
Small Dense qwen2.5-0.5b-instruct-q4_k_m (0.46 GiB, qwen2, 24L) Full-GPU ngl=25/24 / CPU-only ngl=0 mmap 239.66 / 56.82 tok/s 1,288.4 tok/s (CPU) 526 MiB (CPU) PASS
Attn+SWA-Dense + Vision gemma-4-E4B-it-Q4_K_M (4.64 GiB + 946 MiB mmproj CPU) Tuned ngl=42/42, mmap, --no-mmproj-offload 39.95 tok/s (--fit: 39.91) 1,042.6 tok/s 3,498 MiB PASS
Hybrid-Recurrent-Dense + Vision tencent_UI-Mate-9B-Q4_K_M (5.50 GiB + 876 MiB mmproj CPU) Safe ngl=13/32 (50.3 MiB state) / --fit (15/32) 8.23–8.70 tok/s 115.4–117.6 tok/s 3,236–3,522 MiB PASS
Attn+SWA-MoE + Vision gemma-4-26B_q4_0-it (13.45 GiB + 1.2 GiB mmproj CPU) HeteroMoe, ncmoe=30, CPU_REPACK, p3buf=2, p3=cal, S1, 32K 20.79 / 33.46 / 45.62 tok/s (K=8/4/2) 57.4 / 113.0 / 201.1 tok/s 2,754 MiB PASS (0 regression)
Hybrid-Recurrent-MoE + Vision Qwen3.6-35B-A3B-Q4_K_S (18.52 GiB + 614 MiB mmproj CPU) HeteroMoe, ncmoe=40, CPU_REPACK, p3buf=2, p3=cal, S1, 32K 25.94 / 38.11 / 48.85 tok/s (K=8/4/2) 73.4 / 121.1 / 195.7 tok/s 2,492 MiB PASS (+0.2%..+3.1%)

Key Empirical Engineering Findings (Positive & Negative)

  • Dense/Hybrid CPU_REPACK (--load-mode none --no-host) — NO-GO for Safe Default: Without MoE P3 DMA streaming, disabling host mmap blocks CUDA batched prefill offload and caused a -19.1% to -60.2% prefill regression across qwen2.5-0.5b CPU (1,288 → 820 tok/s), gemma-4-E4B (ngl=40 750 → 486, ngl=42 1,043 → 843, CPU 171.5 → 68.3 tok/s), and UI-Mate-9B (103.8 → 46.8 tok/s) for at most +0.1%..+4.5% decode change. Dense/Hybrid/Pure-SSM Safe mode remains on mmap, and argus tune enforces a >= 0.85× prefill guard.
  • Physical P-Cores (-t 4) vs SMT (-t 8) — Confirmed GO: Defaulting decode threads to physical cores beat SMT across every non-MoE model (gemma-4-E4B +11.2%, UI-Mate-9B +44.2%, qwen2.5-0.5b +47.5%, rwkv7-1.5B CPU 7.1×).
  • Partial-GPU ARGUS_RS_GPU_OPT=1 (UI-Mate-9B ngl=13/32): Neutral on decode (8.28 vs 8.23 tok/s) and -10% slower on prefill (103.8 vs 115.4 tok/s); kept disabled on Partial-GPU Hybrid-Dense models.
  • Native Shutdown Reliability: Explicit argus_kv_shutdown() / argus_expert_cache_shutdown() + single-SIGTERM process-group signaling + KillMode=mixed cut shutdown from >25.4 s / 13.45 s + coredump to 0.79–1.93 s (0 coredumps).
  • MoE P3 Prefill & Noise Disclosure (v2.2.1 ledger): Uncalibrated clean installs retain single-pass coalesced P3 gains (~1.7×–1.9× at >=512 tokens via safe fallback); local fingerprint calibration (p3_profiles.json) achieved 1.01×–2.10× (Gemma 4 26B) and 1.06×–3.44× (Qwen 3.6 35B) across 24/24 measured points (430–3,661 tokens). Closed-mode <1.5% instrumentation perturbation remains NOISE_LIMITED_CANNOT_PROVE_1_5PCT under live-desktop thermal drift (80–81.4°C).

Architecture

flowchart LR
    UI["Embedded Bare WebUI<br/>(HTML/JS, capability-gated)"] --> D
    CLI["argus CLI (17 commands)<br/>tune · bench · doctor · plan · waybar"] --> D
    OAI["OpenAI Clients<br/>(/v1/* scoped + arch-gated)"] --> D
    SDK["Python SDK<br/>(argus_cache.ArgusClient, stdlib)"] --> D

    subgraph Rust["Rust Control Plane (~12 MiB RSS, Zero Python)"]
        D["argusd (Axum HTTP/SSE + flock singleton)<br/>backend.key Isolation · Cache · Queue · Rollback"]
        C["argus-core<br/>ModelCapabilities · hw_discovery · Universal PlacementPlan<br/>CalibrationStore · Multi-LoRA"]
        D --- C
    end

    D <-->|"HTTP / SSE (Zero-FFI boundary)"| S

    subgraph Cpp["C++ / CUDA Data Plane (llama-server + libargus)"]
        S["llama-server (5bacb7c + argus.patch)<br/>Explicit Lifecycle Shutdown · Native VoC · Dynamic K · Multi-LoRA"]
        K["libargus Kernels<br/>P3 Async DMA (MoE) · K1/S1 Tiered KV · Dense+MoE Dynamic RAM<br/>Hetero Overlap · Level-1/2 Dense+MoE Profiler"]
        S --- K
    end

Quick Start

1. Build & Install Native Rust Binaries (Optional systemd + Waybar)

git clone https://github.com/Zwannfrederick/argus.git
cd argus
./scripts/install_argus.sh
# Optional user systemd service (single argusd.service, KillMode=mixed):
ARGUS_INSTALL_SYSTEMD=1 ./scripts/install_argus.sh

2. Build llama-server with libargus

Apply integrations/llama.cpp/argus.patch onto pinned llama.cpp revision 5bacb7c868a2bc98682de15f447fc1ce17c9c49c:

git -C /path/to/llama.cpp apply /path/to/argus/integrations/llama.cpp/argus.patch
cmake -S /path/to/llama.cpp -B /path/to/llama.cpp/build-cuda \
  -DCMAKE_BUILD_TYPE=Release -DGGML_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES=86 \
  -DGGML_CUDA_FA=ON -DGGML_CUDA_FA_QUANTS="q4_0-q4_0;q8_0-q8_0;f16-f16;bf16-bf16" \
  -DGGML_NATIVE=ON -DARGUS_CORE_DIR=/path/to/argus/argus_cache/csrc
cmake --build /path/to/llama.cpp/build-cuda --target llama-server -j"$(nproc)"

3. Diagnose, Plan, Auto-Tune, Start, and Benchmark

argus doctor                                  # CPU topology, root-port PCIe ceiling, GPUs, PSI, model & calibration
argus inspect model.gguf                      # Composable ModelCapabilities (Dense/MoE/Hybrid/SSM/Embedding/Vision)
argus plan --model model.gguf                 # Analytical Safe placement (FullGpu/PartialGpu/CpuOnly/HeteroMoe/--fit)
argus tune --model model.gguf --mode fast     # Quality-preserving DDR/PCIe + candidate calibration -> calibration_store.json
argus start --model model.gguf --wait         # Start argusd + supervised llama-server with rollback on failure
argus bench --check-parity                    # Architecture-aware chat/embeddings/MoE benchmark + greedy parity
argus status --waybar                         # Pure-Rust Waybar JSON status (D3cold-safe, zero Python/jq)
argus chat                                    # Interactive terminal chat
argus web                                     # Open embedded bare WebUI (http://127.0.0.1:8090)

Thin Python SDK (Optional, Zero Dependencies)

pip install argus-cache
from argus_cache import ArgusClient

client = ArgusClient("http://127.0.0.1:8090")
st = client.status()
print(st["model_capabilities"]["architecture_class"], st["vram"])

for event in client.chat_stream(
    [{"role": "user", "content": "Summarize how PCIe Gen3 x4 limits hybrid LLM prefill."}],
    routing="auto",
):
    if event.event == "token":
        print(event.data["text"], end="", flush=True)

Core Features

Area Capabilities
Model Capability Detection Composable GGUF inspection (AttentionTopology, O(1) RecurrentTopology, ExpertTopology, EmbeddingCapability, VisionCapability, QuantInventory, DetectionConfidence) with zero hardcoded family lists and automatic --fit fallback on unknown architectures.
Universal Placement Planner Unified FullGpu, PartialGpu (-ngl k), CpuOnly, HeteroMoe, and UnknownUpstreamFit policies; 4 VRAM profiles (balanced, decode, prefill, coexist); mmproj CPU fallback (--no-mmproj-offload); --no-vision; `--device auto
Hardware Auto-Tuner & Cache argus tune (safe, fast, comprehensive; quality-preserving exact default) with 64 MiB DDR bandwidth probe, parent PCIe root-port link clamping, RAII ephemeral server teardown, swap/thermal/noise/prefill-regression gates, and 10-field composite-key calibration_store.json (.corrupt.<ts> recovery).
MoE Acceleration Modules Double-buffered async P3 DMA prefill (ARGUS_P3_COALESCE=1, 2-thread Q4_0_8x8 / Q4_K_8x8 un-repack), K1/S1 tiered KV mirror, per-request moe_top_k / moe_top_k_layers, and Native C++ VoC (ARGUS_VOC_DIR) — strictly gated off on non-MoE models (HTTP 400).
OpenAI Gateway, LoRA & Ops Scoped /v1/* API (docs/openai-compatibility.md), ephemeral 0600 backend.key isolation (401 on bypass), GGUF-verified Multi-LoRA hot-swap with KV invalidation, OS flock singleton, clean <2s shutdown (KillMode=mixed), native Waybar JSON, and capability-gated bare WebUI.

Key Runtime Knobs

Knob Default Purpose
ARGUS_AUTO 1 (MoE) / 0 (Dense/SSM) Enables K1/S1 tiered KV, P3 prefill, hetero overlap, and elastic RAM watchdog on heterogeneous MoE plans.
ARGUS_P3_COALESCE 1 (ON) Coalesces multi-ubatch P3 DMA passes into single-pass layer-major prefill (0 disables).
ARGUS_P3_BUFFERS auto 1 (sync) or 2 (double-buffered async DMA with on-demand slot[1]).
ARGUS_P3_UNREPACK_THREADS 2 (4+ cores) Parallel CPU strip un-repack threads (1 or 2) inside the P3 DMA worker.
ARGUS_RS_GPU_OPT unset Opt-in GPU recurrent-state placement toggle for hybrid SSM/DeltaNet models (1 / 0).
ARGUS_VOC_DIR / --argus-voc-dir unset Trusted startup directory containing VoC calibration files for Native C++ MoE routing.
ARGUS_CUDA_GRAPH_EXT 0 (OFF) Opt-in CUDA Graph capture for libargus S1 & tier_append ops (default OFF on 4 GiB hetero decode).
ARGUS_DECODE_PROFILE 0 (OFF) 1: decode host + async CUDA event breakdown (argus profile); 2: adds Dense GGML_OP_MUL_MAT (cpu_mm_compute_ms) & MoE MUL_MAT_ID + lm_head/logits_d2h/sample_ms.
ARGUS_EXPERT_STATS / ARGUS_EXPERT_TRACE 0 / unset Opt-in router-level MoE expert counters (GET /argus/expert-stats) and binary ARGETRC v1 trace for argus replay.

Verification

# Rust control plane: formatting, strict clippy, unit/golden/daemon/OpenAI integration tests
cargo fmt --manifest-path rust/Cargo.toml --check
cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings
cargo test --manifest-path rust/Cargo.toml

# WebUI Markdown XSS suite & Python SDK / packaging hygiene tests
node tests/webui_markdown_xss.test.mjs
pytest -q --ignore=tests/test_native_libargus.py

# Native CUDA kernels, K1/S1/C1, Q4_0/Q4_K un-repack & Native VoC tests
ARGUS_TEST_CUDA=1 ARGUS_LLAMA_CPP_DIR=/path/to/llama.cpp ARGUS_LLAMA_BUILD=build-cuda \
  ARGUS_TEST_GGUF=/path/to/stories15M.gguf ARGUS_TEST_QUANT_GGUF=/path/to/qwen2.5-0.5b.gguf \
  pytest -v tests/test_native_libargus.py

License

Apache 2.0 — see LICENSE.

Metadata

Release files for argus-cache 2.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for argus-cache 2.3.0
File Size Uploaded Provenance Actions
argus_cache-2.3.0.tar.gz 155.7 kB Without provenance Details for argus_cache-2.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for argus-cache 2.3.0
File Interpreter ABI Platform Actions
argus_cache-2.3.0-py3-none-any.whl Python 3 none any Details for argus_cache-2.3.0-py3-none-any.whl

Total release size: 248.0 kB

Release files / argus_cache-2.3.0.tar.gz

Download URL argus_cache-2.3.0.tar.gz
Size 155.7 kB
Tags Source
SHA-256 checksum
How to use checksums
74966404b70a8387ec5a8c4de491a742bf5fd7938adadfc69211e47f399a54c8
BLAKE2b-256 checksum
How to use checksums
1477dd9f0386d47065cb32dd370a2cd18be8fc48735954901ac22aae72f3b6f1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Release files / argus_cache-2.3.0-py3-none-any.whl

Download URL argus_cache-2.3.0-py3-none-any.whl
Size 92.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
04f158779492909ebee6ef9dbe9040c9162accd941b63e0ff2ff95ed552e8e6c
BLAKE2b-256 checksum
How to use checksums
5711666adb71c55b476edba9ab552bdbae4e6554fbc7690f781e5cc8f5ccca56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.10

Security for argus-cache 2.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page