<?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: bossandboss</title>
    <description>The latest articles on DEV Community by bossandboss (@bossandboss).</description>
    <link>https://dev.to/bossandboss</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%2F4009729%2F8edf271b-c81f-4eb1-8004-570f9dc6049d.png</url>
      <title>DEV Community: bossandboss</title>
      <link>https://dev.to/bossandboss</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bossandboss"/>
    <language>en</language>
    <item>
      <title>👻 GhostEnv</title>
      <dc:creator>bossandboss</dc:creator>
      <pubDate>Sat, 18 Jul 2026 13:12:31 +0000</pubDate>
      <link>https://dev.to/bossandboss/ghostenv-4132</link>
      <guid>https://dev.to/bossandboss/ghostenv-4132</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Secure your development secrets inside your native OS Keychain without ever polluting your source code or exposing secrets on Git.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;GhostEnv is a revolutionary, polyglot, and 100% language-agnostic tool designed to completely eradicate accidental API key and authentication secret leaks on GitHub. &lt;/p&gt;

&lt;p&gt;Moving away from obsolete background auto-rewriting and language-specific bootstrap injections (like &lt;code&gt;node -r&lt;/code&gt;), GhostEnv introduces an &lt;strong&gt;Interactive CLI Terminal UX Flow&lt;/strong&gt; during Git pre-commits and a &lt;strong&gt;Universal Transient Environment Wrapper&lt;/strong&gt; (&lt;code&gt;ghostenv run&lt;/code&gt;).&lt;/p&gt;




&lt;h2&gt;
  
  
  🚀 Key Features
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Interactive Git Pre-Commit Hook
&lt;/h3&gt;

&lt;p&gt;No more silent, background file rewrites. When GhostEnv's AST and regex scanner detects secrets in staged files (&lt;code&gt;git diff --cached&lt;/code&gt;):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Instant Terminal Interaction&lt;/strong&gt;: The commit pauses and displays an interactive CLI prompt directly in your console.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Visual Confirmation (Simulated Git Diff)&lt;/strong&gt;: If you select Option &lt;code&gt;[1]&lt;/code&gt; to secure your keys, GhostEnv simulates and displays the exact code changes via a clean, colorized terminal &lt;code&gt;git diff&lt;/code&gt; representation.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Final &lt;code&gt;[Y/n]&lt;/code&gt; Confirmation&lt;/strong&gt;: Your files are modified and re-staged (&lt;code&gt;git add&lt;/code&gt;) only after you give explicit validation.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Universal Command Execution Wrapper (&lt;code&gt;ghostenv run&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;GhostEnv eliminates the need for language-specific runtime hooks or custom library imports:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;100% Language-Agnostic&lt;/strong&gt;: Works with any language, framework, or process runner.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ghostenv run &lt;span class="nt"&gt;--&lt;/span&gt; npm start
ghostenv run &lt;span class="nt"&gt;--&lt;/span&gt; python main.py
ghostenv run &lt;span class="nt"&gt;--&lt;/span&gt; docker-compose up
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;In-Memory Enriched Injections&lt;/strong&gt;: Right before your target application starts, the wrapper extracts the project's secrets from your OS native credentials manager (macOS Keychain, Windows Credential Manager, Linux Secret Service) and injects them strictly into the transient process memory environment variables ($ENV).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Zero Local Disk Footprint&lt;/strong&gt;: Credentials never touch local storage, and they completely evaporate from memory as soon as the child process exits.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Premium Performance &amp;amp; Logging
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  Ultra-fast execution path (&lt;strong&gt;&amp;lt;300ms&lt;/strong&gt; before displaying the terminal interactive prompt).&lt;/li&gt;
&lt;li&gt;  Premium terminal layouts featuring intuitive emojis, clean spacing, and readable status indicators.&lt;/li&gt;
&lt;li&gt;  Full backward compatibility with native operating system keychains.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://github.com/bossandboss/GhosteEnv" rel="noopener noreferrer"&gt;https://github.com/bossandboss/GhosteEnv&lt;/a&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>security</category>
      <category>showdev</category>
      <category>tooling</category>
    </item>
    <item>
      <title>Building EdgeSync-LLM: The Final Architecture for Decentralized, Offline-First Local AI 🚀</title>
      <dc:creator>bossandboss</dc:creator>
      <pubDate>Sun, 12 Jul 2026 10:32:26 +0000</pubDate>
      <link>https://dev.to/bossandboss/building-edgesync-llm-the-final-architecture-for-decentralized-offline-first-local-ai-3j0b</link>
      <guid>https://dev.to/bossandboss/building-edgesync-llm-the-final-architecture-for-decentralized-offline-first-local-ai-3j0b</guid>
      <description>&lt;h1&gt;
  
  
  Published: true
