Skip to main content

Frank Duah

AI engineer, MS in AI at Northeastern University, Boston, MA

IattackAIagentsonpurpose,beforeattackerscan.

The holes get found and fixed before anyone can use them.

In ten seconds

  • If you hire

    An AI engineer doing an MS in AI at Northeastern. I build agents, RAG, fine-tuning and evaluation in Python and TypeScript, get my code merged into open source, and each case study says what I built, what I measured and where it fell short.

    My background
  • If you build

    I work across the whole stack, from the model up. I've written a transformer, a tokenizer and LoRA adapters, built RAG apps, MCP servers and agent tooling, shipped web frontends, and set up the tests and CI that catch a regression.

    The work
  • If you run a company

    I find where your AI can be hijacked or made to leak data, turn each finding into a check that stops a risky change before it merges, and keep your assistant answering when the network drops.

    Ask me anything

I build the parts of an LLM system myself.

So I know how each one behaves, and how it fails.

What I've built

A transformer in NumPy with its gradients checked, a byte-level tokenizer, LoRA, DoRA and QLoRA, an MCP server, and an agent stress-tester that fails the build when an agent gets less safe.

Glassbox and Forge are public; the others are private while I clean them up.

MS in Artificial Intelligence

I'm doing my MS in Artificial Intelligence at Northeastern University on the Chanrai Graduate Scholarship, fully funded on merit, the only University of Ghana graduate chosen for it.

Before that, a First Class BSc in Computer Engineering and the Dean's Award four years running (2019 to 2022).

  • 7+

    years writing code

  • 45+

    repos

  • 67+

    merged OSS PRs

  • Location

Skills

  • RAG
  • Agentic AI
  • Model Context Protocol (MCP)
  • LLM application development
  • Prompt engineering
  • Evaluation & red-teaming (OWASP LLM Top 10)

Skills

LLM & GenAI

  • RAG
  • Agentic AI
  • Model Context Protocol (MCP)
  • LLM application development
  • Prompt engineering
  • Evaluation & red-teaming (OWASP LLM Top 10)
  • Prompt-injection defense
  • Fine-tuning (LoRA / DoRA / QLoRA)
  • On-device & offline inference (GGUF, llama-cpp-python)
  • Transformer internals (attention, RoPE, KV-cache)
  • Byte-level BPE tokenization

LLM Providers & APIs

  • OpenAI
  • Anthropic (Claude)
  • Google Gemini
  • AWS Bedrock
  • Claude Code

ML Frameworks

  • PyTorch
  • TensorFlow
  • Keras
  • scikit-learn
  • Hugging Face Transformers
  • LangChain
  • llm-exe
  • NumPy
  • Pandas

Languages

  • Python
  • TypeScript
  • JavaScript
  • C
  • C++
  • Java
  • SQL
  • Bash

Data & Vector Stores

  • Vector databases
  • PostgreSQL
  • MySQL
  • MongoDB
  • DynamoDB
  • Supabase

MLOps & Cloud

  • AWS (Bedrock, Lambda, EC2, S3, CloudFormation)
  • Docker
  • GitHub Actions
  • CI/CD

Web

  • React
  • Vue
  • Next.js
  • Node
  • Express
  • Flutter

Selected work.

Each part of an LLM system, written so every step can be checked, and the tools that test it.

Four LLM parts, no frameworks

A transformer, LoRA, DoRA and QLoRA, a tokenizer and an MCP server, each written without a framework so every step can be checked.

Glassbox transformer cover
2026, AuthorSource

Glassbox

A transformer in NumPy, its backward pass derived and checked

Its gradients are worked out without PyTorch and checked to within one part in a million, and a small model's loss falls from 3.576 to 0.088 in about 15 seconds on one CPU core.

Read the case study

Glassbox

A transformer in NumPy, its backward pass derived and checked

A working transformer implemented in NumPy with no autograd anywhere. It supports both GPT-2 and Llama-style architectures (RMSNorm, RoPE, SwiGLU, and a KV-cache), and every backward pass is derived, with the layers and both full models checked against numerical gradients to within 1e-6. It trains and generates text on a plain CPU.

Gradient check
1e-6
derived gradients matched to numerical ones to within one part in a million
Frameworks
None (NumPy)
Architectures
GPT-2 · Llama
Training loss
3.576 to 0.088
a 2-layer demo model, 300 steps in about 15 seconds on one CPU core

