# Profile llama.cpp with Arm Streamline and KleidiAI

## In this learning path

- [Introduction](https://learn.arm.com/learning-paths/servers-and-cloud-computing/llama_cpp_streamline/)
- [Overview](https://learn.arm.com/learning-paths/servers-and-cloud-computing/llama_cpp_streamline/1_overview/)
- [Explore llama.cpp architecture and the inference workflow](https://learn.arm.com/learning-paths/servers-and-cloud-computing/llama_cpp_streamline/2_llama.cpp_intro/)
- [Integrate Streamline Annotations into llama.cpp](https://learn.arm.com/learning-paths/servers-and-cloud-computing/llama_cpp_streamline/3_llama.cpp_annotation/)
- [Analyze token generation performance with Streamline profiling](https://learn.arm.com/learning-paths/servers-and-cloud-computing/llama_cpp_streamline/4_analyze_token_prefill_decode/)
- [Analyze operators with channel annotations](https://learn.arm.com/learning-paths/servers-and-cloud-computing/llama_cpp_streamline/5_operator_deepdive/)
- [Examine multi-threaded performance patterns in llama.cpp](https://learn.arm.com/learning-paths/servers-and-cloud-computing/llama_cpp_streamline/6_multithread_analyze/)
- [Next Steps](https://learn.arm.com/learning-paths/servers-and-cloud-computing/llama_cpp_streamline/_next-steps/)

## About this Learning Path

### Skill Level
- Advanced

### Reading Time
- 1 hr

### Last Updated
- 12 Nov 2026

### Authors
- [Zenon Zhilong Xiu, Arm](https://linkedin.com/in/zenon-zhilong-xiu-491bb398)
- [Odin Shen, Arm](https://github.com/odincodeshen)

### Arm IP
- [Cortex-A](https://support.arm.com/?tab=compute-ip&Product%20Type=Application%20Processors)
- [Neoverse](https://support.arm.com/?tab=compute-ip&Product%20Type=Infrastructure%20Processors)

### Tags
- [AI/ML](https://learn.arm.com/tag/ai-ml/)
- [Linux](https://learn.arm.com/tag/linux)
- [Android](https://learn.arm.com/tag/android)
- [Arm Streamline](https://learn.arm.com/tag/arm-streamline)
- [CPP](https://learn.arm.com/tag/cpp)
- [llama.cpp](https://learn.arm.com/tag/llama.cpp)
- [Profiling](https://learn.arm.com/tag/profiling)

## Who is this for?

This is an advanced topic for software developers, performance engineers, and AI practitioners who want to optimize llama.cpp performance on Arm-based CPUs.

## What will you learn?

After completing this Learning Path, you'll be able to perform the following tasks:

- Profile llama.cpp architecture and identify the role of the Prefill and Decode stages.
- Integrate marker annotations into llama.cpp for fine-grained performance insights.
- Capture and interpret profiling data with Streamline.
- Analyze specific operators during token generation using channel annotations.
- Evaluate multi-core and multi-thread execution of llama.cpp on Arm CPUs.

## Prerequisites

Before starting, you'll need the following prerequisites:

- Basic understanding of llama.cpp
- Understanding of transformer models
- Knowledge of Arm Streamline usage
- An Arm Neoverse or Cortex-A hardware platform running Linux or Android

## Summary

You’ll profile `llama.cpp` on Arm CPUs with Arm Streamline, including runs that use KleidiAI LLM kernels. First, you’ll add marker annotations for prefill and decode phases and build `llama-cli`. Then, you’ll prepare the model files and `gator` daemon, and capture traces. Finally, you’ll inspect channel annotations and operator timing to distinguish pipeline stages and assess multi-core and multi-thread behavior during token generation.
