Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/MojoLlama/blob/main/www/index.html # MojoLlama Archived Mojo/MAX quantizer and serving research repository (read-only history) Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `MojoLlama / www / index.html` 1901 lines · 76627 bytes Raw Blame History 1 2 3 4 5 6 MojoLlama — CPU-First LLM Inference Platform 7 8 9 10 11 12 13 14 15 16 17 18 19 971 972 973 974 975 976 999 1000
1001
1002 v0.5.0 1003 Features 1004 Models 1005 Benchmarks 1006 Quick start 1007 Docs 1008 Chat 1009 Studio 1010 GitHub 1011
1012 1013 1014
1015
1016
1017
1018
v0.5.0 — Open source
1019

CPU-first LLM inference,
engineered for performance

1020

MojoLlama is a high-throughput inference engine for CPU, built on Modular MAX. GGUF native, MoE-optimized, with support for 50+ architectures — from Llama to Gemma 4 to hybrid SSM models. GPU acceleration via MAX engine for supported models.

1021
1022 Get started → 1023 Try chat 1024
1025
1026
1027
1028 1029 1030 1031 mojollama — benchmark 1032
1033
1034
# ZAYA1-8B Q8_0 — Pure Mojo engine 🦙
1035
$ ./zaya_gen_q8 32
1036

1037
✓ Model loaded (4.3s)
1038
architecture: zaya (80 layers, 16 experts, top-1)
1039
quantization: Q8_0
1040
parameters: 8.4B total / 760M active
1041

1042
✓ Generating 128 tokens...
1043
zero C code — all Mojo SIMD + parallelize
1044
no Python bridge — pure Mojo compute kernels
1045

1046
📊 Results
1047
throughput: 28.6 tok/s
1048
output: real English text (verified)
1049
1050
1051
1052
1053
0
Peak tok/s (pure Mojo)
1054
0
vs llama.cpp
1055
0
Architectures
1056
0
Concurrent tok/s
1057
0
License
1058
1059
1060
1061 1062 1063
1064
1065 1066

Latest releases

1067

New architecture support, performance breakthroughs, and infrastructure improvements shipped in recent releases.

1068
1069
1070 Gemma 4 1071

Gemma 4 E2B engine

1072

Per-layer projections, GeGLU activation, sliding window attention (SWA=512), logit softcapping at 30.0, shared KV layers, and post-attention/FFW norms.

1073
18.8 tok/s
1074
1075
1076 Pure Mojo 1077

ZAYA1-8B — pure Mojo engine

1078

80 layers (40 attn + 40 MoE, 16 experts top-1) running entirely in Mojo. Zero C code, zero Python bridge. Q8_0 quantized matmul via SIMD+parallelize. Full architecture with GQA, RoPE, RMS norm, residual scales, and 262K vocab decode.

1079
28.6 tok/s (pure Mojo)
1080
1081
1082 0.94× 1083

GPT-OSS on par with llama.cpp

1084

After MXFP4 expert matmul fix and Q5_0 attention kernel, GPT-OSS-20B reaches 25.5 tok/s — on par with llama.cpp's 27.2 tok/s on the same hardware. The benchmark table at line 1210 shows the corrected numbers.

1085
1086
1087 1.57× 1088

Qwen3.6 hybrid SSM

1089

Hybrid SSM+Attention layers with MXFP4 quantization. Concurrent serving at 47 tok/s aggregate across 10 workers, 92% of 200% scaling target.

1090
1091
1092 OMO 1093

TinyLlama pure Mojo

1094

Full TinyLlama-1.1B inference in pure Mojo — 27.2 tok/s f16, 88.1 tok/s Q8_0 B=4. Batched matmul with SIMD FMA, GQA attention, RoPE, RMS norm, and vocab decode. Zero C code.

1095
88.1 tok/s (B=4 Q8_0)
1096
1097
1098 Docker 1099

Production Docker image

1100

