#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.

Releases and problems feed (RSS)

Stars
2.1k
License
MIT
Last commit
Sep 2026
Language
Mojo
Stars, last 30 weeks+21
28 Apr 2026: 2,105 stars5 May 2026: 2,106 stars12 May 2026: 2,107 stars19 May 2026: 2,108 stars26 May 2026: 2,110 stars2 Jun 2026: 2,110 stars9 Jun 2026: 2,110 stars16 Jun 2026: 2,110 stars23 Jun 2026: 2,110 stars30 Jun 2026: 2,111 stars7 Jul 2026: 2,111 stars14 Jul 2026: 2,114 stars21 Jul 2026: 2,114 stars28 Jul 2026: 2,114 stars4 Aug 2026: 2,114 stars11 Aug 2026: 2,115 stars18 Aug 2026: 2,117 stars25 Aug 2026: 2,119 stars1 Sept 2026: 2,120 stars8 Sept 2026: 2,120 stars15 Sept 2026: 2,121 stars22 Sept 2026: 2,122 stars29 Sept 2026: 2,123 stars6 Oct 2026: 2,124 stars13 Oct 2026: 2,124 stars20 Oct 2026: 2,124 stars27 Oct 2026: 2,124 stars3 Nov 2026: 2,125 stars10 Nov 2026: 2,126 stars17 Nov 2026: 2,126 stars24 Nov 2026: 2,126 stars

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
Also in Model serving
RankProjectScore
#107ai-hordeServer for a volunteer GPU network serving image and text generation Live demo ↗ (opens in a new tab)1.7k stars+69 (+4.2%) in 30 daysAGPL-3.047 out of 100
#108startlux-decisionInference server for decision models that return probabilities per typed question Live demo ↗ (opens in a new tab)1.6k starsApache-2.046 out of 100
#110powerinferCPU/GPU hybrid LLM inference engine exploiting sparse neuron activation Live demo ↗ (opens in a new tab)9.9k stars+62 (+0.6%) in 30 daysMIT40 out of 100
#111tensorrt-yoloC++ and Python TensorRT inference for YOLO models on NVIDIA GPUs1.9k starsGPL-3.038 out of 100
#112mllmC++ inference engine for running multimodal LLMs on phones and edge devices1.6k starsMIT37 out of 100