<?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: Trebell</title>
    <description>The latest articles on DEV Community by Trebell (@trebell).</description>
    <link>https://dev.to/trebell</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%2F3969009%2Fbaba1fac-80de-406b-93c1-06e6057936dc.png</url>
      <title>DEV Community: Trebell</title>
      <link>https://dev.to/trebell</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/trebell"/>
    <language>en</language>
    <item>
      <title>I Put 166,700 Fly Neurons in a Browser. Kiro Helped Me Keep the Science Honest.</title>
      <dc:creator>Trebell</dc:creator>
      <pubDate>Fri, 04 Dec 2026 16:24:09 +0000</pubDate>
      <link>https://dev.to/trebell/i-put-166700-fly-neurons-in-a-browser-kiro-helped-me-keep-the-science-honest-3e49</link>
      <guid>https://dev.to/trebell/i-put-166700-fly-neurons-in-a-browser-kiro-helped-me-keep-the-science-honest-3e49</guid>
      <description>&lt;p&gt;What happens when you connect a fruit fly's brain to a video game?&lt;/p&gt;

&lt;p&gt;Does the fly actually control anything? Or is the surrounding code doing all the work while the brain gets the credit?&lt;/p&gt;

&lt;p&gt;That question became &lt;strong&gt;Frankenfly&lt;/strong&gt;, my project for the &lt;strong&gt;Kiroween 2026 hackathon&lt;/strong&gt;, entered under the Frankenstein category.&lt;/p&gt;

&lt;p&gt;Frankenfly combines a real fruit fly's neural wiring map, a spiking-neuron simulation, a six-legged physics body, and a 3D platformer. You can watch recorded experiments, disconnect the code controlling parts of the fly, and inspect what its simulated neurons actually did.&lt;/p&gt;

&lt;p&gt;There's also a live operating table where the entire brain network runs in your browser, and you can manipulate its connections while it fires.&lt;/p&gt;

&lt;p&gt;But building something like this creates an interesting problem: &lt;strong&gt;how do you stop a fascinating scientific demo from making claims that its own results don't support?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That's where Kiro's approach to specs, steering, and verification became particularly useful.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;This article was written as part of the Kiroween 2026 hackathon.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Meet Frankenfly
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp3xcplx1chkkd5sk8oay.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fp3xcplx1chkkd5sk8oay.gif" alt="The Lab: a recorded run replays; the fly touches a coin and its tongue neuron flashes in the brain jar" width="720" height="296"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Frankenfly stitches together four technologies:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Brain:&lt;/strong&gt; MaleCNS v1.0, an electron-microscopy wiring map containing 166,700 neurons and 25,582,837 connections.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Neural activity:&lt;/strong&gt; A spiking-neuron model based on Shiu et al. (2024).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Body:&lt;/strong&gt; NeuroMechFly v2, a six-legged simulated fly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;World:&lt;/strong&gt; A 3D platformer with coins, enemies, and a finish line.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The brain is simulated using a wiring map derived from a real fruit fly. No living fly is involved.&lt;/p&gt;

&lt;p&gt;The application has two main parts.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. The Lab
&lt;/h3&gt;

&lt;p&gt;Here, you replay recorded experiments and disconnect the programs surrounding the brain.&lt;/p&gt;

&lt;p&gt;You can cut the &lt;strong&gt;WALK&lt;/strong&gt; connection, removing our code's decision about when the fly walks. You can also cut &lt;strong&gt;SENSES&lt;/strong&gt;, removing shortcuts our code uses to identify coins and enemies.&lt;/p&gt;

&lt;p&gt;You can swap the original neural wiring for a scrambled version and compare the results.&lt;/p&gt;

&lt;p&gt;A 3D visualization shows neural spikes alongside the recording, while a timeline reveals when those spikes happened relative to game events.&lt;/p&gt;

&lt;p&gt;The results were revealing.&lt;/p&gt;

&lt;p&gt;With the walking program disconnected, the fly's simulated walking neurons initiated movement in &lt;strong&gt;16 out of 16 flies&lt;/strong&gt;. They also stopped movement at &lt;strong&gt;48 out of 48 coins&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;But when we removed our sensory shortcuts, its escape neuron warned it in time for &lt;strong&gt;0 out of 48 enemies&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;In other words, the neural wiring was contributing to walking and stopping, but our code had been doing the work of recognizing danger.&lt;/p&gt;

