Back to directory

NNTrainer

An on-device neural network training and inference framework in C++ that runs 30-billion-parameter mixture-of-experts LLMs on a mobile phone by streaming only the active experts from flash storage instead of keeping the whole model in memory.

NNTrainer

NNTrainer's Flash Storage Utilization technique loads only the currently active experts of a mixture-of-experts model from flash storage during inference, which the project reports reduces memory use for a 30-billion-parameter model from about 16.5 GB down to 1.3 GB, making it practical to run on a mobile device. Its LLM inference engine component is built for these resource-constrained environments, currently supporting several open Qwen, GPT-OSS, and Gemma model families in standard, slim, and cached-slim variants.

Additional optimizations include a mixture-of-experts cache that keeps frequently used experts in memory while swapping others to storage, proactive loading that predicts and pre-loads weights before they are needed, and a decoupled KV cache that separates query and key-value computation for more efficient long-context attention. Build scripts target Android, with JNI bindings, and Linux or PC through standard build tooling, and benchmark tools report thermal behavior, prefill and generation speed, and peak memory.

Beyond inference, NNTrainer supports on-device training of neural networks directly on the edge device rather than only in the cloud.

More in Inference

See all 770
  • OpenDecision

    deepanwadhwa.github.io

    An open-source Python package that answers typed questions about application state or documents using a local natural-language-inference model, returning structured choice, score, yes/no or evidence-relation values instead of free text.

  • Lifeboat

    iterate.ai

    A local inference server that puts an OpenAI- and Anthropic-compatible API in front of open-weight language models running on hardware you control, from a laptop to a GPU cluster.

  • Claude S40

    github.com

    An unofficial Claude chat client for 2007-era Nokia Series 40 phones, built as a Java ME app plus a small Go relay server, with web search, reading mode and saved chats.