{"id":11473,"date":"2026-02-04T18:01:08","date_gmt":"2026-02-04T18:01:08","guid":{"rendered":"https:\/\/techtrendfeed.com\/?p=11473"},"modified":"2026-02-04T18:01:08","modified_gmt":"2026-02-04T18:01:08","slug":"working-granite-4-0-1b-domestically-on-android","status":"publish","type":"post","link":"https:\/\/techtrendfeed.com\/?p=11473","title":{"rendered":"Working Granite 4.0-1B Domestically on Android"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div>\n<p>This began the best way these items often do \u2014 watching a podcast as a substitute of doing one thing productive (I ended up scripting this weblog, so possibly it was productive in spite of everything).<\/p>\n<p>I used to be listening to a Neuron AI episode about IBM\u2019s new Granite 4 mannequin household, with IBM Analysis\u2019s <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/www.linkedin.com\/in\/daviddanielcox\" rel=\"noopener noreferrer\" target=\"_blank\">David Cox<\/a> because the visitor. In the course of the dialogue on mannequin sizes and deployment targets, they talked about Granite 4 Nano, fashions designed particularly for edge and on-device use instances. Sooner or later, the dialogue turned to working these fashions in your telephone.<\/p>\n<p>Not as a hypothetical. Not as a demo. Simply as a factor you may do.<\/p>\n<p>That was sufficient.<\/p>\n<p>As a result of as soon as somebody says, \u201cYou&#8217;ll be able to run this in your telephone,\u201d in that context, the one affordable response is to cease listening and check out it your self.<\/p>\n<p>Granite 4 Nano isn\u2019t pitched as a toy mannequin. What makes it fascinating is that it\u2019s been designed to be small on function. That constraint reveals up in the way it behaves: extra direct solutions, much less wandering, and a basic sense that it\u2019s meant for use as a device reasonably than a conversational novelty.<\/p>\n<p>In order that\u2019s what that is. Granite 4.0-1B. Totally offline. Working regionally on an Android telephone. No cloud. No GPU. No vendor magic. Only a barely unhealthy stage of curiosity.<\/p>\n<p>The outcome was surprisingly boring. Which is precisely what you need.<\/p>\n<p>I\u2019ve saved this deliberately step-based so it\u2019s simple to breed with out guessing or filling in gaps.<\/p>\n<h2>What This Setup Provides You<\/h2>\n<p>You get two main methods to work together with Granite regionally:<\/p>\n<ul>\n<li>An interactive CLI for fast prompts and experimentation.<\/li>\n<li>A neighborhood internet interface backed by an HTTP server.<\/li>\n<\/ul>\n<p>Each run totally offline. No accounts, no telemetry, no background calls to something you didn\u2019t ask for.<\/p>\n<p>The CLI is precisely what you\u2019d anticipate. It\u2019s quick, direct, and good for testing prompts or sanity-checking conduct. Kind a query, get a solution, transfer on.<\/p>\n<p><img decoding=\"async\" style=\"width: 300px;\" class=\"fr-fic fr-dib lazyload\" data-image=\"true\" data-new=\"false\" data-sizeformatted=\"163.2 kB\" data-mimetype=\"image\/png\" data-creationdate=\"1768818190534\" data-creationdateformatted=\"01\/19\/2026 10:23 AM\" data-type=\"temp\" data-url=\"https:\/\/dz2cdn1.dzone.com\/storage\/temp\/18859080-granite.png\" data-modificationdate=\"null\" data-size=\"163193\" data-name=\"granite.png\" data-id=\"18859080\" src=\"https:\/\/dz2cdn1.dzone.com\/storage\/temp\/18859080-granite.png\" alt=\"Interacting with Granite locally\"\/><\/p>\n<p>The online interface is the place issues begin to get extra fascinating. By exposing the mannequin via a neighborhood HTTP server, you\u2019re not tied to a terminal. You get streaming responses, a browser-based chat UI, and the power to work together with the mannequin over easy HTTP requests.<\/p>\n<p><img decoding=\"async\" style=\"width: 300px;\" class=\"fr-fic fr-dib lazyload\" data-image=\"true\" data-new=\"false\" data-sizeformatted=\"91.4 kB\" data-mimetype=\"image\/png\" data-creationdate=\"1768818270285\" data-creationdateformatted=\"01\/19\/2026 10:24 AM\" data-type=\"temp\" data-url=\"https:\/\/dz2cdn1.dzone.com\/storage\/temp\/18859084-llama.png\" data-modificationdate=\"null\" data-size=\"91426\" data-name=\"llama.png\" data-id=\"18859084\" src=\"https:\/\/dz2cdn1.dzone.com\/storage\/temp\/18859084-llama.png\" alt=\"Web interface\"\/><\/p>\n<p>As soon as it\u2019s reachable this manner, Granite stops being \u201ca chatbot in your telephone\u201d and begins behaving like a neighborhood service. Something that may converse REST and ship JSON can work together with it, together with scripts, different apps, and automation instruments like Tasker.<\/p>\n<p>That is the place the \u201cdevice, not a conversational novelty\u201d thought truly comes into play. You\u2019re not restricted to typing prompts right into a UI. You&#8217;ll be able to wire the mannequin into workflows, triggers, and background duties, all with out leaving the machine or counting on a community connection.<\/p>\n<p>The setup stays deliberately minimal. No UI frameworks, no wrappers, no try and make this appear like a shopper app. Only a native mannequin, a easy server, and interfaces that keep out of the best way. A device.<\/p>\n<p>By the top of the information, Granite isn\u2019t working as a demo. It\u2019s working as a neighborhood service.<\/p>\n<h2>Structure (The Brief Model)<\/h2>\n<p>At its core, this setup may be very easy:<\/p>\n<ul>\n<li>A transformer-based Granite 4.0-1B mannequin.<\/li>\n<li>Executed regionally utilizing llama.cpp.<\/li>\n<li>Working on an ARM64 Android machine through Termux.<\/li>\n<\/ul>\n<p>There\u2019s no acceleration layer hiding within the background. No GPU, no Vulkan, no NNAPI. All the pieces runs on the CPU.<\/p>\n<p>The mannequin itself is the usual transformer variant of Granite 4.0-1B. IBM additionally ships Granite 4.0-H fashions that use a hybrid structure with state house layers. These are designed for various runtimes and aren\u2019t suitable with llama.cpp.<\/p>\n<p>On high of the runtime, there are two execution paths:<\/p>\n<ul>\n<li><code>llama-cli<\/code> for direct, interactive use.<\/li>\n<li><code>llama-server<\/code> for exposing the mannequin over HTTP.<\/li>\n<\/ul>\n<p>Each binaries use the identical mannequin file and the identical execution backend. One mannequin, two interfaces.<\/p>\n<p>Quantization is the place most sensible trade-offs lie. In brief, quantization reduces mannequin dimension by storing weights at decrease precision. This setup makes use of a Q5_K_M quantized mannequin that balances reminiscence utilization, pace, and reasoning high quality.<\/p>\n<h2>Stipulations<\/h2>\n<p>There are some things you want in place earlier than this works. None of them is uncommon, however lacking any of them will present up later in much less apparent methods.<\/p>\n<h3>Android<\/h3>\n<ul>\n<li>An ARM64 Android machine (I\u2019m utilizing a Galaxy S25 Extremely)<\/li>\n<li>At the least 8\u00a0GB of RAM beneficial<\/li>\n<li>Termux put in from F-Droid<\/li>\n<\/ul>\n<p>The Play Retailer model of Termux is outdated and lacking options required to construct native code reliably. Obtain and set up F-Droid, then seek for Termux and set up it.<\/p>\n<h3>PC (Mannequin Obtain Solely)<\/h3>\n<ul>\n<li>Python 3.10 or newer.<\/li>\n<li>A Hugging Face account with a learn token.<\/li>\n<\/ul>\n<p>In case you don\u2019t wish to use Python, you may as well obtain the mannequin immediately from Hugging Face and skip token setup fully.<\/p>\n<h2>Step 1: Set up Termux<\/h2>\n<p>With the conditions out of the best way,\u00a0it\u2019s time to arrange the setting on the telephone.<\/p>\n<p>As soon as Termux is put in from F-Droid,\u00a0open it and run:<\/p>\n<div class=\"codeMirror-wrapper\" contenteditable=\"false\">\n<div contenteditable=\"false\">\n<div class=\"codeMirror-code--wrapper\" data-code=\"pkg update&#10;pkg upgrade -y\" data-lang=\"text\/x-sh\">\n<pre><code lang=\"text\/x-sh\">pkg replace\npkg improve -y<\/code><\/pre>\n<\/p><\/div><\/div>\n<\/div>\n<p>This updates the bottom packages and units up entry to shared storage,\u00a0which you\u2019ll want later to position the mannequin file someplace exterior Termux\u2019s non-public listing.<\/p>\n<p>You\u2019ll be prompted to grant storage permissions.\u00a0Settle for them.\u00a0There\u2019s no workaround right here that\u2019s well worth the effort.<\/p>\n<p>After this completes, it&#8217;s best to have a clear, up-to-date Termux setting able to construct native code.<\/p>\n<h2>Step 2: Set up Construct Instruments<\/h2>\n<p>With Termux arrange,\u00a0the subsequent step is putting in the instruments wanted to construct llama.cpp regionally.<\/p>\n<div class=\"codeMirror-wrapper\" contenteditable=\"false\">\n<div contenteditable=\"false\">\n<div class=\"codeMirror-code--wrapper\" data-code=\"pkg install -y git cmake clang make ninja&#10;\" data-lang=\"text\/x-sh\">\n<pre><code lang=\"text\/x-sh\">pkg set up -y git cmake clang make ninja\n<\/code><\/pre>\n<\/p><\/div><\/div>\n<\/div>\n<p>As soon as set up finishes,\u00a0it\u2019s price checking that the fundamentals are literally out there:<\/p>\n<div class=\"codeMirror-wrapper\" contenteditable=\"false\">\n<div contenteditable=\"false\">\n<div class=\"codeMirror-code--wrapper\" data-code=\"git --version&#10;cmake --version&#10;clang --version\" data-lang=\"text\/x-sh\">\n<pre><code lang=\"text\/x-sh\">git --version\ncmake --version\nclang --version<\/code><\/pre>\n<\/p><\/div><\/div>\n<\/div>\n<p>If any of those instructions fail, cease right here and repair that first. The construct step gained\u2019t succeed in any other case.<\/p>\n<h2>Step 3: Construct Llama.cpp<\/h2>\n<p>With the construct instruments put in,\u00a0it\u2019s time to compile llama.cpp on the machine.<\/p>\n<p>Begin by cloning the repository and transferring into it:<\/p>\n<div class=\"codeMirror-wrapper\" contenteditable=\"false\">\n<div contenteditable=\"false\">\n<div class=\"codeMirror-code--wrapper\" data-code=\"cd ~&#10;git clone https:\/\/github.com\/ggml-org\/llama.cpp&#10;cd llama.cpp\" data-lang=\"text\/x-sh\">\n<pre><code lang=\"text\/x-sh\">cd ~\ngit clone https:\/\/github.com\/ggml-org\/llama.cpp\ncd llama.cpp<\/code><\/pre>\n<\/p><\/div><\/div>\n<\/div>\n<p>Then configure the construct utilizing CMake and Ninja:<\/p>\n<div class=\"codeMirror-wrapper\" contenteditable=\"false\">\n<div contenteditable=\"false\">\n<div class=\"codeMirror-code--wrapper\" data-code=\"cmake -S . -B build -G Ninja&#10;cmake --build build -j $(nproc)\" data-lang=\"text\/x-sh\">\n<pre><code lang=\"text\/x-sh\">cmake -S . -B construct -G Ninja\ncmake --build construct -j $(nproc)<\/code><\/pre>\n<\/p><\/div><\/div>\n<\/div>\n<p>This builds llama.cpp utilizing all out there CPU cores.\u00a0On a contemporary telephone,\u00a0this takes no quite a lot of minutes.<\/p>\n<p>As soon as the construct completes,\u00a0confirm that the binaries had been produced:<\/p>\n<div class=\"codeMirror-wrapper\" contenteditable=\"false\">\n<div contenteditable=\"false\">\n<div class=\"codeMirror-code--wrapper\" data-code=\"ls build\/bin | grep llama&#10;\" data-lang=\"text\/x-sh\">\n<pre><code lang=\"text\/x-sh\">ls construct\/bin | grep llama\n<\/code><\/pre>\n<\/p><\/div><\/div>\n<\/div>\n<p>It&#8217;s best to see <code>llama-cli<\/code> and <code>llama-server<\/code> within the output. In case you don\u2019t see them, verify the construct output and see in the event you can repair no matter is lacking.<\/p>\n<p>This construct makes use of the CPU backend solely. No GPU, no Vulkan, no NNAPI. Nothing else is required for this setup.<\/p>\n<h2>Step 4: Choose and Obtain the Granite Mannequin<\/h2>\n<p>IBM supplies a number of pre-quantized variations of Granite 4.0-1B on Hugging Face.\u00a0All of them share the identical base mannequin however differ in how they retailer weights,\u00a0which immediately impacts dimension,\u00a0pace,\u00a0and conduct.<\/p>\n<p>The fashions reside on this repository:<\/p>\n<div class=\"codeMirror-wrapper\" contenteditable=\"false\">\n<div contenteditable=\"false\">\n<div class=\"codeMirror-code--wrapper\" data-code=\"ibm-granite\/granite-4.0-1b-GGUF\" data-lang=\"text\/x-sh\">\n<pre><code lang=\"text\/x-sh\">ibm-granite\/granite-4.0-1b-GGUF<\/code><\/pre>\n<\/p><\/div><\/div>\n<\/div>\n<h3>Why GGUF<\/h3>\n<p>llama.cpp doesn&#8217;t run fashions of their authentic coaching format. It expects weights in <strong>the GGUF format<\/strong>, a runtime-friendly format designed\u00a0for environment friendly native inference.<\/p>\n<p>GGUF bundles the mannequin weights along with the metadata llama.cpp wants at runtime:\u00a0tensor layouts,\u00a0tokenizer info,\u00a0and mannequin parameters.\u00a0That\u2019s why these information may be loaded immediately with out further configuration.<\/p>\n<p>IBM supplies Granite 4 Nano fashions which might be already transformed to GGUF, eliminating\u00a0a complete preparation step.\u00a0There\u2019s no must export,\u00a0quantize,\u00a0or in any other case preprocess the mannequin simply to get it working.<\/p>\n<p>If you wish to,\u00a0you continue to can.<\/p>\n<p>The unique Granite fashions may be transformed to GGUF manually utilizing llama.cpp\u2019s conversion instruments,\u00a0and you may select your individual quantization settings within the course of.\u00a0That\u2019s helpful in the event you\u2019re experimenting or focusing on very particular constraints.<\/p>\n<p>For this setup,\u00a0there\u2019s no actual upside.\u00a0The offered GGUF information have already been examined and are able to run.\u00a0Utilizing them retains the concentrate on working the mannequin reasonably than\u00a0getting ready it.<\/p>\n<h3>Quantization Alternative<\/h3>\n<p>You\u2019ll see an extended checklist of information with names like Q2,\u00a0This fall,\u00a0Q5,\u00a0Q8,\u00a0and F16.\u00a0These consult with completely different quantization ranges.<\/p>\n<p>At a excessive stage:<\/p>\n<ul>\n<li>Decrease quantization means smaller information and quicker inference, however weaker reasoning.<\/li>\n<li>Increased quantization ends in higher output high quality however increased reminiscence utilization and slower efficiency.<\/li>\n<\/ul>\n<p>On cellular,\u00a0this can be a balancing act.\u00a0Very small fashions reply rapidly however disintegrate when confronted with something past easy prompts.\u00a0Very giant ones work,\u00a0however supply diminishing returns and pointless reminiscence stress.<\/p>\n<p>For this setup,\u00a0Q5_K_M is an effective center floor.\u00a0It\u2019s sufficiently small to run comfortably on a contemporary telephone,\u00a0however constant sufficient to deal with longer prompts and multi-step directions with out drifting.<\/p>\n<p>That\u2019s the model used all through the remainder of this information.<\/p>\n<h3>Authentication and Obtain<\/h3>\n<p>Granite fashions require authentication to obtain.<\/p>\n<p>On this setup,\u00a0authentication is dealt with utilizing a Hugging Face learn token offered through an setting variable.\u00a0This avoids interactive logins and retains the method scriptable and reproducible.<\/p>\n<p>Create a learn token through the Hugging Face internet UI, then export it in your PC:<\/p>\n<div class=\"codeMirror-wrapper\" contenteditable=\"false\">\n<div contenteditable=\"false\">\n<div class=\"codeMirror-code--wrapper\" data-code=\"$env:HUGGINGFACE_HUB_TOKEN=&quot;hf_...&quot;\" data-lang=\"application\/x-powershell\">\n<pre><code lang=\"application\/x-powershell\">$env:HUGGINGFACE_HUB_TOKEN=\"hf_...\"<\/code><\/pre>\n<\/p><\/div><\/div>\n<\/div>\n<p>With the token set,\u00a0obtain the mannequin utilizing Python:<\/p>\n<div class=\"codeMirror-wrapper\" contenteditable=\"false\">\n<div contenteditable=\"false\">\n<div class=\"codeMirror-code--wrapper\" data-code=\"python -c &quot;from huggingface_hub import hf_hub_download;&#10;hf_hub_download(repo_id='ibm-granite\/granite-4.0-1b-GGUF',&#10;filename=\" granite-4.0-1b-q5_k_m.gguf=\"\" local_dir=\"granite-4.0-1b-gguf\" data-lang=\"text\/x-python\">\n<pre><code lang=\"text\/x-python\">python -c <span style=\"color:#649500;\">\"from huggingface_hub import hf_hub_download;\nhf_hub_download(repo_id='ibm-granite\/granite-4.0-1b-GGUF',\nfilename=\"granite-4.0-1b-Q5_K_M.gguf\", local_dir=\"granite-4.0-1b-gguf\")\"<\/span><\/code><\/pre>\n<\/p><\/div><\/div>\n<\/div>\n<p>In case you don\u2019t wish to use Python or don\u2019t wish to swap gadgets, you may as well obtain the mannequin immediately from the Hugging Face web site and skip the token setup fully (you will want an account): <a rel=\"nofollow\" target=\"_blank\" href=\"https:\/\/huggingface.co\/ibm-granite\/granite-4.0-1b-GGUF\" rel=\"noopener noreferrer\" target=\"_blank\">https:\/\/huggingface.co\/ibm-granite\/granite-4.0-1b-GGUF<\/a>.<\/p>\n<p>As soon as the file is downloaded, you\u2019re completed with the PC. The subsequent step is transferring the mannequin onto the telephone.<\/p>\n<h2>Step 5: Copy the Mannequin to Android<\/h2>\n<p>As soon as the mannequin file is downloaded,\u00a0it must be copied onto the telephone.<\/p>\n<p>Place the file on the following location:<\/p>\n<div class=\"codeMirror-wrapper\" contenteditable=\"false\">\n<div contenteditable=\"false\">\n<div class=\"codeMirror-code--wrapper\" data-code=\"\/storage\/emulated\/0\/models\/granite-4.0-1b-Q5_K_M.gguf&#10;\" data-lang=\"text\/plain\">\n<pre><code lang=\"text\/plain\">\/storage\/emulated\/0\/fashions\/granite-4.0-1b-Q5_K_M.gguf\n<\/code><\/pre>\n<\/p><\/div><\/div>\n<\/div>\n<p>On Android, <code>\/storage\/emulated\/0<\/code> is the bottom listing you see when opening your file supervisor. It\u2019s sometimes labelled as inner storage or telephone storage. Making a <code>fashions<\/code> folder there retains issues easy and simple to search out.<\/p>\n<p>The precise listing title doesn\u2019t matter a lot,\u00a0however holding fashions exterior Termux\u2019s dwelling listing makes them simpler to handle and reuse later.<\/p>\n<p>After copying the file, confirm it from inside Termux:<\/p>\n<div class=\"codeMirror-wrapper\" contenteditable=\"false\">\n<div contenteditable=\"false\">\n<div class=\"codeMirror-code--wrapper\" data-code=\"ls -lh \/storage\/emulated\/0\/models\/granite-4.0-1b-Q5_K_M.gguf\" data-lang=\"text\/x-sh\">\n<pre><code lang=\"text\/x-sh\">ls -lh \/storage\/emulated\/0\/fashions\/granite-4.0-1b-Q5_K_M.gguf<\/code><\/pre>\n<\/p><\/div><\/div>\n<\/div>\n<p>It&#8217;s best to see the file listed at roughly 1.2 GB. If it\u2019s there, Termux can entry it, and also you\u2019re prepared to maneuver on.<\/p>\n<h2>Step 6: Handbook Validation Run<\/h2>\n<p>Earlier than wiring something up or automating it,\u00a0it\u2019s price ensuring the mannequin truly runs.<\/p>\n<p>From contained in the <code>llama.cpp<\/code> listing, run the next command:<\/p>\n<div class=\"codeMirror-wrapper\" contenteditable=\"false\">\n<div contenteditable=\"false\">\n<div class=\"codeMirror-code--wrapper\" data-code=\".\/build\/bin\/llama-cli &#10;  -m \/storage\/emulated\/0\/models\/granite-4.0-1b-Q5_K_M.gguf &#10;  -t 8 &#10;  -c 2048 &#10;  --temp 0.7 &#10;  --top-p 0.9 &#10;  -p &quot;Explain DNS in simple terms.&quot;\" data-lang=\"text\/x-sh\">\n<pre><code lang=\"text\/x-sh\">.\/construct\/bin\/llama-cli \n  -m \/storage\/emulated\/0\/fashions\/granite-4.0-1b-Q5_K_M.gguf \n  -t 8 \n  -c 2048 \n  --temp 0.7 \n  --top-p 0.9 \n\u00a0 -p \"Clarify DNS in easy phrases.\"<\/code><\/pre>\n<\/p><\/div><\/div>\n<\/div>\n<p>On a Galaxy S25 Extremely,\u00a0it&#8217;s best to see one thing within the ballpark of:<\/p>\n<ul>\n<li>immediate processing round ~45\u201350 tokens\/sec<\/li>\n<li>technology pace round ~20\u201322 tokens\/sec<\/li>\n<\/ul>\n<p><img decoding=\"async\" style=\"width: 300px;\" class=\"fr-fic fr-dib lazyload\" data-image=\"true\" data-new=\"false\" data-sizeformatted=\"253.3 kB\" data-mimetype=\"image\/png\" data-creationdate=\"1768823715450\" data-creationdateformatted=\"01\/19\/2026 11:55 AM\" data-type=\"temp\" data-url=\"https:\/\/dz2cdn1.dzone.com\/storage\/temp\/18860058-galaxy.png\" data-modificationdate=\"null\" data-size=\"253296\" data-name=\"galaxy.png\" data-id=\"18860058\" src=\"https:\/\/dz2cdn1.dzone.com\/storage\/temp\/18860058-galaxy.png\" alt=\"20 tokens per second on a Galaxy S25 Ultra\"\/><\/p>\n<p>At round 20 tokens per second, technology is already quicker than most individuals can learn.<\/p>\n<p>The context dimension is ready to 2048 tokens as a steady default for cellular.\u00a0Bigger values improve reminiscence utilization and don\u2019t purchase you a lot for this type of setup.<\/p>\n<p>In case you run into out-of-memory errors,\u00a0sudden course of termination,\u00a0or aggressive thermal throttling,\u00a0cut back the thread rely.<\/p>\n<p>Cheap fallbacks are:<\/p>\n<p>or, if wanted:<\/p>\n<p>If this works, the laborious half is over (not that arduous, actually).<\/p>\n<h2>Step 7: Startup Script (Server + CLI)<\/h2>\n<p>Now that the mannequin runs manually,\u00a0it\u2019s time to make it barely extra helpful.\u00a0An online browser tends to be extra user-friendly than a terminal session anyway.<\/p>\n<p>The purpose right here is straightforward:<\/p>\n<ul>\n<li>Begin the HTTP server within the background.<\/li>\n<li>Drop straight into an interactive CLI session (for the actual techies amongst you).<\/li>\n<\/ul>\n<p>Create a startup script in your house listing:<\/p>\n<div class=\"codeMirror-wrapper\" contenteditable=\"false\">\n<div contenteditable=\"false\">\n<div class=\"codeMirror-code--wrapper\" data-code=\"nano ~\/granite-4.0-1b-start.sh\" data-lang=\"text\/x-sh\">\n<pre><code lang=\"text\/x-sh\">nano ~\/granite-4.0-1b-start.sh<\/code><\/pre>\n<\/p><\/div><\/div>\n<\/div>\n<p>Add the next:<\/p>\n<div class=\"codeMirror-wrapper\" contenteditable=\"false\">\n<div contenteditable=\"false\">\n<div class=\"codeMirror-code--wrapper\" data-code=\"#!\/data\/data\/com.termux\/files\/usr\/bin\/bash&#10;&#10;MODEL=&quot;\/storage\/emulated\/0\/models\/granite-4.0-1b-Q5_K_M.gguf&quot;&#10;BIN=&quot;$HOME\/llama.cpp\/build\/bin&quot;&#10;&#10;$BIN\/llama-server &#10;  -m &quot;$MODEL&quot; &#10;  -t 8 &#10;  -c 2048 &#10;  --host 127.0.0.1 &#10;  --port 8080 &#10;  &gt; ~\/granite-server.log 2&gt;&amp;1 &amp;&#10;&#10;sleep 3&#10;&#10;$BIN\/llama-cli &#10;  -m &quot;$MODEL&quot; &#10;  -t 8 &#10;  -c 2048 &#10;  --temp 0.7 &#10;  --top-p 0.9 \" data-lang=\"text\/x-sh\">\n<pre><code lang=\"text\/x-sh\">#!\/information\/information\/com.termux\/information\/usr\/bin\/bash\n\nMODEL=\"\/storage\/emulated\/0\/fashions\/granite-4.0-1b-Q5_K_M.gguf\"\nBIN=\"$HOME\/llama.cpp\/construct\/bin\"\n\n$BIN\/llama-server \n  -m \"$MODEL\" \n  -t 8 \n  -c 2048 \n  --host 127.0.0.1 \n  --port 8080 \n  &gt; ~\/granite-server.log 2&gt;&amp;1 &amp;\n\nsleep 3\n\n$BIN\/llama-cli \n  -m \"$MODEL\" \n  -t 8 \n  -c 2048 \n  --temp 0.7 \n\u00a0 --top-p 0.9 <\/code><\/pre>\n<\/p><\/div><\/div>\n<\/div>\n<p>Make the script executable:<\/p>\n<div class=\"codeMirror-wrapper\" contenteditable=\"false\">\n<div contenteditable=\"false\">\n<div class=\"codeMirror-code--wrapper\" data-code=\"chmod +x ~\/granite-4.0-1b-start.sh\" data-lang=\"text\/x-sh\">\n<pre><code lang=\"text\/x-sh\">chmod +x ~\/granite-4.0-1b-start.sh<\/code><\/pre>\n<\/p><\/div><\/div>\n<\/div>\n<p>Run it:<\/p>\n<div class=\"codeMirror-wrapper\" contenteditable=\"false\">\n<div contenteditable=\"false\">\n<div class=\"codeMirror-code--wrapper\" data-code=\".\/granite-4.0-1b-start.sh&#10;\" data-lang=\"text\/x-sh\">\n<pre><code lang=\"text\/x-sh\">.\/granite-4.0-1b-start.sh\n<\/code><\/pre>\n<\/p><\/div><\/div>\n<\/div>\n<p>Whenever you exit the CLI, the HTTP server retains working.<\/p>\n<h2>Step 8: Net UI<\/h2>\n<p>With the server working, open a browser on the telephone and navigate to:<\/p>\n<p>That\u2019s it.<\/p>\n<p>You\u2019ll get a web-based chat interface backed by the native HTTP server. Prompts are despatched to the mannequin, responses stream again in actual time, and all the pieces stays on-device. It&#8217;s a bit slower than the CLI, however nonetheless very helpful.<\/p>\n<p><img decoding=\"async\" style=\"width: 300px;\" class=\"fr-fic fr-dib lazyload\" data-image=\"true\" data-new=\"false\" data-sizeformatted=\"184.1 kB\" data-mimetype=\"image\/png\" data-creationdate=\"1768825695774\" data-creationdateformatted=\"01\/19\/2026 12:28 PM\" data-type=\"temp\" data-url=\"https:\/\/dz2cdn1.dzone.com\/storage\/temp\/18860074-interface.png\" data-modificationdate=\"null\" data-size=\"184147\" data-name=\"interface.png\" data-id=\"18860074\" src=\"https:\/\/dz2cdn1.dzone.com\/storage\/temp\/18860074-interface.png\" alt=\"Web-based chat interface backed by the local HTTP server\"\/><\/p>\n<p>The interface retains issues easy, however it\u2019s not naked bones. You get correct chat conduct: dialog historical past is preserved, responses may be edited and regenerated, and you may work with a number of chats in parallel. In follow, it behaves very like the net interfaces persons are already used to, simply backed by a mannequin working regionally on the machine.<\/p>\n<p>As a result of the server binds to<code>127.0.0.1<\/code>,\u00a0it\u2019s solely accessible regionally.<\/p>\n<p>At this level, you possibly can shut the terminal in the event you like. If the server course of continues to be working, the net UI will proceed to work.<\/p>\n<h2>Step 9: Auto-Begin on Termux Launch<\/h2>\n<p>At this level,\u00a0all the pieces works.\u00a0The final step is making it stick.<\/p>\n<p>The purpose right here is straightforward:\u00a0once you open Termux,\u00a0Granite begins robotically.\u00a0No handbook instructions,\u00a0no remembering which script to run.\u00a0Prepared to make use of,\u00a0each time.<\/p>\n<p>Edit your shell startup file:<\/p>\n<p>Append the next:<\/p>\n<div class=\"codeMirror-wrapper\" contenteditable=\"false\">\n<div contenteditable=\"false\">\n<div class=\"codeMirror-code--wrapper\" data-code=\"if [ -z &quot;$GRANITE_STARTED&quot; ]; then&#10;  export GRANITE_STARTED=1&#10;  ~\/granite-4.0-1b-start.sh&#10;fi\" data-lang=\"text\/x-sh\">\n<pre><code lang=\"text\/x-sh\">if [ -z \"$GRANITE_STARTED\" ]; then\n  export GRANITE_STARTED=1\n  ~\/granite-4.0-1b-start.sh\nfi<\/code><\/pre>\n<\/p><\/div><\/div>\n<\/div>\n<p>This ensures the startup script runs as soon as per Termux session. The guard variable prevents unintended double begins, and shutting Termux cleanly shuts all the pieces down.<\/p>\n<p>If Termux crashes or is force-stopped,\u00a0the guard resets, and Granite will begin once more the subsequent time you open it.<\/p>\n<h3>Stopping the Server<\/h3>\n<p>If you wish to cease the HTTP server with out closing Termux:<\/p>\n<p>That\u2019s it. From right here on out, opening Termux is sufficient to carry Granite again on-line.<\/p>\n<h2>Notes<\/h2>\n<p>Just a few sensible issues price holding in thoughts after setting this up:<\/p>\n<ul>\n<li>Granite 4.0-H fashions use a hybrid structure with state house layers and usually are not suitable with llama.cpp. This setup solely applies to the transformer-based Granite 4 Nano fashions.<\/li>\n<li>Q5_K_M works properly on trendy telephones. In case you run into stability points, decreasing the thread rely is often step one.<\/li>\n<li>The CLI and HTTP server can run on the identical time. Exiting the CLI doesn&#8217;t have an effect on the server so long as the Termux session stays open.<\/li>\n<li>As soon as the mannequin is downloaded, all the pieces runs totally offline. No community entry is required for inference.<\/li>\n<li>The HTTP server is sure to localhost by default. Exposing it to the community is feasible, however deliberately not lined right here.<\/li>\n<li>Efficiency, thermals, and battery affect range by machine. Newer telephones deal with this comfortably; older ones might have extra conservative settings.<\/li>\n<li>This setup is just not optimized for background execution or for lengthy battery life. It\u2019s meant to be sensible, not invisible.<\/li>\n<\/ul>\n<h2>Closing<\/h2>\n<p>At this level, Granite is working regionally on the machine, begins robotically with Termux, and is accessible each interactively and over HTTP.<\/p>\n<p>I\u2019ve stated this already, however that\u2019s what a closing is for, proper?<\/p>\n<p>There\u2019s no cloud dependency, no account setup, and no particular runtime past what\u2019s proven above. As soon as the mannequin is in place, all the pieces else is simply course of administration.<\/p>\n<p>It\u2019s not notably spectacular to have a look at. It\u2019s simply helpful.<\/p>\n<p>Which is precisely what you need from a neighborhood mannequin.<\/p>\n<p>Have enjoyable!<\/p>\n<\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>This began the best way these items often do \u2014 watching a podcast as a substitute of doing one thing productive (I ended up scripting this weblog, so possibly it was productive in spite of everything). I used to be listening to a Neuron AI episode about IBM\u2019s new Granite 4 mannequin household, with IBM [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":11475,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[56],"tags":[7705,797,7704,7706,839],"class_list":["post-11473","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software","tag-4-01b","tag-android","tag-granite","tag-locally","tag-running"],"_links":{"self":[{"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/posts\/11473","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=11473"}],"version-history":[{"count":1,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/posts\/11473\/revisions"}],"predecessor-version":[{"id":11474,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/posts\/11473\/revisions\/11474"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=\/wp\/v2\/media\/11475"}],"wp:attachment":[{"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=11473"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=11473"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techtrendfeed.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=11473"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}<!-- This website is optimized by Airlift. Learn more: https://airlift.net. Template:. Learn more: https://airlift.net. Template: 69d9690a190636c2e0989534. Config Timestamp: 2026-04-10 21:18:02 UTC, Cached Timestamp: 2026-05-06 16:36:18 UTC -->