&lt;p&gt;Without that distinction, the demo could have told a very different story.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. The Operating Table
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3ycsci6wmur647ieaxcp.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3ycsci6wmur647ieaxcp.gif" alt="The Operating table, live: switch on the left eye's danger cells and both escape neurons fire" width="720" height="377"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The second half goes further.&lt;/p&gt;

&lt;p&gt;Instead of replaying recordings, the Operating Table runs all &lt;strong&gt;166,700 neurons and approximately 25.6 million connections live through WebGPU&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The network downloads in roughly 40 MB and runs on the visitor's graphics card.&lt;/p&gt;

&lt;p&gt;Visitors can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stimulate sensory neurons with virtual electrodes.&lt;/li&gt;
&lt;li&gt;Scramble the neural connections.&lt;/li&gt;
&lt;li&gt;Cut specific connections between neural populations.&lt;/li&gt;
&lt;li&gt;Disconnect entire cell types.&lt;/li&gt;
&lt;li&gt;Watch live neural firing rates.&lt;/li&gt;
&lt;li&gt;Listen to neural spikes as audio clicks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There's even a circuit-screening tool.&lt;/p&gt;

&lt;p&gt;Pick a neuron, and Frankenfly systematically silences its strongest input cell types, reruns the experiment, and measures what changes.&lt;/p&gt;

&lt;p&gt;In one experiment, cutting 311 direct danger-to-escape connections revealed that the network still had an indirect route. Silencing a four-cell population called &lt;strong&gt;PVLP151&lt;/strong&gt; reduced the right escape neuron's firing rate from 44 Hz to 20 Hz.&lt;/p&gt;

&lt;p&gt;On our test laptop, the circuit screens completed in roughly 12–20 seconds using integrated Intel Iris Xe graphics.&lt;/p&gt;

&lt;p&gt;That's a scientific experiment someone can run directly in a web page.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where Kiro came in
&lt;/h2&gt;

&lt;p&gt;Frankenfly wasn't just a graphics project. It needed a development process that could keep the simulation, interface, experimental claims, and tests consistent.&lt;/p&gt;

&lt;p&gt;We organized development around Kiro's approach to &lt;strong&gt;steering, specifications, implementation tasks, and correctness properties&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The repository contains the project specifications in its &lt;code&gt;.kiro&lt;/code&gt; directory, making the intended behavior and verification rules visible alongside the code.&lt;/p&gt;

&lt;h3&gt;
  
  
  Steering: rules the project couldn't casually ignore
&lt;/h3&gt;

&lt;p&gt;The first important piece was steering.&lt;/p&gt;

&lt;p&gt;We created four documents under &lt;code&gt;.kiro/steering/&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;product.md&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tech.md&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;structure.md&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;science-honesty.md&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The most interesting is &lt;code&gt;science-honesty.md&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;It establishes rules about what the application is allowed to claim.&lt;/p&gt;

&lt;p&gt;For example, we shouldn't say the simulated fly &lt;em&gt;thinks&lt;/em&gt;, &lt;em&gt;sees&lt;/em&gt;, or &lt;em&gt;tastes&lt;/em&gt;. A spike in a simulated sugar-sensing neuron is not proof of subjective taste.&lt;/p&gt;

&lt;p&gt;We also needed to distinguish what came from the neural model and what came from our own programs.&lt;/p&gt;

&lt;p&gt;Every experimental result is attributed to the &lt;strong&gt;fly's simulated neurons, our code, both, or luck&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;And rather than showing percentages that hide small sample sizes, the project displays counts like &lt;code&gt;16/16&lt;/code&gt; or &lt;code&gt;0/48&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;It's a surprisingly important distinction.&lt;/p&gt;

&lt;p&gt;Imagine saying your AI-powered robot independently avoided 48 obstacles. Sounds impressive.&lt;/p&gt;

&lt;p&gt;Now imagine discovering that your own obstacle-detection program identified every obstacle and told the robot when to react.&lt;/p&gt;

&lt;p&gt;The robot might still be interesting, but you've suddenly got a very different scientific claim.&lt;/p&gt;

&lt;p&gt;The steering rules helped us keep that difference visible.&lt;/p&gt;

&lt;h3&gt;
  
  
  Specs: turning a strange idea into testable requirements
&lt;/h3&gt;