Built with

  • Python
  • NumPy
Forge fine-tuning cover
2026, AuthorSource

Forge

LoRA, DoRA and QLoRA, written in NumPy

The original weights are never modified, so one base model can carry many separate skills and switch between them while it runs.

Read the case study

Forge

LoRA, DoRA and QLoRA, written in NumPy

LoRA, DoRA (the 2024 method), and QLoRA-style int8 quantization, written in NumPy. The forward and backward passes are written out and gradient-checked, adapters hot-swap at runtime, perplexity evaluation is built in, and the frozen base model is never trained: only the adapters reach the optimizer.

Methods
LoRA · DoRA · QLoRA
Base model
Frozen
only the adapters are trained, and the tests check the base weights stay the same
Adapters
Hot-swap
Frameworks
None (NumPy)

Built with

  • Python
  • NumPy
Cleave tokenizer cover
2026, AuthorPrivate

Cleave

A byte-level BPE tokenizer with an in-browser export

Text goes in, numbers come out, and the same text comes back. Python standard library only.

Read the case study

Cleave

A byte-level BPE tokenizer with an in-browser export

A byte-level Byte-Pair Encoding tokenizer built from the standard library, with a provably lossless round-trip on any valid Unicode text. It exports a dependency-free in-browser tokenizer, a JavaScript port that matches the Python encoder on ordinary text.

Round-trip
Provably lossless
text comes back out exactly as it went in
Alphabet
Byte-level
Browser export
One HTML file
Dependencies
Stdlib only

Built with

  • Python
  • JavaScript
Winnow MCP server cover
2026, AuthorPrivate

Winnow

A Model Context Protocol server with no SDK, plus an injection scanner

Documents reach a model as lean Markdown, about 70% smaller on its demo document. Text that looks like hidden instructions arrives with a warning on top.

Read the case study

Winnow

A Model Context Protocol server with no SDK, plus an injection scanner

An MCP server implementing JSON-RPC 2.0 over stdio with no SDK. It compacts documents to Markdown (about 70% fewer tokens on its demo document, by its own estimate) and scans them for prompt injection, putting a warning on top of anything suspicious before it reaches a model, and it connects to Claude as a tool.

Protocol
JSON-RPC 2.0
SDK
None
Token reduction
About 70%
on its demo document, estimated: less text for the model to read, so a cheaper call
Guardrail
Injection scan
21 patterns and four hidden-text checks, a heuristic that warns rather than removes

Built with

  • Python
  • MCP
  • JSON-RPC

Agents, retrieval and the rest

agentbounds stress-tester cover
2026, AuthorPrivate

agentbounds

An adversarial stress-tester that fails CI when an agent gets less safe

Fires 18 inputs at an agent, 16 hostile and 2 harmless ones it should answer, several times each, and reports how often it breaks. The build fails when a rate gets worse.

Read the case study

agentbounds

An adversarial stress-tester that fails CI when an agent gets less safe

An adversarial stress-tester for LLM agents, written with zero runtime dependencies and 562 passing tests. Point it at any agent, throw a suite of hostile and edge-case inputs at it, and get a report of where and how often it breaks: per-category hold rates over N trials, a severity-weighted risk score, and a CI gate that compares each attack's rate with a saved run and fails the build when one drops. Calls an LLM judge cannot decide are left out of the rate rather than counted as passes, and heuristic detectors are labeled as heuristic. It also checks what an agent did, not only what it said: declare the tools it must not call, and it reports how often it called them and the step where it first did.

Checks
Words and tool calls
what the agent said, and what it did
Tests
562 passing
Scoring
Severity-weighted
CI
Regression gate
the build fails when an agent gets less safe

Built with

  • Python
Device-aware RAG assistant cover
2026, AuthorPrivate

Device-Aware RAG Assistant

Offline-first retrieval that picks its own model backend

Reads the device and its connection to pick its own model, and answers fully offline, at no cost per question, when it has to.

Read the case study

Device-Aware RAG Assistant

Offline-first retrieval that picks its own model backend

