Repository Analysis

mozilla-ai/llamafile

Distribute and run LLMs with a single file.

3.5 Likely human-written View on GitHub
3.5
Adjusted Score
3.5
Raw Score
100%
Time Factor
2026-05-29
Last Push
24,538
Stars
C++
Language
183,885
Lines of Code
442
Files
627
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 0HIGH 4MEDIUM 9LOW 614

Pattern Findings

627 matches across 12 categories. Click a row to expand file-level details.

Over-Commented Block572 hits · 538 pts
SeverityFileLineSnippet
LOWdiffusionfile/diffusionfile.cpp1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-
LOWllama.cpp.patches/fetch-ui-assets.sh1#!/bin/bash
LOWllama.cpp.patches/renames.sh1#!/usr/bin/env bash
LOWtests/fa_helpers_test.cpp1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-
LOWtests/fa_helpers_test.cpp21// These tests compare our AVX-512-optimized llamafile_fa_* helpers
LOWtests/fa_helpers_test.cpp41#include <vector>
LOWtests/extract_data_uris_test.cpp1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-
LOWtests/integration/run_tests.sh1#!/bin/bash
LOWtests/sgemm/iqk_legacy_test.cpp1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-
LOWtests/sgemm/sgemm_test_utils.h1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-
LOWtests/sgemm/sgemm_test_utils.h201
LOWtests/sgemm/sgemm_vecdot_test.cpp1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-
LOWtests/sgemm/sgemm_vecdot_test.cpp21// ============================================================================
LOWtests/sgemm/sgemm_vecdot_test.cpp41// - Both implementations tend to perform similarly here since memory is
LOWtests/sgemm/sgemm_vecdot_test.cpp61// - Lower is better
LOWtests/sgemm/sgemm_matmul_test.cpp1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-
LOWtests/sgemm/sgemm_matmul_test.cpp21// ============================================================================
LOWtests/sgemm/sgemm_matmul_test.cpp41//
LOWtests/sgemm/sgemm_matmul_test.cpp61// Accuracy (ULP = Units in Last Place):
LOWtests/sgemm/q8_0_layout_test.cpp1// q8_0_layout_test: Diagnostic for block_q8_0 vs block_q8_0_x4 memory layout
LOWtests/sgemm/sgemm_sss_test.cpp1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-
LOWtests/sgemm/sgemm_sss_test.cpp21// ============================================================================
LOWtests/sgemm/sgemm_sss_test.cpp41// - Single-precision accumulation
LOWtests/sgemm/sgemm_sss_test.cpp61// - "ulp average": Mean ULP difference across all output elements
LOWtests/sgemm/iqk_test.cpp1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-
LOWtests/sgemm/iqk_test.cpp21// ============================================================================
LOWtests/sgemm/iqk_test.cpp41// - Prompt processing involves large matrix multiplications with these types
LOWtests/sgemm/iqk_test.cpp61// METRICS:
LOWtests/sgemm/iqk_test.cpp81#include "ggml.h"
LOWtests/strsm/build_and_run.sh1#!/bin/bash
LOWllamafile/tinyblas_cpu_sgemm_amd_fma.cpp1#ifdef __x86_64__
LOWllamafile/cuda.sh1#!/bin/bash
LOWllamafile/cuda.sh21#
LOWllamafile/tinyblas_cpu_sgemm_amd_avx2.cpp1#ifdef __x86_64__
LOWllamafile/tinyblas_cpu_mixmul_amd_avx2.cpp1#ifdef __x86_64__
LOWllamafile/chatbot_file.cpp1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-
LOWllamafile/version.h1// -*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-
LOWllamafile/version.h21#define LLAMAFILE_MAJOR 0
LOWllamafile/xterm.h1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-
LOWllamafile/args.cpp1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-
LOWllamafile/tinyblas_cpu_mixmul_amd_avx512f.cpp1#ifdef __x86_64__
LOWllamafile/image.cpp1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-
LOWllamafile/tinyblas_cpu_mixmul_amd_fma.cpp1#ifdef __x86_64__
LOWllamafile/datauri.h1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-
LOWllamafile/llama.cpp1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-
LOWllamafile/zip.c1// -*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-
LOWllamafile/fa_helpers_amd_avx512f.cpp1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-
LOWllamafile/chatbot_comm.cpp1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-
LOWllamafile/cuda.c1// -*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-
LOWllamafile/cuda.c21//
LOWllamafile/cuda.c41#include <sys/stat.h>
LOWllamafile/chatbot_hist.cpp1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-
LOWllamafile/compute.h1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-
LOWllamafile/tinyblas_cpu_unsupported.cpp1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-
LOWllamafile/tinyblas-compat.h1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-
LOWllamafile/tinyblas-compat.h21//
LOWllamafile/tinyblas-compat.h41
LOWllamafile/tinyblas-compat.h61#define cublasSgemmStridedBatched tinyblasSgemmStridedBatched
LOWllamafile/tinyblas-compat.h81#define CUBLAS_STATUS_INVALID_VALUE TINYBLAS_STATUS_INVALID_VALUE
LOWllamafile/tinyblas-compat.h101#define CUDA_R_32F TINYBLAS_R_32F
512 more matches not shown…
Synthetic Comment Markers4 hits · 30 pts
SeverityFileLineSnippet
HIGHthird_party/mbedtls/error.c88 /* Begin Auto-Generated Code. */
HIGHthird_party/mbedtls/error.c422 /* End Auto-Generated Code. */
HIGHthird_party/mbedtls/error.c443 /* Begin Auto-Generated Code. */
HIGHthird_party/mbedtls/error.c634 /* End Auto-Generated Code. */
Hyper-Verbose Identifiers19 hits · 19 pts
SeverityFileLineSnippet
LOWtests/integration/tests/test_tool_calling.py88 def test_tool_call_correct_function(self, llamafile, server_port, timeouts):
LOWtests/integration/tests/test_tool_calling.py119 def test_tool_call_with_arguments(self, llamafile, server_port, timeouts):
LOWtests/integration/tests/test_multimodal.py48 def test_cli_multiple_images_with_markers(self, llamafile, mmproj, test_image, timeouts):
LOWtests/integration/tests/test_multimodal.py60 def test_cli_multiple_images_marker_mismatch(self, llamafile, mmproj, test_image, timeouts):
LOWtests/integration/tests/test_multimodal.py124 def test_server_describe_image(self, llamafile, mmproj, test_image, server_port, timeouts):
LOWtests/integration/tests/test_multimodal.py149 def test_server_image_question(self, llamafile, mmproj, test_image, server_port, timeouts):
LOWtests/integration/tests/test_server.py12 def test_server_starts_and_responds(self, llamafile, server_port, timeouts):
LOWtests/integration/tests/test_server.py25 def test_server_chat_completion(self, llamafile, server_port, timeouts):
LOWtests/integration/tests/test_server.py50 def test_server_chat_completion_math(self, llamafile, server_port, timeouts):
LOWtests/integration/tests/test_server.py81 def test_server_with_temperature_zero(self, llamafile, server_port, timeouts):
LOWtests/integration/tests/test_server.py127 def test_server_with_max_tokens(self, llamafile, server_port, timeouts):
LOWtests/integration/tests/test_combined.py14 def test_combined_server_responds(self, llamafile, server_port, timeouts):
LOWtests/integration/tests/test_combined.py36 def test_combined_tui_and_server_simultaneously(self, llamafile, server_port, timeouts):
LOWtests/integration/tests/test_cli.py48 def test_nothink_removes_thinking(self, llamafile, timeouts):
LOWtests/integration/tests/test_cli.py59 def test_nothink_shorter_output(self, llamafile, timeouts):
LOWtests/integration/tests/test_tui.py10 def test_tui_responds_to_hello(self, llamafile, tmp_path, timeouts):
LOWtests/integration/tests/test_tui.py58 def test_tui_thinking_visible(self, llamafile, tmp_path, timeouts):
LOWtests/integration/utils/llamafile.py476 def chat_completion_streaming(
LOWtests/integration/utils/llamafile.py554 def chat_completion_with_image(
Decorative Section Separators6 hits · 18 pts
SeverityFileLineSnippet
MEDIUMllamafile/tinyblas_cpu.h25// ╚═╝ ╚═╝╚═╝ ╚═╝ ╚══╝ ╚═════╝ ╚═══╝╚═╝ ╚═╝╚═════╝
MEDIUMscripts/validate_docs.py22# ── helpers ──────────────────────────────────────────────────────────────────
MEDIUMscripts/validate_docs.py32# ── 1. .gitbook.yaml ─────────────────────────────────────────────────────────
MEDIUMscripts/validate_docs.py61# ── 2. SUMMARY.md links ───────────────────────────────────────────────────────
MEDIUMscripts/validate_docs.py89# ── 3. Relative links inside markdown files ───────────────────────────────────
MEDIUMscripts/validate_docs.py115# ── main ─────────────────────────────────────────────────────────────────────
Redundant / Tautological Comments5 hits · 8 pts
SeverityFileLineSnippet
LOWtools/generate_patches.sh103 # Check if the diff is empty
LOWllama.cpp.patches/apply-patches.sh13# Check if status is dirty, if so, exit
LOWtests/integration/tests/test_tool_calling.py73 # Check if model made a tool call
LOWwhisper.cpp.patches/apply-patches.sh13# Check if status is dirty, if so, exit
LOWstable-diffusion.cpp.patches/apply-patches.sh13# Check if status is dirty, if so, exit
Example Usage Blocks5 hits · 8 pts
SeverityFileLineSnippet
LOWtests/integration/run_tests.sh4# Usage:
LOWtests/strsm/build_and_run.sh21# Usage:
LOWllamafile/cuda.sh25# Usage:
LOWllamafile/rocm.sh25# Usage:
LOWllamafile/vulkan.sh21# Usage:
AI Slop Vocabulary2 hits · 6 pts
SeverityFileLineSnippet
MEDIUMlocalscore/nvml.cpp129 // TODO we need a more robust way to import symbols and versions.
MEDIUMthird_party/stb/stb_vorbis.c51// 1.10 - 2017-03-03 - more robust seeking; fix negative ilog(); clear error in open_memory
Deep Nesting5 hits · 5 pts
SeverityFileLineSnippet
LOWtests/integration/tests/test_gpu.py13
LOWtests/integration/tests/test_gpu.py48
LOWtests/integration/utils/llamafile.py19
LOWtests/integration/utils/llamafile.py476
LOWscripts/validate_docs.py94
Excessive Try-Catch Wrapping4 hits · 4 pts
SeverityFileLineSnippet
LOWtests/integration/tests/test_gpu.py27 except Exception:
LOWtests/integration/tests/test_gpu.py38 except Exception:
LOWtests/integration/utils/llamafile.py82 except Exception:
LOWscripts/validate_docs.py44 except Exception:
Self-Referential Comments1 hit · 3 pts
SeverityFileLineSnippet
MEDIUMllamafile/build-functions.sh22# This file contains common functions used by cuda.sh and rocm.sh
Unused Imports2 hits · 2 pts
SeverityFileLineSnippet
LOWscripts/publish_docs.py10
LOWscripts/validate_docs.py14
Slop Phrases2 hits · 2 pts
SeverityFileLineSnippet
LOW.github/ISSUE_TEMPLATE/07-refactor.yml9 Don't forget to [check for existing refactor issue tickets](https://github.com/Mozilla-Ocho/llamafile/issues?q=i
LOW.github/ISSUE_TEMPLATE/06-refactor.yml9 Don't forget to [check for existing refactor issue tickets](https://github.com/Mozilla-Ocho/llamafile/issues?q=i