DEV Community

Ali Ahmed profile picture

Ali Ahmed

AI Engineer in Lahore. LLM systems, AI agents and KYC computer vision/OCR. Open-source contributor to AI and developer infrastructure. Writing with tested code at aliahmed.si.

Location Lahore, Punjab, Pakistan Joined Joined on  Personal website https://aliahmed.si github website

Education

FAST NUCES LHR

Pronouns

he/him

Work

Engineering Lead at NitNode

SSRF protection for server-side fetch in Node.js: block private addresses at connect time, on every redirect

SSRF protection for server-side fetch in Node.js: block private addresses at connect time, on every redirect

Comments
7 min read
Guardrails for LLM-written sales emails: cited facts, banned claims, and what regex checks miss

Guardrails for LLM-written sales emails: cited facts, banned claims, and what regex checks miss

Comments
7 min read
HTTP Range requests in Go: resumable downloads, 206 and 416, If-Range, and capping multipart ranges

HTTP Range requests in Go: resumable downloads, 206 and 416, If-Range, and capping multipart ranges

1
Comments
5 min read
Email one-time codes for guest file sharing in Go: hashing, attempt limits, expiry and races

Email one-time codes for guest file sharing in Go: hashing, attempt limits, expiry and races

Comments
6 min read
Multi-step document approval in Go: keep the old revision effective until the last step approves

Multi-step document approval in Go: keep the old revision effective until the last step approves

Comments
7 min read
CSV injection in spreadsheet exports: neutralise formulas without turning numbers into text

CSV injection in spreadsheet exports: neutralise formulas without turning numbers into text

Comments
5 min read
Verifying Vapi webhooks in Node.js: X-Vapi-Secret, Bearer tokens and HMAC signatures

Verifying Vapi webhooks in Node.js: X-Vapi-Secret, Bearer tokens and HMAC signatures

Comments 1
5 min read
Passive authentication for e-passports in Python: checking data group hashes and the SOD signature

Passive authentication for e-passports in Python: checking data group hashes and the SOD signature

1
Comments
5 min read
Unlocking a passport's NFC chip: deriving the BAC keys from the MRZ in Python

Unlocking a passport's NFC chip: deriving the BAC keys from the MRZ in Python

Comments
6 min read
Cosine similarity vs dot product vs Euclidean distance: when vector search results agree, and when they don't

Cosine similarity vs dot product vs Euclidean distance: when vector search results agree, and when they don't

Comments
4 min read
Verifying webhook signatures in Node.js: raw body, HMAC, timestamps, replay windows and secret rotation

Verifying webhook signatures in Node.js: raw body, HMAC, timestamps, replay windows and secret rotation

Comments 2
4 min read
Parsing partial JSON from a streaming LLM: show structured output while it's still being written

Parsing partial JSON from a streaming LLM: show structured output while it's still being written

Comments
4 min read
Parsing a passport MRZ in Python: every field of TD3 passports and TD1 ID cards, with check digits

Parsing a passport MRZ in Python: every field of TD3 passports and TD1 ID cards, with check digits

Comments
4 min read
Tool calls in voice AI agents: answering within the turn, holding lines for slow tools, and retries without double bookings

Tool calls in voice AI agents: answering within the turn, holding lines for slow tools, and retries without double bookings

Comments
5 min read
Measuring OCR accuracy: character error rate, word error rate and field accuracy, in Python

Measuring OCR accuracy: character error rate, word error rate and field accuracy, in Python

Comments
4 min read
CDD vs EDD: risk-based customer due diligence, with a risk-scoring model in Python

CDD vs EDD: risk-based customer due diligence, with a risk-scoring model in Python

Comments
4 min read
How KYC selfie verification works: quality checks, face matching against the ID photo, and the decision

How KYC selfie verification works: quality checks, face matching against the ID photo, and the decision

Comments
4 min read
KYB vs KYC: verifying a business and finding its real owners, with a beneficial-ownership calculation in Python