&lt;p&gt;Next came Kiro-style specs.&lt;/p&gt;

&lt;p&gt;Under &lt;code&gt;.kiro/specs/frankenfly-lab/&lt;/code&gt;, we organized the application into three documents:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;requirements.md&lt;/code&gt;&lt;/strong&gt; defines nine major requirements, R1 through R9, using EARS-style acceptance criteria.&lt;/p&gt;

&lt;p&gt;For instance, when someone switches between real and scrambled wiring, the application must select the corresponding recorded experiment. It must never invent a recording for a configuration that wasn't simulated.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;design.md&lt;/code&gt;&lt;/strong&gt; describes the architecture, data flows, live GPU engine, and correctness properties.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;code&gt;tasks.md&lt;/code&gt;&lt;/strong&gt; contains 68 implementation tasks, checked off as development progressed. Later review rounds became additional tasks with their own checks.&lt;/p&gt;

&lt;p&gt;This made a complicated system easier to reason about.&lt;/p&gt;

&lt;p&gt;The Lab's replay, brain visualization, neural timeline, and experimental scoreboard all need to agree about what happened and when.&lt;/p&gt;

&lt;p&gt;Without explicit requirements, it's easy to build a beautiful interface that quietly displays the wrong experiment or attributes an action to the wrong source.&lt;/p&gt;

&lt;p&gt;The spec made those behaviors things we could actually verify.&lt;/p&gt;

&lt;h3&gt;
  
  
  Property-based testing: test the rules, not just the examples
&lt;/h3&gt;

&lt;p&gt;We also turned the design into eleven correctness properties, P1 through P11.&lt;/p&gt;

&lt;p&gt;The repository contains &lt;strong&gt;16 tests, including 14 fast-check property-based tests&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Instead of checking only a handful of manually chosen examples, property-based testing generates many inputs and verifies that important rules continue to hold.&lt;/p&gt;

&lt;p&gt;Some examples:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;P1: Timeline consistency&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If we convert a simulated timestamp into a position on the timeline, then convert it back, we should recover the original time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;P5: Scrambled wiring&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When we scramble the brain network, each neuron's number of incoming and outgoing connections must remain unchanged.&lt;/p&gt;

&lt;p&gt;Otherwise, we aren't just rearranging the wiring; we're changing the structure of the experiment in another way.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;P7: Connection encoding&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The browser simulation uses a compact format for millions of neural connections. Encoding and decoding those connections must preserve their targets and signed connection counts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;P9: Neural surgery&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When a visitor cuts connections between two populations, only those intended connections should change.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;P11: Honest experimental conclusions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;An experiment's result card must report numbers belonging to the selected brain and setup, rather than accidentally quoting results from a different experiment.&lt;/p&gt;

&lt;p&gt;That last one is particularly relevant. A visually convincing result card is useless if its numbers describe the wrong brain.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hooks and quality checks
&lt;/h2&gt;

&lt;p&gt;We also defined four hook configurations under &lt;code&gt;.kiro/hooks/&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;They describe checks for:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Scientific honesty whenever relevant user-facing files change.&lt;/li&gt;
&lt;li&gt;Data validation when experimental exports or results change.&lt;/li&gt;
&lt;li&gt;Syntax checking and property tests after an agent turn.&lt;/li&gt;
&lt;li&gt;On-demand Playwright screenshots at three viewport sizes.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The underlying commands include:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node tools/honesty_lint.mjs
node tools/validate_data.mjs
npm run syntax
npm test
npm run qa
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The honesty checker flags language that overstates the experiment. The data validator independently recomputes scoreboard results from the recorded data.&lt;/p&gt;

&lt;p&gt;We also run the checks through GitHub Actions before deployment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One important clarification about our tooling:&lt;/strong&gt; we had no Kiro credits during development, so Kiro's agent did not write the code or execute these hooks. Implementation was done with Claude Code following our Kiro-format specifications. The verification commands ran as local scripts and through CI, rather than as hooks executed inside Kiro.&lt;/p&gt;

&lt;p&gt;The value of Kiro's approach for this project was the structured specification and verification workflow: requirements, architecture, scientific constraints, tasks, and properties that implementation could be checked against.&lt;/p&gt;

&lt;h2&gt;
  
  
  The hardest technical challenge
&lt;/h2&gt;

&lt;p&gt;One of the biggest engineering problems was getting the complete neural network to run live in a browser.&lt;/p&gt;