&lt;/h1&gt;

&lt;h1&gt;
  
  
  Description: A deep dive into the final version of EdgeSync-LLM—bringing fast, secure, synchronized Large Language Models straight to edge hardware.
&lt;/h1&gt;

&lt;h1&gt;
  
  
  Tags: ai, open source, architecture, edgecomputing, webdev
&lt;/h1&gt;

&lt;p&gt;The cloud dependency trap in modern AI is real. Relying on remote servers means paying hefty subscription fees, coping with unpredictable network latency, and hoping your sensitive data doesn’t leak. &lt;/p&gt;

&lt;p&gt;But what if you could run a Large Language Model completely offline on consumer-grade edge hardware, and have multiple local devices intelligently synchronize their states and contexts without a single drop of internet?&lt;/p&gt;

&lt;p&gt;Meet EdgeSync-LLM — a local-first, decentralized AI synchronization framework designed for the modern edge. In this post, I will break down the final architecture, key optimizations, and how you can get started with it.&lt;/p&gt;




&lt;h2&gt;
  
  
  💡 The Vision: Why "Edge" + "Sync"?
&lt;/h2&gt;

&lt;p&gt;Running local LLMs (using tools like llama.cpp or quantized models) isn't entirely new. However, most local setups treat the device as an isolated island. &lt;/p&gt;

&lt;p&gt;If you have a network of edge devices (like smart home nodes, local workplace computers, or off-grid field tablets), they have no native way to share learned context, active system prompts, or conversational memory with each other safely. &lt;/p&gt;

&lt;p&gt;EdgeSync-LLM solves the synchronization gap by establishing a lightweight, decentralized communication layer right on top of optimized local inference. &lt;/p&gt;




&lt;h2&gt;
  
  
  🏗️ The Core Architecture
&lt;/h2&gt;

&lt;p&gt;The final version of EdgeSync-LLM splits the workload into three distinct, highly integrated layers:&lt;/p&gt;

&lt;p&gt;+-------------------------------------------------------+&lt;br&gt;
|                 Device Application Layer              |&lt;br&gt;
+-------------------------------------------------------+&lt;br&gt;
|    Inference Engine Layer    |  Synchronization Layer  |&lt;br&gt;
| (Quantized GGUF / Local LLM) | (P2P State &amp;amp; Context) |&lt;br&gt;
+-------------------------------------------------------+&lt;br&gt;
|                    Edge Hardware                      |&lt;br&gt;
+-------------------------------------------------------+&lt;/p&gt;

&lt;h3&gt;
  
  
  1. The Optimized Inference Engine
&lt;/h3&gt;

&lt;p&gt;To run an LLM efficiently on hardware with constrained RAM, we rely heavily on advanced quantization formats (like GGUF). The framework is optimized to run 1B to 8B parameter models, allowing it to achieve smooth token generation speeds even on everyday laptops or high-end single-board computers.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. The Peer-to-Peer Sync Layer
&lt;/h3&gt;

&lt;p&gt;Instead of routing context histories back to a centralized cloud database, EdgeSync-LLM establishes a secure, local peer-to-peer (P2P) network mesh. When one device gains a specific contextual update or systemic state change, it broadcasts a lightweight cryptographic delta patch across the local network. &lt;/p&gt;




&lt;h2&gt;
  
  
  📊 Final Version Performance Metrics
&lt;/h2&gt;

&lt;p&gt;After rigorous testing and optimization for this final release, the framework has hit some massive performance milestones:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Blazing Fast Generation: Achieved stable 12-15+ tokens per second on standard, unaccelerated consumer edge CPUs.&lt;/li&gt;
&lt;li&gt;Aggressive Memory Optimization: Cut active RAM usage down to under 3.5 GB, meaning it runs quietly in the background without hogging host resources.&lt;/li&gt;
&lt;li&gt;Instant Local Syncing: Sub-second state synchronization latencies across local nodes.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🛠️ Getting Started (Quick Setup)
&lt;/h2&gt;

&lt;p&gt;Want to deploy it locally? The framework is designed to be developer-friendly. You can spin up a node with just a few terminal commands.&lt;/p&gt;

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

&lt;p&gt;Make sure you have your target quantized model ready (.gguf format) and node packages/Python dependencies installed according to your system environment.&lt;/p&gt;

&lt;h3&gt;
  
  
  Installation
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Clone the repository&lt;/span&gt;
git clone https://github.com/bossandboss/EdgeSync-LLM.git
&lt;span class="nb"&gt;cd &lt;/span&gt;EdgeSync-LLM

