Show HN: Libargus:Low-latency local LLM runner via OpenJDK Panama FFM (Java 22)

KingJoker1 pts0 comments

Most existing approaches for running local LLM inference within the JVM ecosystem rely on spawning out-of-process daemons via REST sidecars (introducing major serialization and IPC overhead) or loading monolithic JNI wrappers that introduce object-copying overhead and heavy Garbage Collection pressure on hot text/token streams.I built Libargus to test the performance limits of OpenJDK s Foreign Function and Memory (FFM) API by embedding raw C++ tensor compute graphs (ggml / llama.cpp) straight into a process-global, unmanaged Java runtime[cite: 1].Core Architecture and Systems Primitives:* Zero-Allocation Hot Paths: Memory segments for prompt inputs and token decoding are allocated once off-heap inside confined Arenas. Parameter and token pointers are passed to the unmanaged C boundary at constant complexity, completely bypassing heap allocation churn and primitive array cloning.* Bit-Accurate Layout Packing: Native structures (including llama_model_params and llama_context_params) are mapped identically via explicit Java MemoryLayout tracking. Structural padding properties are explicitly defined to prevent memory drift or unaligned access across different compiler boundaries.* Microarchitectural Guardrails: The runtime features an explicit compile-time portable compilation pass. It bundles heavily optimized native binaries into the JAR resources, insulating cluster deployments from unexpected Illegal Instruction (SIGILL) processor faults while maximizing matrix compute throughput.Upstream Roadmap:libargus functions strictly as Layer 0 (The Core Execution Bedrock). Because the execution core runs inside the active process space, it unlocks low-overhead access to low-level model registers and key-value (KV) states[cite: 1].The next major milestone on the project roadmap is a stateful orchestration layer built directly on top of this FFM bedrock, currently being battle-tested under the L-TABB cognitive memory layer design blueprint. This upcoming architecture handles long-term context retention and multi-agent workload isolation without the latency penalties or context degradation of standard stateless architectures, serving as the next logical layer of the Argus ecosystem.The engine layer is fully open-source. Codebases, FFM downcall audits, and micro-benchmarks are welcome.Core Execution Runtime: https://libargus.cc Ecosystem Landing Page: https://projectargus.cc

libargus layer memory core https java

Related Articles