&lt;p&gt;We're talking about 166,700 neurons, 25.6 million connections, and neural simulation steps of 0.1 milliseconds.&lt;/p&gt;

&lt;p&gt;That's &lt;strong&gt;10,000 simulation steps per second&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The key optimization came from the model's fixed 1.8-millisecond synaptic delay.&lt;/p&gt;

&lt;p&gt;Because a neural spike cannot influence another neuron until that delay has passed, the GPU engine can process 18 simulation steps before delivering the resulting spikes.&lt;/p&gt;

&lt;p&gt;We implemented the live engine using WebGPU compute shaders, with integer atomic operations for spike delivery.&lt;/p&gt;

&lt;p&gt;But making something fast isn't enough if the result is wrong.&lt;/p&gt;

&lt;p&gt;We gave the WebGPU implementation and the original PyTorch simulator identical random input and compared their neural spike counts.&lt;/p&gt;

&lt;p&gt;On our test hardware, they matched neuron by neuron for the checked intervals.&lt;/p&gt;

&lt;p&gt;For example, the danger-cell experiment produced &lt;strong&gt;3,057 spikes in both implementations over 504 milliseconds&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;The live simulation also kept up with real time on our Intel Iris Xe graphics during testing, even at around 480,000 spikes per second.&lt;/p&gt;

&lt;p&gt;The comparison does have hardware-dependent limitations: GPU rounding differences can eventually cause individual spikes to diverge. We document those limitations rather than promising identical results everywhere.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Frankenfly taught us
&lt;/h2&gt;

&lt;p&gt;The most surprising result wasn't simply that a fly's wiring could contribute to movement in a simulation.&lt;/p&gt;

&lt;p&gt;It was how much the surrounding software mattered.&lt;/p&gt;

&lt;p&gt;With our danger-detection shortcut connected, the escape neuron responded in time for 48 of 48 enemies.&lt;/p&gt;

&lt;p&gt;Without it, the escape neuron responded in time for none of 48.&lt;/p&gt;

&lt;p&gt;The scrambled network also became nearly silent, which limits what that control experiment can establish.&lt;/p&gt;

&lt;p&gt;And strong bitter stimulation caused runaway simulated activity, exposing a limitation of the simple neural model.&lt;/p&gt;

&lt;p&gt;Those are important outcomes, even when they make the demo seem less impressive.&lt;/p&gt;

&lt;p&gt;This is where the Kiro-style workflow earned its place.&lt;/p&gt;

&lt;p&gt;Our requirements and correctness properties weren't just about getting the application running. They helped define what the application needed to demonstrate, what its tests should establish, and what its conclusions could reasonably say.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try Frankenfly yourself
&lt;/h2&gt;

&lt;p&gt;Frankenfly is open source, and the application includes a guided five-minute tour through both halves.&lt;/p&gt;

&lt;p&gt;You can cut the walking connection, watch its simulated neurons respond, compare against scrambled wiring, and run your own experiments on the live brain.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Links:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://tanishqbaweja.github.io/frankenfly/" rel="noopener noreferrer"&gt;&lt;strong&gt;Live application&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://tanishqbaweja.github.io/frankenfly/#tour" rel="noopener noreferrer"&gt;&lt;strong&gt;Five-minute interactive tour&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/tanishqbaweja/frankenfly" rel="noopener noreferrer"&gt;&lt;strong&gt;GitHub repository&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/tanishqbaweja/frankenfly/tree/main/.kiro" rel="noopener noreferrer"&gt;&lt;strong&gt;Kiro steering, specs, and hooks&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Frankenfly was built for the &lt;strong&gt;Kiroween 2026 hackathon, Frankenstein category&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;We wanted to combine technologies that don't normally belong together. We ended up with something that makes it possible to examine the difference between a neural network's behavior and the software surrounding it.&lt;/p&gt;

