Show HN: Filling PDF forms with AI using client-side tool calling
Source: Hacker News
Introduction
I built SimplePDF Copilot, an AI assistant that can interact with the PDF editor. It can fill fields, answer questions, focus on a specific field, add fields, delete pages, and more.
Privacy Model
- The PDF never leaves the browser; parsing, rendering, and field detection all run client‑side.
- The text the model needs (and your messages) is sent only to the LLM you choose. By default it uses our demo proxy (DeepSeek V4 Flash, rate‑capped), but you can BYOK and point it at any cloud provider, or run it fully locally (e.g., with LM Studio).
This approach is important for healthcare customers where document privacy is paramount, allowing an AI experience without shipping PII to a third party.
Capabilities
- Fill existing form fields.
- Add new fields (detected client‑side using CommonForms by Joe Barrow1 with additional post‑processing heuristics).
- Focus on a specific field.
- Delete pages.
- Other actions supported via the PDF editor.
Stack
- Tanstack Start
- AI SDK from Vercel
- Tailwind CSS (the project uses Tailwind for styling; CSS modules are also an option)
Client‑Side Tool Calling
Tool calling is how LLMs take actions (e.g., running
grep,ls, or hitting an API).
Client‑side tool calling means the LLM’s intent to call a tool is received in the browser, and the actual execution happens locally.
Benefits
- Faster, since operations stay client‑to‑client.
- Greater control over data exposure: you can limit or completely remove the tool that provides document content to the LLM.
In the demo, the document content is fed to the LLM, but this connection can be severed simply by removing that tool.
Demo & Source
- The demo is fully open source and available on GitHub2.
- The live demo is the same as the link in this post3.
Note: SimplePDF itself (loaded as the iframe) is not open source.
Feel free to ask any questions!