~/SmaLLM github.com/mattsaund/SmaLLM

SmaLLM

A small, fast LLM inference engine for low-power hardware.

Download on GitHub

Or use this command in terminal

curl -fsSL https://raw.githubusercontent.com/mattsaund/SmaLLM/main/install.sh | sh
irm https://raw.githubusercontent.com/mattsaund/SmaLLM/main/install.ps1 | iex

Binary size: macOS 1.96 to 2.39 MB, Linux 1.51 to 2.55 MB, Windows 2.24 to 2.75 MB

Against llama.cpp and Ollama

Size and memory

Speed (Tested with Llama 3.2 1B Q4_K_M)

x86 (Tested on an Intel Core i7-14700K)

  • Prompt

    1.7x faster

    Reading a 256-token prompt on eight threads.

    SmaLLM
    1,209 tok/s
    llama.cpp
    706 tok/s
    Ollama
    716 tok/s

    Best of five. Tuned, llama.cpp reaches 744. SmaLLM leads as far on one to four threads.

  • Generation

    3% faster

    Writing 64 tokens after the prompt, eight threads.

    SmaLLM
    52.4 tok/s
    llama.cpp
    48.9 tok/s
    Ollama
    50.9 tok/s

    Best of five. Tuned, llama.cpp reaches 51.4. On one thread llama.cpp leads, 27.0 to 26.1.

GPU (Tested on an Nvidia RTX 5060 Ti)

  • Prompt

    1.4x faster

    Reading a 512-token prompt.

    SmaLLM
    27,362 tok/s
    llama.cpp
    19,372 tok/s
    Ollama
    18,462 tok/s

    SmaLLM on Vulkan, llama.cpp b12870 on CUDA. Ahead on an RTX 3060 and an Apple M4 too.

  • Generation

    4% faster

    Writing 128 tokens after the prompt.

    SmaLLM
    359 tok/s
    llama.cpp
    345 tok/s
    Ollama
    323 tok/s

    Ahead on an Apple M4 too, 121 to 113. On an RTX 3060 llama.cpp leads, 272 to 262.

ARM (Tested on an Allwinner A733)

  • Prompt

    1.3x faster

    Reading a 128-token prompt on two Cortex-A76 cores.

    SmaLLM
    53.6 tok/s
    llama.cpp
    29.2 tok/s
    Ollama
    41.7 tok/s

    Best of three. With Q4_0 weights llama.cpp reads prompts 7 percent faster here.

  • Generation

    7% faster

    Writing 64 tokens after the prompt.

    SmaLLM
    11.4 tok/s
    llama.cpp
    10.0 tok/s
    Ollama
    10.7 tok/s

    A single-board computer, best of three, the engines taking turns.

Figures from SmaLLM's README.