Revised on November 24, 2026. The conversion commands and C++ code in the July 2025 version do not work as written with current llama.cpp, so this guide now uses a current GGUF model and the official C++ example.
1. Install
llama.cpp provides an inference library and command-line tools. Use WinGet on Windows or the official installer on macOS/Linux.
| |
Official installer for macOS/Linux:
| |
2. Run the model
The original TinyLLaMA weights use Hugging Face format. This guide uses a third-party Q4_K_M GGUF conversion for llama.cpp; you do not need to convert the original weights yourself. The first run downloads about 669 MB.
| |
3. Build the C++ example
For a C++ application, refer to the official llama-simple example. Its current C++17 code and CMake target demonstrate model loading, tokenization, inference, sampling, and cleanup. APIs change; use the example and header from the same checkout as your build.
| |
4. Model size and limitations
The Q4_K_M file is about 669 MB. The model card estimates about 3.17 GB RAM for CPU-only use, but actual needs vary with the OS and context size. TinyLLaMA 1.1B Chat v1.0 is a small, older model. Evaluate quality and language support for your task; validate output before acting on it.