Multi-stage build on GHCR with hardware auto-tune, HF model download, and docker-compose profiles for API server, chat, bench, and fallback.

1101
1102
1103 Pages 1104

GitHub Pages site

1105

Interactive chat UI, benchmark tables, architecture support matrix, and getting-started guide deployed to GitHub Pages on every push.

1106
1107
1108 MAX 1109

MAX GPU acceleration

1110

GPU inference via Modular MAX engine — CUDA, ROCm, and Metal backends. Offload compute to GPU while keeping MojoLlama's CPU-optimized pipeline for unsupported layers.

1111
1112
1113 Studio 1114

MojoLlama Studio dashboard

1115

Full-featured dashboard with chat, training, benchmarking, auto-tune, quantization, dataset tools, and HuggingFace Hub integration.

1116
1117
1118
1119
1120 1121 1122
1123
1124 1125

Built for local LLM workloads

1126

From single-token inference to production concurrent serving — MojoLlama scales to your hardware.

1127
1128
1129
⚡
1130

MoE-optimized engine

1131

C-accelerated fused MoE forward kernel with expert dispatch for GPT-OSS, Qwen3, and Qwen3.6 MoE models.

1132 MoE optimized 1133
1134
1135
🧬
1136

Hybrid SSM + Attention

1137

Qwen3.6-35B with Mamba-2 SSM + Attention hybrid layers, MXFP4 quantization, and concurrent serving at 47 tok/s aggregate.

1138
1139
1140
🧩
1141

Gemma 4 & ZAYA1

1142

Gemma 4: per-layer projections, GeGLU activation, sliding window, logit softcapping. ZAYA1: interleaved ATTN/MoE+MoD with CCA.

1143
1144
1145
🔌
1146

50+ architectures

1147

Llama, Mistral, Qwen, GPT-OSS, DeepSeek V2/V3, DBRX, Mixtral, Gemma 4, ZAYA1, Falcon, Phi — pluggable forward passes for any GGUF model.

1148
1149
1150
🔋
1151

GGUF native

1152

All quantization types: Q4_0, Q4_K, Q5_K, Q6_K, Q8_0, MXFP4. Full K-quant support including Q5_K and MXFP4 for expert weights.

1153
1154
1155
🎮
1156

MAX GPU engine

1157

Built on Modular MAX — GPU acceleration via MAX engine for supported models. Leverages CUDA, ROCm, and Metal backends through MAX's hardware abstraction layer.

1158 GPU acceleration 1159
1160
1161
🔄
1162

Concurrent serving

1163

Multi-process server with configurable workers. Up to 47 tok/s aggregate on Qwen3.6-35B with 10 concurrent users.

1164
1165
1166
🔧
1167

Hardware auto-tune

1168

Sweeps OMP threads, batch sizes, concurrency levels, and engine settings. Caches per-model optimized config on first load.

1169
1170
1171
📦
1172

Docker ready

1173

Pre-built image on GHCR with auto-tune, HuggingFace model download, and docker-compose for API server, chat, and llama.cpp fallback.

1174
1175
1176
🖥️
1177

Unified CLI

1178

Single mojollama command for chat, serve, bench, quantize, convert, autotune, eval, train, export, and hub operations.

1179
1180
1181
1182
1183 1184 1185
1186
1187 1188

Architecture support

1189

Every model that loads in GGUF format is supported. Architecture-specific forward passes ensure correct computation.

1190
1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206
ArchitectureStatusNotable features
Llama 2/3/4, MistralFullDense, GQA, SwiGLU, RoPE
Qwen2, Qwen3FullTNT embedding, partial rotary
GPT-OSSFullMoE 32 experts, packed experts, bias attention — on par with llama.cpp
Qwen3 MoEFull128 experts top-8, shared expert, SwiGLU
Qwen3.6-35BFullHybrid SSM+Attention, MXFP4, MoE 256 experts
Gemma 4FullPer-layer projections, GeGLU, sliding window, logit softcapping
ZAYA1-8BPure Mojo ✅80 layers ATTN/MoE, 16 exp top-1, Q8_0, 28.6 tok/s
DeepSeek V2/V3SupportedMulti-head Latent Attention, DeepSeekMoE
Mixtral, DBRXSupportedStandard MoE with gated FFN
FalconIn developmentParallel attention+FFN, fused QKV
Phi-3/4In developmentFused QKV, long RoPE
1207
1208
1209
1210 1211 1212
1213
1214 1215