A retrieval-augmented assistant where the SAME code reads its runtime environment (network plus CPU and RAM) and picks its own backend: with a network on a device stronger than two CPU cores and 2 GB of RAM it tries a cloud model first, offline or on a weaker device it tries a quantized model on the device first, and a local Ollama server is second either way. A control in its interface can override the choice. A model routes each question first, so a general question skips retrieval and a question that names a period is narrowed to those dates before semantic search, and a pinned, model-aware embedding cache keeps vectors from different models from ever mixing. The live demo on this site is a browser-only slice of the same idea: each post's vector is made when it is published, and your browser embeds your question with a quantized MiniLM model and ranks by cosine locally, so ranking costs nothing per query and needs no search backend.

Backends
Cloud / Ollama / on-device
Validated offline
Android emulator
Offline per-query cost
$0
Retrieval
Date + semantic

Built with

  • Python
  • RAG
  • llama.cpp
  • Ollama
  • Gemini
Execution engine cover
2026, Co-AuthorSource

Latency-Aware Execution Engine

Reinforcement learning trade execution

Learned to break a large order into smaller ones, and beat a standard schedule for it by 3.5 basis points on average across three assets (10.2 on Bitcoin), on late-2024 data it never trained on.

Read the case study

Latency-Aware Execution Engine

Reinforcement learning trade execution

End-to-end ML system: a Double DQN reinforcement-learning agent (dueling architecture, prioritized experience replay) that learns to schedule cryptocurrency trade execution in a simulator built on the Almgren-Chriss market impact model. Trained on 2020 to 2023 and tested on the second half of 2024, it beats TWAP by 10.2 basis points on Bitcoin (3.5 averaged across the three assets, and short of VWAP), and in simulation cuts cost about 97% versus immediate execution (the naive baseline). Replayed against 98 million real Bitcoin trades from March 2023, with a 12-configuration ablation study and 176 unit tests. Dual final project for CS5130 (Programming and Data Processing for AI) and CS6140 (Machine Learning) at Northeastern.

vs TWAP, 3 assets
+3.5 bps
on average; Bitcoin +10.2, Solana slightly behind, and it does not beat VWAP
Cost reduction
About 97%
against trading the whole order at once, in simulation
Tick replay
98M trades
real Bitcoin trades from March 2023
Tests / Ablations
176 / 12

Built with

  • Python
  • PyTorch
  • Double DQN
llm-exe cover
2026, CollaboratorSource

llm-exe

Multimodal embedding input, merged upstream

67 merged pull requests, and more commits than anyone else, on a TypeScript framework other developers build on.

Read the case study

llm-exe

Multimodal embedding input, merged upstream

A Collaborator on llm-exe, an open-source TypeScript framework for LLM apps. I wrote its text-and-image embedding input, shipped in v3.0.3, then fixes for Anthropic, Bedrock and xAI models, a retry policy that stops retrying errors that cannot succeed, and much of its release and CI pipeline.

Release
Shipped in v3.0.3
Feature PR commits
17
Release and CI PRs
About 38
My merged PRs
67

Built with

  • TypeScript
  • Node
  • GitHub Actions

More work

How I work.

Every project goes round the same four steps.

  1. Experiment.Build the smallest version that works end to end.
  2. Break.Attack it on purpose, with prompt injection, jailbreaks and hidden text.
  3. Improve.Fix what broke first, and keep the check that caught it.
  4. Repeat.Run every check again on the next change.

After Repeat, it starts again at Experiment.

Building intelligent systems

Education.

  1. 2025 to present

    Northeastern University

    Master of Science in Artificial Intelligence

    On the Chanrai Graduate Scholarship, a fully funded merit scholarship covering tuition and living expenses; the only University of Ghana graduate selected for it.

  2. 2022

    University of Ghana

    Bachelor of Science in Computer Engineering

    First-Class. Dean's Award for Best Performing Students four consecutive years (2019, 2020, 2021, 2022).

Writing.

Most days I post what I am learning about AI and agents. Follow along on LinkedIn, or read the archive here.

, 9 min read

Supercharging LLM Applications with llm-exe

A walk through the llm-exe SDK with three concrete patterns: validating statements against conversation context, extracting structured data from unstructured text, and detecting user intent. One toolkit, four providers, modular components.

  • LLM
  • TypeScript
  • Open Source
Read on Medium

Ask me anything.

A role, a collaboration, something on this page, or what you're building. I read every message.

© 2026 Frank Duah
Privacy