&lt;span class="c"&gt;# Install dependencies and initialize the engine&lt;/span&gt;
npm &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Spin up a synchronized node
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Start the EdgeSync engine and bind it to a local mesh port&lt;/span&gt;
npm run start &lt;span class="nt"&gt;--&lt;/span&gt; &lt;span class="nt"&gt;--model&lt;/span&gt; ./models/llama-3-8b-q4.gguf &lt;span class="nt"&gt;--port&lt;/span&gt; 8080 &lt;span class="nt"&gt;--sync-port&lt;/span&gt; 9090
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once multiple instances are live on your local network, they automatically detect peer broadcast beacons and begin securely sharing context deltas.&lt;/p&gt;




&lt;h2&gt;
  
  
  🌐 Real-World Impact
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Strict Privacy Sectors: Medical environments can deploy decentralized triage AI assistants across floor tablets without risking patient data compliance.&lt;/li&gt;
&lt;li&gt;Zero-Connectivity Fieldwork: Disaster relief or research groups operating entirely off-grid can maintain shared AI synchronization using local Wi-Fi or radio mesh.&lt;/li&gt;
&lt;li&gt;Next-Gen Smart Homes: Private automation where your home data stays localized to the physical property.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ⭐ Open Source &amp;amp; Next Steps
&lt;/h2&gt;

&lt;p&gt;EdgeSync-LLM is built entirely out in the open. The code, full architectural diagrams, and comprehensive deployment documentation are live on GitHub right now.&lt;/p&gt;

&lt;p&gt;We are currently looking into hardware-native NPU acceleration and zero-knowledge proof integrations for even tighter syncing security. If this sounds like something you want to build or experiment with, we'd love your feedback, issues, and pull requests!&lt;/p&gt;

&lt;p&gt;👉 Check out the repo here: &lt;a href="https://github.com/bossandboss/EdgeSync-LLM" rel="noopener noreferrer"&gt;https://github.com/bossandboss/EdgeSync-LLM&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;What are your thoughts on running synchronized AI on the edge? Drop your questions or optimization ideas in the comments below!&lt;/p&gt;

</description>
      <category>ai</category>
      <category>architecture</category>
      <category>distributedsystems</category>
      <category>llm</category>
    </item>
    <item>
      <title>I Got 9.9 Lower TTFT on a Real Android Phone by Reusing llama.cpp KV State</title>
      <dc:creator>bossandboss</dc:creator>
      <pubDate>Sat, 11 Jul 2026 21:17:57 +0000</pubDate>
      <link>https://dev.to/bossandboss/i-got-99x-lower-ttft-on-a-real-android-phone-by-reusing-llamacpp-kv-state-1ngi</link>
      <guid>https://dev.to/bossandboss/i-got-99x-lower-ttft-on-a-real-android-phone-by-reusing-llamacpp-kv-state-1ngi</guid>
      <description>&lt;p&gt;Local LLM inference has an expensive habit:&lt;br&gt;
