<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: hpscript</title>
    <description>The latest articles on DEV Community by hpscript (@hpscript).</description>
    <link>https://dev.to/hpscript</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4037022%2F2b382a67-8028-4db4-a500-8bfea6bec25e.jpeg</url>
      <title>DEV Community: hpscript</title>
      <link>https://dev.to/hpscript</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hpscript"/>
    <language>en</language>
    <item>
      <title>Running Local LLMs in Java: Introducing jllm – A Minimalist Ollama Alternative</title>
      <dc:creator>hpscript</dc:creator>
      <pubDate>Sun, 19 Jul 2026 22:35:20 +0000</pubDate>
      <link>https://dev.to/hpscript/running-local-llms-in-java-introducing-jllm-a-minimalist-ollama-alternative-3ic6</link>
      <guid>https://dev.to/hpscript/running-local-llms-in-java-introducing-jllm-a-minimalist-ollama-alternative-3ic6</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Hello!&lt;/p&gt;

&lt;p&gt;The rapid advancements in Large Language Models (LLMs) have opened up a world of possibilities. However, for Java developers looking to integrate LLMs locally, the landscape can often feel dominated by Python-centric tools, complex dependencies, or concerns about privacy and overhead.&lt;/p&gt;

&lt;p&gt;That's why I developed &lt;strong&gt;&lt;code&gt;jllm&lt;/code&gt;&lt;/strong&gt; – a Java-native, minimalist local LLM manager. It aims to provide the ease of use found in tools like Ollama, but with deep integration into the Java ecosystem, giving developers complete control over their local models.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I Built &lt;code&gt;jllm&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;While existing local LLM tools are incredibly powerful, they often come with significant runtime overheads, complex UI layers, or hidden data tracking. As a Java developer, I sought a cleaner, faster, and more terminal-friendly way to efficiently orchestrate local LLMs, fully leveraging the Java platform.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;jllm&lt;/code&gt; addresses these challenges by offering direct, in-process inference via a JNI binding to &lt;code&gt;llama.cpp&lt;/code&gt;. This eliminates the need for external &lt;code&gt;llama-cli&lt;/code&gt; subprocesses in most scenarios, leading to tighter integration and often better performance within Java applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Features of &lt;code&gt;jllm&lt;/code&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. 100% Local &amp;amp; Privacy-Focused
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;jllm&lt;/code&gt; performs all operations – from model management to RAG – entirely on your machine, with no external calls or data tracking. This makes it ideal for applications handling sensitive data or requiring strict privacy.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Lightweight &amp;amp; Java-Native
&lt;/h3&gt;

&lt;p&gt;Built from the ground up in Java, &lt;code&gt;jllm&lt;/code&gt; boasts fast startup times and a minimal resource footprint. Its direct JNI integration with &lt;code&gt;llama.cpp&lt;/code&gt; ensures efficient in-process inference, making it a true Java citizen in the LLM space.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Comprehensive GGUF Model Management with HTTP API
&lt;/h3&gt;

&lt;p&gt;Easily register and manage your local GGUF files. Recent updates have introduced HTTP API endpoints (&lt;code&gt;/api/pull&lt;/code&gt;, &lt;code&gt;/api/delete&lt;/code&gt;, &lt;code&gt;/api/copy&lt;/code&gt;, etc.) for programmatic model operations, making it even simpler to integrate &lt;code&gt;jllm&lt;/code&gt; into your automated workflows.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Add a model&lt;/span&gt;
./jllm add my-model &lt;span class="nt"&gt;--path&lt;/span&gt; /path/to/your/model.gguf

&lt;span class="c"&gt;# List registered models&lt;/span&gt;
./jllm list

&lt;span class="c"&gt;# Run interactive chat with a model&lt;/span&gt;
./jllm run my-model

&lt;span class="c"&gt;# Start the HTTP API server&lt;/span&gt;
./jllm serve
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. Built-in RAG (Retrieval-Augmented Generation)
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;jllm&lt;/code&gt; includes an integrated RAG capability. You can index local PDFs and text files with &lt;code&gt;jllm rag add&lt;/code&gt;, and all retrieval happens entirely on-device via an embedded &lt;a href="https://lucene.apache.org/" rel="noopener noreferrer"&gt;Apache Lucene&lt;/a&gt; index. No embedding models, external servers, or network connections are required.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Add documents to a RAG collection&lt;/span&gt;
./jllm rag add my-docs &lt;span class="nt"&gt;--path&lt;/span&gt; /path/to/your/documents/

&lt;span class="c"&gt;# Query a model with RAG context&lt;/span&gt;
./jllm run my-model &lt;span class="nt"&gt;--rag&lt;/span&gt; my-docs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  5. Extensible Plugin Architecture
&lt;/h3&gt;

&lt;p&gt;Extend &lt;code&gt;jllm&lt;/code&gt;'s functionality effortlessly. By simply dropping a JAR file into the &lt;code&gt;~/.local-llm/plugins/&lt;/code&gt; directory, you can add new function-calling tools or prompt interceptors without rebuilding the core application. This enables highly customizable and dynamic workflows.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. New Embeddings API
&lt;/h3&gt;

&lt;p&gt;The latest updates also bring an Embeddings API, allowing you to generate embedding vectors for text. This opens up possibilities for advanced features like semantic search and similarity calculations directly within your Java applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;p&gt;Building and running &lt;code&gt;jllm&lt;/code&gt; is straightforward:&lt;/p&gt;

&lt;h3&gt;
  
  
  Prerequisites
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  Java 11+&lt;/li&gt;
&lt;li&gt;  A GGUF model file&lt;/li&gt;
&lt;li&gt;  For in-process inference: a built &lt;code&gt;libllamajni.so&lt;/code&gt; (refer to &lt;a href="https://github.com/cmc-labo/jllm#jni-binding-devlocalllmjni" rel="noopener noreferrer"&gt;JNI Binding&lt;/a&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Build
&lt;/h3&gt;

&lt;p&gt;Recommended build without Maven (downloads Gson, SLF4J, Logback, and Undertow automatically):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bash build.sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Alternatively, with Maven:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mvn package
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will generate &lt;code&gt;target/local-llm.jar&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Using the &lt;code&gt;jllm&lt;/code&gt; Wrapper
&lt;/h3&gt;

&lt;p&gt;A thin shell wrapper is provided to simplify execution, so you don't have to type &lt;code&gt;java -jar target/local-llm.jar&lt;/code&gt; every time:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./jllm &amp;lt;&lt;span class="nb"&gt;command&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;options]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To make it available system-wide, add the project directory to your &lt;code&gt;PATH&lt;/code&gt; or copy &lt;code&gt;jllm&lt;/code&gt; to &lt;code&gt;/usr/local/bin&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cp &lt;/span&gt;jllm /usr/local/bin/jllm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion and Future Outlook
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;jllm&lt;/code&gt; is designed to empower Java developers to leverage local LLMs more easily and powerfully. It's privacy-focused, lightweight, and highly extensible.&lt;/p&gt;

&lt;p&gt;I invite you to explore the GitHub repository, try out the project, and share your thoughts. Your feedback and contributions are highly welcome, especially regarding the JNI integration, Lucene-based RAG, and the new API endpoints!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub Repository:&lt;/strong&gt; &lt;a href="https://github.com/cmc-labo/jllm" rel="noopener noreferrer"&gt;https://github.com/cmc-labo/jllm&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>java</category>
      <category>llm</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