&lt;p&gt;And perhaps that's the most useful lesson from the project:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A good experiment shouldn't just make something impressive happen. It should make it possible to discover who, or what, actually made it happen.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>kiro</category>
      <category>kiroween</category>
      <category>webdev</category>
      <category>neuroscience</category>
    </item>
    <item>
      <title>Building a private PDF toolkit: Moving document processing entirely to the client</title>
      <dc:creator>Trebell</dc:creator>
      <pubDate>Wed, 10 Jun 2026 11:07:18 +0000</pubDate>
      <link>https://dev.to/trebell/building-a-private-pdf-toolkit-moving-document-processing-entirely-to-the-client-3h1k</link>
      <guid>https://dev.to/trebell/building-a-private-pdf-toolkit-moving-document-processing-entirely-to-the-client-3h1k</guid>
      <description>&lt;p&gt;We have all been there. You need to quickly compress a sensitive contract, merge a few invoices, or sign an NDA. But radiography on page one of Google shows that literally every tool forces you to upload your private files to their remote server. You just have to cross your fingers and hope they actually delete your data afterward. &lt;/p&gt;

&lt;p&gt;As a student building stuff, shipping a massive 100MB PDF across the network just to merge two pages felt super inefficient and honestly kind of sketchy. &lt;/p&gt;

&lt;p&gt;I wanted to fix this, so I built &lt;strong&gt;&lt;a href="https://pdfomni.com" rel="noopener noreferrer"&gt;PDFOmni&lt;/a&gt;&lt;/strong&gt;. It is a browser-based PDF toolkit where all the heavy lifting happens locally on your device. No backend storage, no server queues, and zero knowledge of your documents.&lt;/p&gt;

&lt;h3&gt;
  
  
  Shifting the Architecture
&lt;/h3&gt;

&lt;p&gt;Most traditional document tools rely on server-side processing using heavy backend libraries. The workflow is always the same: you upload the file, the server processes it, and then you download it. &lt;/p&gt;

&lt;p&gt;By shifting the computation entirely to the client side, the architecture changes completely. The browser loads the file directly into its own memory, processes it locally using scripts, and saves it straight back to your disk. &lt;/p&gt;

&lt;h3&gt;
  
  
  Tackling Browser Memory Limits
&lt;/h3&gt;

&lt;p&gt;The biggest hurdle in building a purely client side tool is memory management. Browsers love to kill tabs that spike memory usage, so you have to be really careful. &lt;/p&gt;

&lt;p&gt;When building the &lt;strong&gt;&lt;a href="https://pdfomni.com/compress" rel="noopener noreferrer"&gt;local PDF compressor&lt;/a&gt;&lt;/strong&gt;, I had to ensure the browser could handle heavy, image-dense scanned documents without crashing. By optimizing the local scripts, the site can comfortably handle files up to 500MB right in the browser. You just choose your target size, and the browser handles the work of stripping out redundant data and downsampling images locally.&lt;/p&gt;

&lt;p&gt;The same logic applies to the &lt;strong&gt;&lt;a href="https://pdfomni.com/merge" rel="noopener noreferrer"&gt;PDF merging tool&lt;/a&gt;&lt;/strong&gt;. The trick was keeping the interface snappy while holding multiple documents in the browser's memory before combining their buffers into a single downloadable blob.&lt;/p&gt;

&lt;h3&gt;
  
  
  How the AI Copilot Handles Privacy (Hybrid RAG)
&lt;/h3&gt;

&lt;p&gt;I also wanted to add an AI assistant to help summarize or query documents, but I had to handle it carefully to protect privacy. &lt;/p&gt;

&lt;p&gt;To keep things secure, the entire RAG (Retrieval-Augmented Generation) pipeline runs locally on your device. The app extracts the text and retrieves the relevant parts of the PDF right inside your browser. &lt;/p&gt;

&lt;p&gt;When you want to chat with the document, the app asks you to enter your own OpenRouter API key. Only the specific text snippets needed for your question are sent server side to the LLM to get the response. Your actual PDF file never touches a backend server, meaning you get powerful AI models without giving up your data.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why do it this way?
&lt;/h3&gt;

&lt;p&gt;Dropping the typical server requirement comes with some huge perks:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Speed:&lt;/strong&gt; It is as fast as your local machine. You do not have to wait for network uploads or server queues.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost:&lt;/strong&gt; Without server instances crunching PDFs 24/7, I do not have to gate the tools behind a paywall or strict rate limits. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Privacy:&lt;/strong&gt; Your original files never leave your device.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I am currently trying to optimize all tools on the website even further. If you work with heavy PDFs or have experience tweaking client side memory limits, I would love to get your feedback on how it handles your files. I would also love to know what other features you'd like me to add.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>productivity</category>
      <category>javascript</category>
      <category>security</category>
    </item>
  </channel>
</rss>
