Waking up Nano

Getting ready…

0%0.0 / 8.4 MB

The first visit downloads the 8.4 MB model. After that it works offline.

Runs 100% on your device · no server · works offline

Affan AIEngine Nano

A real chat AI squeezed into 8 MB. It talks, tells jokes, writes little stories and uses a built-in calculator, and it does all of it inside this page, on your phone or computer.

How is this possible?
  • 14M parameters
  • 8.4 MB int4 model
  • 0 servers
  • AEN engine, WebAssembly SIMD
Ask Nano:

Talk to Nano

Press the button once. The engine and the 8 MB model download to your device, and from then on every word is generated right here.

NanoSleeping

Nano is asleep

It is a tiny model, so it needs about three seconds to wake up.

One-time download of 8.4 MB, then it is cached for offline use.

Nano was trained on only about 4 billion tokens, so keep expectations modest: short, simple answers and frequent factual mistakes, as it's a DUMB AI.

Every message starts a new chat, so each answer is fresh.

Nano is a very small model. It can be wrong, especially about facts. For arithmetic it calls its calculator, so numbers like 17 × 23 come out exact.

How does an 8 MB brain work?

Four ideas make Nano small, fast and private.

Tiny on purpose

14 million parameters in 8 layers. It was trained on only about 4 billion tokens in total (about 2 billion of base training plus about 2 billion of chat and facts tuning), so keep expectations modest. It has since been fine-tuned for friendly casual chat and a small set of simple facts, but it is not a big assistant and can still make things up.

4-bit weights

Every weight is stored in 4 bits and then fine-tuned to keep about 99% of the full-precision quality. That is why the whole model fits in 8.4 MB.

The AEN engine

The same AEN inference engine that runs on PCs, GPUs and phones runs here as WebAssembly SIMD. It reads the model file directly and uses no cloud at all.

A real calculator

When you ask for maths, Nano writes the sum, the engine computes it exactly, and Nano writes the answer. You can see the tool call appear in the chat.

The same file runs on an ESP32

The model you are chatting with here is affan-ai-engine-nano-int4-v4.afn, the exact file made for the ESP32-S3 microcontroller (8 MB of PSRAM, 16 MB of flash). No conversion, no server: a chip that costs a few dollars can run the same AI.

  • Memory-map the file from flash and read weights row by row
  • int4 weights, int8 activations, one fp16 scale per 32 weights
  • The firmware runs the calculator tool, just like this page does

The numbers

Measured, not promised.

0million parameters
0MB model file
0% of full quality kept
0tokens per reply
NameAffan AI Engine Nano
Made byMABA Studios · Muhammad Affan bin Adnan
ArchitectureDecoder-only transformer, 8 layers, 384 wide, 6 attention heads (2 key-value heads), SwiGLU, RoPE, tied embeddings
Vocabulary8,192 byte-level BPE tokens, digits split one by one
Quantisationint4 weights (group of 32, fp16 scale), GPTQ then distillation-trained; int8 activations
EngineAEN.cpp (native: CPU, CUDA, Metal, ARM) and this WebAssembly SIMD port
ToolsExact calculator (+ - × ÷ % ** and brackets)
LicenseApache 2.0
Page 9 of the technical report: the speed model for the ESP32-S3 Page 4 of the technical report: the mathematics of the network Cover of the Affan AI Engine Nano V3 technical report

Read the documentation

The complete technical report, written by the author in two parts and published here as one 12-page PDF. It explains exactly how Nano is built, trained, compressed and run, with the mathematics written out.

  • Architecture, with the exact parameter count (13,965,696) derived step by step
  • 24 numbered equations: attention, RoPE, SwiGLU, the training loss, GPTQ and quantisation-aware training
  • Diagrams and real training curves, evaluation results and honest limits
  • A speed model for the ESP32-S3, clearly marked as an estimate

Quick answers

The short version. Read the full FAQ.

What is Affan AI Engine Nano?

A very small chat AI: 14 million parameters stored in an 8.4 MB int4 file. It runs inside this web page with the AEN inference engine (WebAssembly SIMD), so there is no server and no account. It can chat, tell jokes, write short stories and use an exact calculator.

Does it work offline and is it private?

Yes. After the first visit the page, the engine and the model are cached on your device, so it works without internet. Your messages are processed on your device and are never sent anywhere.

Which browsers and devices can run it?

Any current browser with WebAssembly SIMD: Chrome, Edge, Firefox and Safari 16.4 or newer, on Windows, macOS, Linux, Android and iPhone. Browsers without SIMD fall back to a slower mode. It uses extra CPU threads automatically when the page allows it.

How good is it, honestly?

It is a tiny model. It is good at friendly short chat, jokes, simple stories and calculator questions, and it can be wrong about facts. It is not a replacement for large assistants. See how it works and how it runs on an ESP32.

Contact me

Questions, feedback, bug reports or ideas for working together? Write to me by email.

mabastudios.official@gmail.com