KYB vs KYC: verifying a business and finding its real owners, with a beneficial-ownership calculation in Python

Comments
4 min read
AML vs KYC: what the difference is in practice, with a structuring-detection rule in Python

AML vs KYC: what the difference is in practice, with a structuring-detection rule in Python

Comments
4 min read
Active vs passive liveness detection: how each works, what each stops, and a challenge-response check in Python

Active vs passive liveness detection: how each works, what each stops, and a challenge-response check in Python

Comments
4 min read
One phone number, two users: normalising WhatsApp sender IDs across Baileys and the Cloud API

One phone number, two users: normalising WhatsApp sender IDs across Baileys and the Cloud API

Comments
2 min read
What actually gets deployed to production? (Not your code)

What actually gets deployed to production? (Not your code)

Comments
2 min read
Securing a voice AI agent's webhook: what my first version got right, and what I'd change

Securing a voice AI agent's webhook: what my first version got right, and what I'd change

1
Comments 2
3 min read
How does Uber show cars moving in real time? A system design breakdown

How does Uber show cars moving in real time? A system design breakdown

Comments
3 min read
How to stop an LLM from inventing numbers: evidence containment and numeral tracing

How to stop an LLM from inventing numbers: evidence containment and numeral tracing

Comments
4 min read
Labels vs annotations: how one YAML indent made Prometheus scrape Pyroscope twice

Labels vs annotations: how one YAML indent made Prometheus scrape Pyroscope twice

1
Comments
2 min read
Your app doesn't run on a server anymore. It runs on a desired state.

Your app doesn't run on a server anymore. It runs on a desired state.

Comments
2 min read
What is a serverless cold start, really?

What is a serverless cold start, really?

Comments
3 min read
How to build a secure MCP server with OAuth 2.1: lessons from a CRM connector

How to build a secure MCP server with OAuth 2.1: lessons from a CRM connector

Comments 1
4 min read
Why Node.js HTTP backpressure must count bytes, not string length

Why Node.js HTTP backpressure must count bytes, not string length

Comments
4 min read
Streaming LLM output through a Next.js proxy: why you only get stream_end

Streaming LLM output through a Next.js proxy: why you only get stream_end

Comments 1
3 min read
Real-time KYC card verification over MQTT: a pub-sub pipeline explained

Real-time KYC card verification over MQTT: a pub-sub pipeline explained

Comments
3 min read
Localhost is not authentication: fixing a CWE-306 webhook in an AI agent framework

Localhost is not authentication: fixing a CWE-306 webhook in an AI agent framework

3
Comments 2
4 min read
Why LLM cost dashboards lie when two deployments share a model name

Why LLM cost dashboards lie when two deployments share a model name

Comments
3 min read
What's inside a GPU? Cores, streaming multiprocessors and the memory problem

What's inside a GPU? Cores, streaming multiprocessors and the memory problem

Comments
3 min read
Google Workspace vs Zoho Mail for a small startup: is the price gap worth it?

Google Workspace vs Zoho Mail for a small startup: is the price gap worth it?

Comments
3 min read
How I got my first pull request merged into LiteLLM

How I got my first pull request merged into LiteLLM

