{"by":"nip","descendants":29,"id":47984675,"kids":[47984986,47984790,47985766,47988669,47986577,47985048,47988687,47985874,47986823,47985570,48073573,47985557,48117978,47985705,48021671,47985360,47987620],"score":60,"text":"Hey HN!<p>I built SimplePDF Copilot: an AI assistant that can interact with the PDF editor. It fills fields, answers questions, focuses on a specific field, adds fields, deletes pages, and so on.<p>It&#x27;s built on top of SimplePDF that I started 7 years ago, pioneering privacy-respecting client-side pdf editing, now used monthly by 200k+ people.<p>As for the privacy model: the PDF itself never leaves the browser. Parsing, rendering, and field detection all run client-side.<p>The text the model needs (and your messages) goes to whatever LLM you point at. By default that&#x27;s our demo proxy (DeepSeek V4 Flash, rate-capped), but you can BYOK and point it at any cloud provider, or go fully local (I&#x27;ve been testing with LM Studio).<p>Unlike the existing &quot;Chat with PDF&quot; tools that only retrieve the text&#x2F;OCR layer, Copilot can act on the PDF: filling fields, adding fields (detected client-side using CommonForms by Joe Barrow [1], jbarrow on HN with some post-processing heuristics I added on top), focusing on fields, deleting pages, and so on.<p>I built this because SimplePDF is mostly used by healthcare customers where document privacy is paramount, and I wanted an AI experience that didn&#x27;t require shipping PII to a third party.\nStack is pretty standard:<p>- Tanstack Start<p>- AI SDK from Vercel<p>- Tailwind (I personally prefer CSS modules, I&#x27;m old-school but the goal since I open source it, I figured that Tailwind would be a better fit)<p>The more interesting part is the client-side tool calling: events are passed back and forth via iframe postMessage.<p>If you&#x27;re not familiar with &quot;tool calling&quot; and &quot;client-side tool calling&quot;, a quick primer:<p>Tool calling is what LLMs use to take actions. When Claude runs grep or ls, or hits an MCP server, those are tool calls.<p>Client-side tool calling means the intent to call a tool comes from the LLM, but the execution happens in the browser.<p>That matters for: speed, you can&#x27;t go faster than client-to-client operations and also gives you the ability to limit the data you expose to the LLM. For the demo I do feed the content of the document to the LLM, but that connection could be severed as simply as removing the tool that exposes the content data.<p>The demo is fully open source, available on Github [2] and the demo is the same as the link of this post [3]<p>What&#x27;s not open source is SimplePDF itself (loaded as the iframe).<p>I could talk on and on about this, let me know if you have any questions, anything goes!<p>[1] <a href=\"https:&#x2F;&#x2F;github.com&#x2F;jbarrow&#x2F;commonforms\" rel=\"nofollow\">https:&#x2F;&#x2F;github.com&#x2F;jbarrow&#x2F;commonforms</a><p>[2] <a href=\"https:&#x2F;&#x2F;github.com&#x2F;SimplePDF&#x2F;simplepdf-embed&#x2F;tree&#x2F;main&#x2F;copilot\" rel=\"nofollow\">https:&#x2F;&#x2F;github.com&#x2F;SimplePDF&#x2F;simplepdf-embed&#x2F;tree&#x2F;main&#x2F;copil...</a><p>[3] <a href=\"https:&#x2F;&#x2F;copilot.simplepdf.com&#x2F;?share=a7d00ad073c75a75d493228e6ff7b11eb3f2d945b6175913e87898ec96ca8076&amp;form=w9&amp;lang=en\" rel=\"nofollow\">https:&#x2F;&#x2F;copilot.simplepdf.com&#x2F;?share=a7d00ad073c75a75d493228...</a>","time":1777712067,"title":"Show HN: Filling PDF forms with AI using client-side tool calling","type":"story","url":"https://copilot.simplepdf.com/?share=a7d00ad073c75a75d493228e6ff7b11eb3f2d945b6175913e87898ec96ca8076&form=w9&lang=en"}