#109109th of 117 in Model serving
llama2.mojo
Llama 2 inference in a single Mojo file, run from the CLI
Run it:RackNerd ↗ (opens in a new tab)RepoCloud ↗ (opens in a new tab)Affiliate links, no effect on a rank.
- Stars
- 2.1k
- License
- MIT
- Last commit
- Sep 2026
- Language
- Mojo
2,105 on 28 Apr 20262,126 on 24 Nov 2026
From GitHub's daily star counts.
Checked on GitHub.
Overview
A port of llama2.c to Mojo that runs Llama 2 architecture checkpoints (stories 260K to 110M, TinyLlama-1.1B-Chat) from the command line, using SIMD and a parallel worker pool. The README's own benchmarks show 1283 tok/s on stories15M on an M1 Max, against 730 for llama2.c and 890 for llama.cpp. It is a CLI demo, not a server.
Who it is for: Mojo and CPU inference enthusiasts experimenting with small Llama 2 models
Strengths
- Single-file Mojo implementation with SIMD vectorization and a configurable worker count (-j)
- README benchmarks show higher tok/s than llama2.c and llama.cpp on small models
- Runs on CPU only; no GPU needed
- MIT licensed, with a short CLI for seed, temperature, steps, prompt and tokenizer
Weaknesses
- Only stories checkpoints and TinyLlama-1.1B-Chat are listed as tested
- No HTTP API or chat loop; one prompt per command-line run
- Requires Mojo 1.1.0 / MAX 26.6.0 toolchain plus a C compiler
- Uses llama2.c .bin checkpoints, not GGUF or safetensors; no tagged releases
What it needs
- no GPU
- Docker
- Needs Mojo 1.1.0, MAX 26.6.0, uv, C compiler (gcc)
- Models: stories260K, stories15M, stories42M, stories110M, TinyLlama-1.1B-Chat-v0.2
Also in Model serving
See all 117| Rank | Project | Score |
|---|---|---|
| #107 | ai-hordeServer for a volunteer GPU network serving image and text generation | 47 out of 100 |
| #108 | startlux-decisionInference server for decision models that return probabilities per typed question | 46 out of 100 |
| #110 | powerinferCPU/GPU hybrid LLM inference engine exploiting sparse neuron activation | 40 out of 100 |
| #111 | tensorrt-yoloC++ and Python TensorRT inference for YOLO models on NVIDIA GPUs | 38 out of 100 |
| #112 | mllmC++ inference engine for running multimodal LLMs on phones and edge devices | 37 out of 100 |