Benchmarked on real hardware

1216

AMD Threadripper 3970X (32C/64T, 251GB DDR4). 32 threads unless noted. All measurements in tok/s (higher is better).

1217
1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230
ModelEnginetok/svs llama.cpp
TinyLlama 1.1B Q4_0Dense engine79.20.89×
TinyLlama 1.1B f16Pure Mojo27.2—
ZAYA1-8B Q8_0Pure Mojo28.6 🏆—
GPT-OSS-20B Q4_K_MMoE (Python)25.50.94×
Qwen3.6-35B MXFP4MoE (Python)25.51.57× 🏆
Qwen3.6-35B MXFP4Concurrent (10×3t)47 aggregate—
Gemma 4 4.6B Q4_K_MGemma4 engine18.8—
ZAYA1-8B Q4_K_MZAYA engine (1t)0.9—
1231
1232
1233
1234 1235 1236
1237
1238 1239

From zero to inference

1240

Install MojoLlama and run your first model in minutes.

1241
1242
1243
Step 01
1244

Install

1245

Clone the repository and install dependencies.

1246
1247 $ git clone https://github.com/a730/MojoLlama.git
1248 $ cd MojoLlama/src && pip install -e . 1249
1250
1251
1252
Step 02
1253

Download a model

1254

Get a GGUF model from HuggingFace or use your own.

1255
1256 $ mojollama convert --hf meta-llama/Llama-3.2-1B \
1257 --outtype q4_0 1258
1259
1260
1261
Step 03
1262

Run inference

1263

Chat, serve, or benchmark — all from one command.

1264
1265 $ mojollama chat -m model.gguf
1266 $ mojollama serve -m model.gguf -p 8080 1267
1268
1269
1270
1271 View full documentation → 1272
1273
1274
1275 1276 1277
1278
1279 1280

What's coming next

1281

Major milestones across engine, studio, GPU, and platform. Use the timeline dots or arrows to navigate.

1282 1283
1284 1285 1286
1287
1288
Phase 0
1289
Foundation — shipped
1290

C engine, Python MoE engine (0.94× vs llama.cpp), Studio (14 panels, 25+ CLI commands), Docker deployment. 60+ arch detection, 2 custom forward passes.

1291
1292
1293
Phase 1
1294
Full HF Model Coverage
1295

Custom forward passes for Falcon, Phi-3/4, DeepSeek V2/V3, Qwen2-VL, Command-R. Automated forward pass generator from GGUF metadata for remaining 40+ archs. Perplexity regression benchmark per arch.

1296
1297
1298
Phase 2
1299
Studio: One-Stop ML App
1300

Pure-Python quantizer, imatrix + dynamic 2-bit quantization. LoRA/QLoRA with true Python gradients. Capability benchmarks (MMLU, GSM8K, HumanEval). HF dataset integration + quality filters. Training loop UI with live charts.

1301
1302
1303
Phase 3
1304
CPU + GPU Engine
1305

Q8_0 input C quant (2-4×), MXFP4 C kernel (10×), continuous batching. MAX GPU: CUDA, ROCm, Metal backends. GPU attention, MoE dispatch, KV cache. Flash Attention + CUDA graphs. Multi-GPU tensor/pipeline parallelism. GPU auto-tune.

1306
1307
1308
Phase 4
1309
Platform: Ship It
1310

pip package with pre-built wheels (manylinux x86_64, aarch64). Tauri desktop app. CI/CD with benchmark regressions. API hardening (keys, rate limiting, hot-swap). Model registry + comprehensive test suite.

