Research and engineering notes
I work across the AI stack: how models run on real hardware, how they are trained and distilled, how agents are built around them, and how anyone knows it worked.
BudgetBench holds the per-call token budget fixed and asks which memory strategy spends it best. Retrieval at 2K scored 0.646; truncation needed 8K to reach 0.650. Hover a column, or switch the budget.
What I am trying to find out
Most agent failures I see are not model failures. They come from context that was truncated without anyone noticing, a runtime that gave different answers for the same input, or an eval that scored one answer instead of the behavior over time.
The work follows three questions, and each reaches from the hardware up. How should memory be evaluated when the context budget is the constraint? What do local inference stacks actually do under load, and where are they not reproducible? What does a harness need to expose so its behavior can be audited? Each item below is an attempt to answer one of them with a measurement.
In submission
HALT: quantized reasoning models don't stop, and a harness-applied limit on thinking repairs them
In plain wordsShrunk-down reasoning models can keep thinking and never answer. A simple limit set outside the model makes them stop and reply.
Link coming once the preprint is public.
Publications
BudgetBench: a budget-tiered protocol and pilot harness for memory strategy evaluation in local LLM agents
With A. Jaggi.
The Enterprise AI Control Plane: a governance and orchestration framework for LLM deployments at scale
With A. Jaggi. First of 14 concept papers on enterprise agent governance, trust, identity and security.
MEDFIT-LLM: medical enhancements through domain-focused fine-tuning of small language models
With A. Jaggi and S. Naidu.
Automated analysis of glucose response patterns in type 1 diabetes using machine learning and computer vision
International Journal of Advanced Computer Science and Applications 16(5).
Neural network-enabled diagnostic framework for correlating Ayurvedic breathwork protocols with adaptive skin microbiome dynamics
Mathematical Modelling of Engineering Problems 12(6).
Quantifying adaptive governance success: a mixed-methods analysis of 500 organizations
With A. Jaggi.
CAG: chunked augmented generation for Google Chrome's built-in Gemini Nano
In plain wordsLets the small AI built into Chrome read documents longer than it can hold at once, by feeding them in pieces.
With V. Vellaiyappan Surulimuthu.
AI-enhanced neural network framework for cardiac arrest prognostics
Frontiers in Health Informatics 13(3).
Efficient reduced-bias genetic algorithm (ERBGA) for generic community detection objectives
With C. Janikow, S. Bhatia and S. Climer. University of Missouri-St. Louis.
Transmission in Benes network
International Journal of Pure and Applied Mathematics 109(8).
Experiments and software
BudgetBench: a budget-tiered protocol for memory strategy evaluation in local LLM agents
In plain wordsGive an agent a tight memory budget and smart retrieval wins: at 2K tokens it matched what plain truncation needed 8K to reach.
Treats the per-call input-token budget as the independent variable, sweeping 2K to 32K. The pilot includes null results and a tokenizer bug we caught in our own numbers.
Distilling Ornith-1.5-9B with two teachers
In plain wordsA model half the size scored higher, because it learned when to stop thinking, not more facts.
A 4.9 GB build scores +5.5 MMLU and +3.0 HumanEval over the 8.9 GB stock release it replaces, trained on one M4 Pro. The gain came from reasoning termination, not new knowledge.
mlx-lm PR #1795: LoRA training on MoE models
In plain wordsFine-tuning a whole family of models crashed because of one missing line. I found it, and it is fixed for everyone now.
mlx_lm.lora crashed on granitemoe, granitemoehybrid and lfm2_moe because integer routing indices reached the VJP. A missing mx.stop_gradient, fixed three times and merged upstream.
Speculative decoding on Apple Silicon
In plain wordsA tiny model guesses ahead and the big one checks its work, so answers come out up to twice as fast on a Mac.
A 0.8B draft model gives a 119% peak decode speedup on Qwen3.8-27B, but mlx_lm refuses to run it against the hybrid attention cache without a patch.
Why MLX decode slows at long context
In plain wordsLong conversations slow a local model down. Compressing its memory halves the slowdown, but makes reading your prompt slower.
Quantizing the KV cache halves how fast decode degrades with context, and halves prefill throughput too. Break-even math included.
Why batching does not fix decode: GEMV versus GEMM
In plain wordsA Mac chip does batch work about 80x faster than one-token-at-a-time work. That is why writing the answer is the slow part.
On an M5 Pro, batched matmul holds a flat ~80x throughput advantage over matrix-vector ops at every size tested. That gap is why batching helps prefill and barely touches decode.
MLX non-determinism on Apple Silicon
In plain wordsSame question, same model, same Mac, different answers. This finds where that comes from.
Identical inputs give different outputs. Batch-invariance tests from 512 to 4096 matrices, across bfloat16, float32 and float16.
subagent-fleet
In plain wordsRun a team of AI coding helpers on your own machines instead of paying per call, and measure how close they get.
A control plane that routes Claude Code-style subagents across local Ollama machines. One fleet.yaml generates the LiteLLM routes, agent files and warmup flows. The published eval compares the local fleet against Sonnet 5 and GPT-4o-mini.
Quecto
In plain wordsA coding agent small enough to read in an afternoon, built so you can check what it did.
A minimal agent harness and coding agent in Rust: a 1.3 MB core, a 5.5 MB agent, no async runtime. Built to be evaluated, with verification gates and session persistence.
MEDFIT-LLM: domain-focused fine-tuning of small language models for medicine
In plain wordsSmall models trained on medicine can beat bigger general models on medical questions.
Fine-tuned small models evaluated against generic baselines on medical tasks. Published at a 2025 IEEE conference.
Efficient Reduced-BIAS Genetic Algorithm (ERBGA) for generic community detection
In plain wordsFind the communities in a network without telling the algorithm how many to look for.
A genetic algorithm that drops structural assumptions and needs no prior community count. Applied to benchmark graphs and Alzheimer's disease genetic networks.
Full citation record on Google Scholar. Longer pieces: What is an AI agent harness and the AI Systems Design Field Guide.
Behind the scenes
Most of what ships starts as a late-night question that never gets a blog post. These are the questions I have been building against in private: some became published work, some are still running, some taught me what not to do.
Can a chat assistant remember only what it can ground?
A local-first assistant whose memory lives in a graph database and is built from my own agent session history, running on local models.
What does it take to trust an automated code reviewer?
A pull-request review service held to a 100% test-coverage gate, so the reviewer is tested at least as hard as the code it reviews.
Let the LLM imagine the disaster, let physics check it
An adversarial agent proposes chains of hazards (glacier collapse, dam breach, flood), and classical hydrology equations verify every step. Tested on a blind 2026 hindcast against Monte Carlo and plain-LLM baselines.
An LLM that can only say no
Numbers make the decision and the model gets a veto, never a vote, behind hard deterministic limits. A pattern for putting LLMs near decisions that cost money.
Can a local vision model read an X-ray well enough to help?
A 32B vision-language model reads dental radiographs on local hardware, with every output logged for a human to review.
Letting a model choose what is worth reading
RSS in, embeddings and a local or hosted model deciding what makes the cut.
Search that survives messy PDFs
Three text-extraction fallbacks before anything reaches the vector index, because retrieval is only as good as the parse.
Read less, answer the same
Agents and an evolutionary search narrow the text a model has to read before it answers.
One prompt, every local model, side by side
A small Rust harness that streams the same prompt through a list of local models, the seed of the eval habits behind later work.
Can a LoRA learn to write a book?
Low-rank fine-tuning of Llama on a corpus of novels for long-form generation, checkpoint by checkpoint.