Skip to main contentThe Local Bench

How-to · Beginner · about 15 min · reviewed 2026-10-13

Run a tiny local model on your Mac CPU

Compile one small program, download a 61 MB model, and generate a story locally. A setup check with no GPU, account or API key.

success icon
Tested by us.
The download, compile and generation commands below completed on an Apple silicon Mac on 2026-10-13. This tests local text generation only, not chat quality, GPU offload or a browser interface.

Before you start

Apple silicon Mac; 200 MB free disk space after developer tools are installed. macOS.

  • Terminal
  • Apple Command Line Tools already installed (clang --version must succeed)
  • Internet access for the initial downloads
Start guide
  • Software and cost

    $0 · free software and model; uses your existing Mac

    • llama2.c · CPU runtime pinned to commit 350e04fe35433e6d2941dce5a1f53308f87058eb
    • TinyStories 15M · 60,816,028-byte model; a story generator, not a chat assistant

    Tested on

    Last tested: 2026-10-13

    • macOS 26.2, ARM64, Apple clang 17.0.0, 2026-10-13: Downloaded the pinned runtime and tokenizer, verified the model checksum, compiled and generated 128 tokens on CPU with exit code 0. No GPU or model API used.

    Not yet tested by us

    • Installing Apple Command Line Tools on a fresh Mac
    • Intel Macs, Linux and Windows
    • Any GPU, chat interface or production workload
  1. Check your compiler

    Open Terminal and run:

    clang --version

    Our run reported Apple clang 17.0.0. If this opens an installation prompt, install Apple's Command Line Tools first, then rerun the check. That fresh installation is outside our tested scope.

  2. Download into a new folder

    Run each command in order. If any command fails, stop before the next one. mkdir must create a new folder; choose another name if it already exists.

    mkdir tiny-local-demo
    cd tiny-local-demo
    curl -fL https://raw.githubusercontent.com/karpathy/llama2.c/350e04fe35433e6d2941dce5a1f53308f87058eb/run.c -o run.c
    curl -fL https://raw.githubusercontent.com/karpathy/llama2.c/350e04fe35433e6d2941dce5a1f53308f87058eb/tokenizer.bin -o tokenizer.bin
    curl -fL https://huggingface.co/karpathy/tinyllamas/resolve/main/stories15M.bin -o stories15M.bin

    The source and tokenizer are pinned to a specific revision. Check the model before running it:

    printf '%s\n' 'cd590644d963867a2b6e5a1107f51fad663c41d79c149fbecbbb1f95fa81f49a  stories15M.bin' | shasum -a 256 -c -
    Expected output
    stories15M.bin: OK

    If the checksum differs, stop. Do not replace the expected checksum with the downloaded file's value.

  3. Compile and generate
    Check

    clang -O3 -o run run.c -lm
    ./run stories15M.bin -t 0 -n 128 -i 'Once upon a time'

    The prompt is continued into a story. Our run began:

    Expected output
    Once upon a time, there was a little girl named Lily. She loved to play outside in the sunshine.

    The program also prints achieved tok/s. That confirms generation completed; the value depends on your machine. The 128-token limit can stop mid-sentence. All inference uses the downloaded files on your CPU. You can rerun the second command without an internet connection.

    info icon
    A small success, deliberately

    This 15-million-parameter model generates simple stories. It is not instruction-tuned, does not answer questions reliably, and is not included in our fit or recommendation catalogue. Its job here is to prove that your machine can generate text locally.

  4. Choose your next setup

    For a chat interface and a larger model, continue to Ollama and Open WebUI. That workflow is sourced but has not been tested end to end on our bench. For hardware planning, use the configurator with a model from its supported catalogue; the tiny demo is not a speed benchmark for those models.

    This demo creates no background service. Keep the folder to rerun it, or remove the tiny-local-demo folder in Finder when finished.

Troubleshooting

  • Install Apple's Command Line Tools using the linked Apple instructions, then open a new Terminal and repeat step 1.

  • Run pwd and ls. Your current folder must contain run, stories15M.bin and tokenizer.bin. Return to the folder created in step 2 before trying again.

  • The model is tiny and only demonstrates generation. A successful process exit and generated text validate this setup; factual accuracy is not part of the test. The sun remains unavailable for ball games.

Sources

  1. llama2.c: source and usage
  2. TinyStories model files
  3. Apple: installing command-line tools

Markdown: /how-to/tiny-model-cpu.md · JSON: /api/v1/how-to/tiny-model-cpu.json