1311
1312 1313 1314 1315
1316 1317 1318
1319
1320 1321 1322
1323 1324 1325
1326
1327 Now 1328
Phase 0
1329
Foundation
1330
6 major areas shipped
1331
    1332
  • C batched engine — AVX2+OMP quant matmul
  • 1333
  • Python MoE engine — 0.94× vs llama.cpp
  • 1334
  • 2 custom forward passes (Gemma 4, ZAYA1)
  • 1335
  • Studio web UI — 14 panels
  • 1336
  • Studio CLI — 25+ commands
  • 1337
  • Docker with auto-tune + HF download
  • 1338
1339
1340
1341 Next 1342
Phase 1
1343
Full HF Model Coverage
1344
10 tasks · 4 weeks
1345
    1346
  • Falcon — parallel attention+FFN, fused QKV
  • 1347
  • Phi-3/4 — fused QKV, long RoPE (128K)
  • 1348
  • DeepSeek V2/V3 — Multi-head Latent Attention
  • 1349
  • Qwen2-VL — vision + language interop
  • 1350
  • Command-R / Cohere2 — Tanh-gated RoPE
  • 1351
  • Automated forward pass generator from GGUF metadata
  • 1352
  • BTLM / GLM — bidirectional hybrid
  • 1353
  • Perplexity regression benchmark per arch
  • 1354
1355
1356
1357 Next 1358
Phase 2
1359
Studio: One-Stop ML App
1360
18 tasks · 6-8 weeks
1361
    1362
  • Pure-Python quantizer — Q4_K through Q8_0
  • 1363
  • Imatrix + dynamic 2-bit quantization
  • 1364
  • Studio quant wizard — pick model → quants → run
  • 1365
  • LoRA/QLoRA with true Python gradients
  • 1366
  • Training loop UI — loss charts, ETA, schedule
  • 1367
  • DPO/ORPO preference optimization
  • 1368
  • Capability benchmarks — MMLU, GSM8K, HumanEval
  • 1369
  • HF dataset integration + quality filters
  • 1370
  • Perplexity evaluation + benchmark history
  • 1371
1372
1373
1374 Future 1375
Phase 3
1376
CPU + GPU Engine
1377
21 tasks · 8-12 weeks
1378
    1379
  • Q8_0 input C quant — 2-4× matmul improvement
  • 1380
  • MXFP4 C kernel — 10× faster than Python
  • 1381
  • True continuous batching + PagedAttention
  • 1382
  • MAX GPU: CUDA, ROCm, Metal backends
  • 1383
  • GPU attention, MoE dispatch, KV cache
  • 1384
  • Flash Attention + CUDA graphs
  • 1385
  • Multi-GPU tensor + pipeline parallelism
  • 1386
  • GPU-native FP8/INT4 quantization
  • 1387
  • GPU auto-tune — layers, batch, concurrency
  • 1388
1389
1390
1391 Future 1392
Phase 4
1393
Platform: Ship It
1394
7 tasks · 4-6 weeks
1395
    1396
  • pip package — manylinux x86_64, aarch64 wheels
  • 1397
  • Desktop app — Tauri wrapper for Studio
  • 1398
  • CI/CD — GitHub Actions, benchmark regressions
  • 1399
  • API hardening — keys, rate limiting, hot-swap
  • 1400
  • Model registry — local + HF Hub, one-click download
  • 1401
  • Comprehensive test suite
  • 1402
  • Auto-generated release notes
  • 1403
1404
1405
1406 1407
1408 View full roadmap → 1409
1410 1411
1412
1413
1414 1415 1416
1417
1418

Star us on GitHub

1419

MojoLlama is open source (Apache 2.0). Contributions, issues, and feature requests welcome.

1420
1421 GitHub → 1422 Report an issue 1423
1424
1425
1426 1427 1428 1459 1460 1461 1464 1465 1900 1901