It recomputes prefixes it has already seen.&lt;br&gt;
A system prompt.&lt;br&gt;
A reused RAG document.&lt;br&gt;
A few-shot block.&lt;br&gt;
A long static context.&lt;br&gt;
If the prefix is identical, why pay the prefill cost again?&lt;br&gt;
That's the problem I explored with EdgeSync-LLM.&lt;br&gt;
The idea&lt;br&gt;
The mechanism is simple:&lt;br&gt;
Prompt = shared prefix + new suffix&lt;br&gt;
On the first request, EdgeSync prefills the prefix and captures its KV cache state.&lt;br&gt;
On the next request sharing that exact prefix, it restores the state and decodes only the new suffix.&lt;br&gt;
No llama.cpp fork.&lt;br&gt;
No patch.&lt;br&gt;
The current validated path uses the public:&lt;br&gt;
llama_state_seq_get_data&lt;br&gt;
and&lt;br&gt;
llama_state_seq_set_data&lt;br&gt;
APIs.&lt;br&gt;
Measured on a real Android ARM64 phone&lt;br&gt;
Model:&lt;br&gt;
Qwen2.5-0.5B-Instruct Q4_K_M&lt;br&gt;
Shared prefix:&lt;br&gt;
123 tokens&lt;br&gt;
40 requests. 4 threads. Release build.&lt;br&gt;
Path&lt;br&gt;
Mean TTFT&lt;br&gt;
p50&lt;br&gt;
p95&lt;br&gt;
Cold&lt;br&gt;
4828 ms&lt;br&gt;
4752 ms&lt;br&gt;
5297 ms&lt;br&gt;
KV state reuse&lt;br&gt;
486 ms&lt;br&gt;
476 ms&lt;br&gt;
569 ms&lt;br&gt;
9.9× lower TTFT on cache hits.&lt;br&gt;
The warm path was approximately:&lt;br&gt;
363 ms to decode the 10-token suffix&lt;br&gt;
123 ms to restore the state blob&lt;br&gt;
Fragment size: 1.64 MB&lt;br&gt;
I also measured the same mechanism on x86-64.&lt;br&gt;
Cold mean TTFT: 1395 ms&lt;br&gt;
Warm mean TTFT: 185 ms&lt;br&gt;
That's 7.5× on cache hits.&lt;br&gt;
But I almost published a fake 8.8× speedup&lt;br&gt;
This was the most important part of the project.&lt;br&gt;
My first implementation directly copied raw K/V tensors.&lt;br&gt;
It was fast.&lt;br&gt;
Very fast.&lt;br&gt;
The benchmark reported an 8.8× speedup.&lt;br&gt;
There was one problem.&lt;br&gt;
It was wrong.&lt;br&gt;
llama.cpp tracks more than the K/V tensor values. Cache cells also have position and sequence metadata used to construct the attention mask.&lt;br&gt;
Copying tensor values without restoring that bookkeeping produced an inert fragment.&lt;br&gt;
The model skipped prefix computation...&lt;br&gt;
...but attention could not actually see the restored prefix.&lt;br&gt;
14 of 24 cache hits reproduced, token for token, the output of a generation with no prefix at all.&lt;br&gt;
The “speedup” was dropped context.&lt;br&gt;
So I discarded it.&lt;br&gt;
Timing is not enough&lt;br&gt;
A broken cache can be fast.&lt;br&gt;
That's why EdgeSync now runs two correctness checks.&lt;br&gt;
First:&lt;br&gt;
Warm output must match cold output for the same prompt.&lt;br&gt;
Results:&lt;br&gt;
ARM64: 28/28&lt;br&gt;
x86-64: 24/24&lt;br&gt;
Second:&lt;br&gt;
The warm output is compared with a generation from the suffix alone, without the prefix.&lt;br&gt;
If both outputs match, the injected fragment may be doing nothing.&lt;br&gt;
Results:&lt;br&gt;
ARM64: 0/28 matches&lt;br&gt;
x86-64: 0/24 matches&lt;br&gt;
This second control is what caught the broken raw-tensor implementation.&lt;br&gt;
A latency benchmark alone would not have caught it.&lt;br&gt;
What I learned&lt;br&gt;
There is a broader lesson here for LLM infrastructure benchmarking:&lt;br&gt;
Skipping computation is not proof that state reuse works.&lt;br&gt;
If a cache implementation silently drops context, it can look extremely fast.&lt;br&gt;
Correctness must be part of the benchmark.&lt;br&gt;
Not a separate test.&lt;br&gt;
Not an assumption.&lt;br&gt;
Part of the measurement itself.&lt;br&gt;
What EdgeSync does not claim&lt;br&gt;
I deliberately marked several parts of the project as unvalidated or unsound.&lt;br&gt;
Semantic approximate prefix reuse is not proven.&lt;br&gt;
Reusing KV state between merely “similar” prefixes is incorrect with the current mechanism.&lt;br&gt;
Cross-engine reuse does not work with opaque llama.cpp sequence-state blobs.&lt;br&gt;
Per-layer striding cannot preserve output.&lt;br&gt;
The Android JNI bridge and several cache management components still need end-to-end validation.&lt;br&gt;
The on-device ARM64 sampling is also thin and needs to be rerun with more timed repeats.&lt;br&gt;
I would rather publish a smaller result that can be falsified than a larger claim that cannot survive reproduction.&lt;br&gt;
What's next&lt;br&gt;
The next steps are:&lt;br&gt;
Rerun ARM64 with multiple timed repeats.&lt;br&gt;
Compare complete generated strings instead of one token.&lt;br&gt;
Benchmark HNSW against an exact radix-tree lookup.&lt;br&gt;
Measure state restoration cost as prefix length increases.&lt;br&gt;
Remove or redefine the current PARTIAL-hit mechanism.&lt;br&gt;
The code, benchmark methodology and measured manifests are public.&lt;br&gt;
EdgeSync-LLM:&lt;br&gt;
&lt;a href="https://github.com/bossandboss/EdgeSync-LLM" rel="noopener noreferrer"&gt;https://github.com/bossandboss/EdgeSync-LLM&lt;/a&gt;&lt;br&gt;
If you work on llama.cpp, local LLM inference, KV cache management or edge AI, I would especially value attempts to reproduce or break the benchmark.&lt;br&gt;
Finding a flaw is more useful to me than a GitHub star.&lt;/p&gt;

&lt;h1&gt;
  
  
  llm #cpp #android #ai
&lt;/h1&gt;

</description>
      <category>android</category>
      <category>llm</category>
      <category>performance</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
