Practical overview
When it fits
Use it when you want a compact, Java-based route to local Llama inference and can supply a supported GGUF model file.
Who it is for
- Java developers who want to run supported Llama models from the command line.
- Learners studying practical LLM inference in Java.
- Developers exploring a Java-based inference component for an application using Llama models.
Documented uses
- Run supported Llama models using GGUF weights.
- Interact with models in chat or instruct mode.
- Build a JAR or GraalVM Native Image executable.
- Experiment with Java Vector API and JVM compiler optimizations for inference.
Requirements & limits
- Java 21 or later is required, including for the MemorySegment memory-mapping feature.
- The implementation supports Llama 3, 3.1 and 3.2, with listed weight formats and quantizations.
- GraalVM Native Image is optional; the Makefile includes JAR and native build targets.
- The README recommends GraalVM 25 or later for best performance.
- The project is a single Java file with no dependencies and is licensed under MIT.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Build a native executable with a preloaded GGUF model
Create a GraalVM Native Image executable that preloads a specific GGUF model.
Before you start
- Java 21 or later
- GraalVM and the repository's Makefile
- A GGUF model file
Steps
Set PRELOAD_GGUF to the path of the model file.
Run make native.
Expected outcome
A larger native executable is generated with that model preloaded; it can also run other models, with the usual parsing overhead.
Guide limitations
- The README does not provide model-specific performance guarantees.
- GraalVM 25 or later is recommended for best performance.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 14 October 2026
- Original website title
- mukel/llama3.java · Official homepage title · retained in its source language