Comments
3 min read
From 10 µm to 3 nm: how chips got so small (and why 3 nm isn't 3 nm)

From 10 µm to 3 nm: how chips got so small (and why 3 nm isn't 3 nm)

Comments
3 min read
How to see every AirPods battery on Linux, and why only one showed: LibrePods

How to see every AirPods battery on Linux, and why only one showed: LibrePods

Comments
3 min read
Your AI agent thinks its tasks were deleted: how to write tool errors for LLM agents

Your AI agent thinks its tasks were deleted: how to write tool errors for LLM agents

2
Comments 7
4 min read
OCR vs NFC chip reading for passport verification: what each one actually proves

OCR vs NFC chip reading for passport verification: what each one actually proves

Comments
5 min read
p50 vs p90 vs p99 latency explained: what each percentile tells you, and why the tail matters more than it looks

p50 vs p90 vs p99 latency explained: what each percentile tells you, and why the tail matters more than it looks

Comments
3 min read
Liveness detection certification explained: ISO/IEC 30107-3, APCER, BPCER and what a test report should show

Liveness detection certification explained: ISO/IEC 30107-3, APCER, BPCER and what a test report should show

Comments
4 min read
Are KYC verification photos deleted? How long identity data is kept, and a retention policy in code

Are KYC verification photos deleted? How long identity data is kept, and a retention policy in code

Comments
4 min read
HNSW vs cosine similarity: one is a metric, the other is an index, and what approximate search costs in recall

HNSW vs cosine similarity: one is a metric, the other is an index, and what approximate search costs in recall

Comments
4 min read
Redacting personal data from logs and LLM prompts in Python: emails, CNICs, cards, IBANs and phone numbers

Redacting personal data from logs and LLM prompts in Python: emails, CNICs, cards, IBANs and phone numbers

Comments
4 min read
When a model says 95%, is it right 95% of the time? Calibration, ECE and temperature scaling in Python

When a model says 95%, is it right 95% of the time? Calibration, ECE and temperature scaling in Python

Comments
4 min read
Is your LLM judge any good? Measuring agreement with humans using Cohen's kappa

Is your LLM judge any good? Measuring agreement with humans using Cohen's kappa

Comments
4 min read
Idempotency keys for POST APIs in Node.js: retry a payment without charging twice

Idempotency keys for POST APIs in Node.js: retry a payment without charging twice

Comments 1
4 min read
Stop paying for tokens nobody reads: cancel the LLM call when the client disconnects in Node.js

Stop paying for tokens nobody reads: cancel the LLM call when the client disconnects in Node.js

Comments
3 min read
Validating file uploads in Node.js: check magic bytes, not the file name or Content-Type

Validating file uploads in Node.js: check magic bytes, not the file name or Content-Type

Comments
4 min read
Full-text search with SQLite FTS5 in Python: BM25 ranking, stemming and safe queries

Full-text search with SQLite FTS5 in Python: BM25 ranking, stemming and safe queries

Comments
4 min read
Scheduling a job at 9am local time in Python: DST, skipped hours and repeated hours

Scheduling a job at 9am local time in Python: DST, skipped hours and repeated hours

Comments
4 min read
Why your OCR sees ID photos sideways: EXIF orientation, and fixing it with Pillow

Why your OCR sees ID photos sideways: EXIF orientation, and fixing it with Pillow

Comments 2
3 min read
Limiting concurrency in Python asyncio with a semaphore and per-task timeouts, in the right order

Limiting concurrency in Python asyncio with a semaphore and per-task timeouts, in the right order

Comments
4 min read
The transactional outbox pattern in Node.js: never lose an event when the database commits

The transactional outbox pattern in Node.js: never lose an event when the database commits

Comments 1
5 min read
Request IDs in Node.js logs with AsyncLocalStorage: trace one request through every await

Request IDs in Node.js logs with AsyncLocalStorage: trace one request through every await

Comments
4 min read
Parsing a streamed LLM response in Node.js: Server-Sent Events, split chunks and the CRLF bug

Parsing a streamed LLM response in Node.js: Server-Sent Events, split chunks and the CRLF bug

Comments
5 min read
Graceful shutdown in Node.js: draining HTTP requests on SIGTERM without dropping traffic

Graceful shutdown in Node.js: draining HTTP requests on SIGTERM without dropping traffic

1
Comments
4 min read
Correcting MRZ OCR errors with check digits: O vs 0, I vs 1, and when not to guess

Correcting MRZ OCR errors with check digits: O vs 0, I vs 1, and when not to guess

Comments
4 min read
loading...