MUHAMMAD AHMAD SIDDIQUI

Full Stack & AI Engineer

000

Available for work·Book a call

Full Stack Developer

Nilpii

Privacy-first AI chat, sensitive data is shielded in the browser before any AI provider ever sees it

Next.jsTypeScriptTailwind CSSNode.jsPostgreSQLStripeMistral EUAzure OpenAIOpenAIAnthropic Claudepdfjs-distmammothmsgreaderSharpPM2Nginx
Nilpii

Overview

Nilpii is a privacy-first AI chat platform that lets individuals and companies work with leading AI models while every piece of personally identifiable and sensitive information is anonymized locally in the browser, before it reaches the backend or any external AI provider. Names, companies, emails, phone numbers, addresses, IBANs, card numbers, and credentials are replaced with placeholders like [PERSON_1] or [IBAN_1], the anonymized text is sent to the AI, and the original values are restored locally in the response so the user reads normal text. We took a half-built Next.js codebase from a previous developer and turned it into a commercial SaaS product: multi-provider AI routing, a hardened privacy engine, document and image uploads, Stripe subscriptions with a usage-based credit system, and an admin panel, delivered in Dutch and English.

The Challenge

The core promise, zero original PII ever reaching the server or an AI provider, had to hold across every code path: follow-up messages, provider switches mid-thread, uploaded files, and AI routing decisions. The same real-world entity had to keep the same placeholder for the entire conversation, and if anonymization could not complete reliably the request had to be blocked rather than silently forwarded. On top of that, the inherited codebase only supported Azure OpenAI, had no file handling and no billing, and everything commercial, prices, credit costs, provider access per plan, had to be configurable without code changes.

How We Solved It

1

Browser-Side Privacy Engine

Hardened the existing in-browser NER pipeline with detection for IBANs and card numbers (with validation), API keys, bearer tokens, JWTs, private keys, VAT and registration numbers. Entity mappings live only in local memory, and the same entity always receives the same placeholder across every message, follow-up, and uploaded file in a thread. Placeholder restoration happens locally after the AI response arrives.

2

Automatic & Review Privacy Modes

Automatic Mode shields data silently and shows a clickable 'X items protected' indicator. Review Mode shows original vs anonymized text side by side and lets the user add, change, or undo detections before sending. If anonymization cannot complete reliably, the request is blocked, the user is warned, and the chat falls back to Review Mode, protected content is never forwarded silently.

3

Multi-Provider AI & Mode Routing

Built a modular provider abstraction layer with adapters for Mistral EU (default), Azure OpenAI, direct OpenAI, and Anthropic Claude, with multiple models per provider, adding Gemini or another provider is configuration only. Four AI Modes sit on top: Automatic (picks a model by task complexity, context length, and content type), Fast & Efficient, Best Quality, and Advanced manual selection. Routing only ever sees metadata and already-anonymized content.

4

Documents, Images & Multi-File Comparison

Added upload support for PDF (pdfjs-dist), DOCX (mammoth), Outlook .msg emails (msgreader), and images/screenshots (Sharp with vision-model routing). Extracted content passes through the same privacy layer before leaving the browser, entity mappings stay consistent between files and chat, and users can compare multiple contracts or documents in the same conversation and ask follow-up questions.

5

Stripe Subscriptions & Credit System

Implemented Free, Pro, and per-seat Business plans with Stripe Checkout and webhooks, plus a one-time credit top-up. Credits are deducted from the actual token usage returned by each provider, using per-model input/output costs, with a live balance in the sidebar. Business plans share a company-level credit pool, and requests are blocked with an upgrade prompt when credits run out.

6

Admin Panel & Privacy-Safe Audit Logging

An admin panel lets the owner manage companies, users, subscriptions, usage, providers, models, per-model credit costs, and which providers each plan includes, all without a deployment. Audit logs record only privacy-safe metadata (timestamp, company, user, provider, mode, entity count and types) and never prompts, document content, AI answers, or original values.

7

Automated Privacy Tests & Deployment

Automated tests assert that original protected data cannot reach an external AI provider under any scenario, names, IBANs, API keys, provider switching mid-thread, file uploads, and anonymization failures. Staging and production run on a VPS behind Nginx with HTTPS and PM2, with user and technical documentation handed over for future developers.

Product

Marketing Site

Results & Impact

Zero PII to AI Providers

All sensitive data is shielded in the browser; the backend and AI providers only ever receive placeholder text.

4 AI Providers

Mistral EU, Azure OpenAI, OpenAI, and Anthropic Claude behind one modular provider layer with four AI Modes.

Thread-Consistent Placeholders

The same person or company keeps the same placeholder across every message, follow-up, and uploaded file in a conversation.

Safe-Failure Guarantee

If anonymization can't complete reliably, the request is blocked and the user falls back to Review Mode, nothing is forwarded silently.

4 File Types

PDF, DOCX, Outlook .msg, and images/screenshots, with multi-file comparison inside the same conversation.

Usage-Based Billing

Stripe subscriptions and top-ups with credits calculated from real token usage and per-model provider costs.

Original Project

Live product

Try it without an account

nilpii.com (opens in a new tab)

Free credits, no account needed.

Technical Architecture

FrontendNext.js 14 + TypeScript + Tailwind CSS, ChatGPT-style chat UI, Automatic/Review privacy modes, file uploads, NL/EN localization, light/dark themes
Privacy EngineBrowser-side NER and pattern detection, PII, financial, credential, and business entities; local entity map store and placeholder restoration
BackendNext.js API Routes + Node.js, AI Mode router, provider abstraction layer, credit and plan enforcement, privacy-safe audit logger, Stripe webhook handler
AI ProvidersMistral EU (default), Azure OpenAI, OpenAI, Anthropic Claude, multiple models per provider, vision-capable routing for images
File Processingpdfjs-dist / pdf-parse (PDF), mammoth (DOCX), msgreader (Outlook .msg), Sharp (images)
Database & BillingPostgreSQL, users, companies, plans, threads, messages, credit ledger, provider/model config; Stripe, subscriptions, per-seat billing, credit top-ups
InfrastructureVPS with Nginx reverse proxy (HTTPS) and PM2, separate staging and production environments

Have a similar project?

I'm open to freelance projects and full-time roles. Let's build something great together.