Repository Analysis

mozilla-ai/llamafile

Distribute and run LLMs with a single file.

3.8 Likely human-written View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of mozilla-ai/llamafile, a C++ project with 25,404 GitHub stars. SynthScan v2.0 examined 186,723 lines of code across 472 source files, recording 683 pattern matches distributed across 15 syntactic categories. The overall adjusted score of 3.8 places this repository in the Likely human-written band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

3.8
Adjusted Score
3.8
Raw Score
100%
Time Factor
2026-07-13
Last Push
25.4K
Stars
C++
Language
186.7K
Lines of Code
472
Files
683
Pattern Hits
2026-07-14
Scan Date
0.01
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 0HIGH 7MEDIUM 9LOW 667

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 683 distinct pattern matches across 15 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Over-Commented Block601 hits · 568 pts
SeverityFileLineSnippetContext
LOWdiffusionfile/diffusionfile.cpp1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-COMMENT
LOWllama.cpp.patches/fetch-ui-assets.sh1#!/bin/bashCOMMENT
LOWllama.cpp.patches/renames.sh1#!/usr/bin/env bashCOMMENT
LOWtranscribefile/cosmo_compat.c1// Cosmopolitan libc compatibility shims for transcribefile.COMMENT
LOWtranscribefile/main.cpp1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-COMMENT
LOWtests/fa_helpers_test.cpp1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-COMMENT
LOWtests/fa_helpers_test.cpp21// These tests compare our AVX-512-optimized llamafile_fa_* helpersCOMMENT
LOWtests/fa_helpers_test.cpp41#include <vector>COMMENT
LOWtests/backend_ops_harness.cpp1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-COMMENT
LOWtests/backend_ops_harness.cpp21// variants included) computed on each registered backend against the CPUCOMMENT
LOWtests/transcribefile_smoke.sh1#!/usr/bin/env bashCOMMENT
LOWtests/extract_data_uris_test.cpp1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-COMMENT
LOWtests/gpu_backend_test.cpp1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-COMMENT
LOWtests/gpu_backend_test.cpp21// The device-count gate exercised here is the fix for issue #988: a backendCOMMENT
LOWtests/integration/run_tests.sh1#!/bin/bashCOMMENT
LOWtests/sgemm/iqk_legacy_test.cpp1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-COMMENT
LOWtests/sgemm/sgemm_test_utils.h1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-COMMENT
LOWtests/sgemm/sgemm_test_utils.h201COMMENT
LOWtests/sgemm/sgemm_vecdot_test.cpp1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-COMMENT
LOWtests/sgemm/sgemm_vecdot_test.cpp21// ============================================================================COMMENT
LOWtests/sgemm/sgemm_vecdot_test.cpp41// - Both implementations tend to perform similarly here since memory isCOMMENT
LOWtests/sgemm/sgemm_vecdot_test.cpp61// - Lower is betterCOMMENT
LOWtests/sgemm/sgemm_matmul_test.cpp1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-COMMENT
LOWtests/sgemm/sgemm_matmul_test.cpp21// ============================================================================COMMENT
LOWtests/sgemm/sgemm_matmul_test.cpp41//COMMENT
LOWtests/sgemm/sgemm_matmul_test.cpp61// Accuracy (ULP = Units in Last Place):COMMENT
LOWtests/sgemm/q8_0_layout_test.cpp1// q8_0_layout_test: Diagnostic for block_q8_0 vs block_q8_0_x4 memory layoutCOMMENT
LOWtests/sgemm/sgemm_sss_test.cpp1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-COMMENT
LOWtests/sgemm/sgemm_sss_test.cpp21// ============================================================================COMMENT
LOWtests/sgemm/sgemm_sss_test.cpp41// - Single-precision accumulationCOMMENT
LOWtests/sgemm/sgemm_sss_test.cpp61// - "ulp average": Mean ULP difference across all output elementsCOMMENT
LOWtests/sgemm/iqk_test.cpp1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-COMMENT
LOWtests/sgemm/iqk_test.cpp21// ============================================================================COMMENT
LOWtests/sgemm/iqk_test.cpp41// - Prompt processing involves large matrix multiplications with these typesCOMMENT
LOWtests/sgemm/iqk_test.cpp61// METRICS:COMMENT
LOWtests/sgemm/iqk_test.cpp81#include "ggml.h"COMMENT
LOWtests/strsm/build_and_run.sh1#!/bin/bashCOMMENT
LOWllamafile/tinyblas_cpu_sgemm_amd_fma.cpp1#ifdef __x86_64__COMMENT
LOWllamafile/cuda.sh1#!/bin/bashCOMMENT
LOWllamafile/cuda.sh21#COMMENT
LOWllamafile/tinyblas_cpu_sgemm_amd_avx2.cpp1#ifdef __x86_64__COMMENT
LOWllamafile/tinyblas_cpu_mixmul_amd_avx2.cpp1#ifdef __x86_64__COMMENT
LOWllamafile/chatbot_file.cpp1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-COMMENT
LOWllamafile/version.h1// -*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-COMMENT
LOWllamafile/version.h21#define LLAMAFILE_MAJOR 0COMMENT
LOWllamafile/xterm.h1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-COMMENT
LOWllamafile/args.cpp1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-COMMENT
LOWllamafile/tinyblas_cpu_mixmul_amd_avx512f.cpp1#ifdef __x86_64__COMMENT
LOWllamafile/image.cpp1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-COMMENT
LOWllamafile/tinyblas_cpu_mixmul_amd_fma.cpp1#ifdef __x86_64__COMMENT
LOWllamafile/datauri.h1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-COMMENT
LOWllamafile/llama.cpp1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-COMMENT
LOWllamafile/zip.c1// -*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-COMMENT
LOWllamafile/fa_helpers_amd_avx512f.cpp1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-COMMENT
LOWllamafile/gpu_backend.h1// -*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-COMMENT
LOWllamafile/gpu_backend.h21#include <stdatomic.h>COMMENT
LOWllamafile/gpu_backend.h101// If the backend reports no usable devices it logs, on desc->tag,COMMENT
LOWllamafile/chatbot_comm.cpp1// -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-COMMENT
LOWllamafile/cuda.c1// -*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-COMMENT
LOWllamafile/cuda.c21//COMMENT
541 more matches not shown…
Hyper-Verbose Identifiers36 hits · 36 pts
SeverityFileLineSnippetContext
LOWtests/integration/tests/test_tool_calling.py88 def test_tool_call_correct_function(self, llamafile, server_port, timeouts):CODE
LOWtests/integration/tests/test_tool_calling.py119 def test_tool_call_with_arguments(self, llamafile, server_port, timeouts):CODE
LOWtests/integration/tests/test_multimodal.py48 def test_cli_multiple_images_with_markers(self, llamafile, mmproj, test_image, timeouts):CODE
LOWtests/integration/tests/test_multimodal.py60 def test_cli_multiple_images_marker_mismatch(self, llamafile, mmproj, test_image, timeouts):CODE
LOWtests/integration/tests/test_multimodal.py124 def test_server_describe_image(self, llamafile, mmproj, test_image, server_port, timeouts):CODE
LOWtests/integration/tests/test_multimodal.py149 def test_server_image_question(self, llamafile, mmproj, test_image, server_port, timeouts):CODE
LOWtests/integration/tests/test_server.py12 def test_server_starts_and_responds(self, llamafile, server_port, timeouts):CODE
LOWtests/integration/tests/test_server.py25 def test_server_chat_completion(self, llamafile, server_port, timeouts):CODE
LOWtests/integration/tests/test_server.py50 def test_server_chat_completion_math(self, llamafile, server_port, timeouts):CODE
LOWtests/integration/tests/test_server.py81 def test_server_with_temperature_zero(self, llamafile, server_port, timeouts):CODE
LOWtests/integration/tests/test_server.py127 def test_server_with_max_tokens(self, llamafile, server_port, timeouts):CODE
LOWtests/integration/tests/test_ssl.py127 def test_https_server_rejects_plaintext(CODE
LOWtests/integration/tests/test_ssl.py153 def test_download_model_over_https(CODE
LOWtests/integration/tests/test_ssl.py193 def test_download_rejects_untrusted_cert(CODE
LOWtests/integration/tests/test_combined.py14 def test_combined_server_responds(self, llamafile, server_port, timeouts):CODE
LOWtests/integration/tests/test_combined.py36 def test_combined_tui_and_server_simultaneously(self, llamafile, server_port, timeouts):CODE
LOWtests/integration/tests/test_cli.py48 def test_nothink_removes_thinking(self, llamafile, timeouts):CODE
LOWtests/integration/tests/test_cli.py59 def test_nothink_shorter_output(self, llamafile, timeouts):CODE
LOWtests/integration/tests/test_help.py90 def test_help_mentions_llamafile(self, executable, mode_args):CODE
LOWtests/integration/tests/test_help.py103 def test_help_lists_llamafile_flags(self, executable, mode_args):CODE
LOWtests/integration/tests/test_help.py127 def test_help_lists_sampling_and_common_args(self, executable, mode_args):CODE
LOWtests/integration/tests/test_help.py156 def test_missing_model_exits_nonzero(self, executable):CODE
LOWtests/integration/tests/test_help.py161 def test_missing_model_mention_help(self, executable):CODE
LOWtests/integration/tests/test_tui.py10 def test_tui_responds_to_hello(self, llamafile, tmp_path, timeouts):CODE
LOWtests/integration/tests/test_tui.py58 def test_tui_thinking_visible(self, llamafile, tmp_path, timeouts):CODE
LOWtests/integration/utils/llamafile.py476 def chat_completion_streaming(CODE
LOWtests/integration/utils/llamafile.py554 def chat_completion_with_image(CODE
LOWtests/docs/test_github_pages_redirects.py12def load_redirect_generator_module():CODE
LOWtests/docs/test_github_pages_redirects.py41 def test_generate_github_pages_redirects(self) -> None:CODE
LOWtests/docs/test_github_pages_redirects.py72 def test_serialize_json_for_script_escapes_html_sensitive_characters(self) -> None:CODE
LOWtests/docs/test_github_pages_redirects.py84 def test_build_redirect_site_replaces_existing_output_and_skips_missing_images(self) -> None:CODE
LOWtests/docs/test_github_pages_redirects.py101 def test_parse_args_and_main_success(self) -> None:CODE
LOWtests/docs/test_github_pages_redirects.py133 def test_main_returns_error_for_missing_source(self) -> None:CODE
LOWtests/docs/test_github_pages_redirects.py151 def test_script_entrypoint_exits_with_main_status(self) -> None:CODE
LOWscripts/generate_github_pages_redirects.py65def normalize_pages_base_path(pages_base_path: str) -> str:CODE
LOWscripts/generate_github_pages_redirects.py123def serialize_json_for_script(value: object, *, sort_keys: bool = False) -> str:CODE
Synthetic Comment Markers4 hits · 30 pts
SeverityFileLineSnippetContext
HIGHthird_party/mbedtls/error.c88 /* Begin Auto-Generated Code. */COMMENT
HIGHthird_party/mbedtls/error.c422 /* End Auto-Generated Code. */COMMENT
HIGHthird_party/mbedtls/error.c443 /* Begin Auto-Generated Code. */COMMENT
HIGHthird_party/mbedtls/error.c634 /* End Auto-Generated Code. */COMMENT
Decorative Section Separators6 hits · 18 pts
SeverityFileLineSnippetContext
MEDIUMllamafile/tinyblas_cpu.h25// ╚═╝ ╚═╝╚═╝ ╚═╝ ╚══╝ ╚═════╝ ╚═══╝╚═╝ ╚═╝╚═════╝COMMENT
MEDIUMscripts/validate_docs.py22# ── helpers ──────────────────────────────────────────────────────────────────COMMENT
MEDIUMscripts/validate_docs.py32# ── 1. .gitbook.yaml ─────────────────────────────────────────────────────────COMMENT
MEDIUMscripts/validate_docs.py61# ── 2. SUMMARY.md links ───────────────────────────────────────────────────────COMMENT
MEDIUMscripts/validate_docs.py89# ── 3. Relative links inside markdown files ───────────────────────────────────COMMENT
MEDIUMscripts/validate_docs.py115# ── main ─────────────────────────────────────────────────────────────────────COMMENT
Cross-Language Confusion3 hits · 15 pts
SeverityFileLineSnippetContext
HIGHscripts/generate_github_pages_redirects.py150 window.location.replace(target.toString());CODE
HIGHscripts/generate_github_pages_redirects.py198 const destination = redirectTargets[route] || docsBaseUrl.toString();CODE
HIGHscripts/generate_github_pages_redirects.py202 window.location.replace(target.toString());CODE
Redundant / Tautological Comments6 hits · 9 pts
SeverityFileLineSnippetContext
LOWtools/generate_patches.sh103 # Check if the diff is emptyCOMMENT
LOWllama.cpp.patches/apply-patches.sh13# Check if status is dirty, if so, exitCOMMENT
LOWtests/integration/tests/test_tool_calling.py73 # Check if model made a tool callCOMMENT
LOWllamafile/release.sh16# Check if make install actually created ZIP_DIRCOMMENT
LOWwhisper.cpp.patches/apply-patches.sh13# Check if status is dirty, if so, exitCOMMENT
LOWstable-diffusion.cpp.patches/apply-patches.sh13# Check if status is dirty, if so, exitCOMMENT
Example Usage Blocks6 hits · 9 pts
SeverityFileLineSnippetContext
LOWtests/transcribefile_smoke.sh15# Usage:COMMENT
LOWtests/integration/run_tests.sh4# Usage:COMMENT
LOWtests/strsm/build_and_run.sh21# Usage:COMMENT
LOWllamafile/cuda.sh25# Usage:COMMENT
LOWllamafile/rocm.sh25# Usage:COMMENT
LOWllamafile/vulkan.sh21# Usage:COMMENT
AI Slop Vocabulary2 hits · 6 pts
SeverityFileLineSnippetContext
MEDIUMlocalscore/nvml.cpp129 // TODO we need a more robust way to import symbols and versions.COMMENT
MEDIUMthird_party/stb/stb_vorbis.c51// 1.10 - 2017-03-03 - more robust seeking; fix negative ilog(); clear error in open_memoryCOMMENT
Deep Nesting5 hits · 5 pts
SeverityFileLineSnippetContext
LOWtests/integration/tests/test_gpu.py13CODE
LOWtests/integration/tests/test_gpu.py48CODE
LOWtests/integration/utils/llamafile.py19CODE
LOWtests/integration/utils/llamafile.py476CODE
LOWscripts/validate_docs.py94CODE
Structural Annotation Overuse3 hits · 4 pts
SeverityFileLineSnippetContext
LOWdocs/skills/llamafile/development.md62#### Step 1: Make ChangesCOMMENT
LOWdocs/skills/llamafile/development.md72#### Step 2: Generate PatchesCOMMENT
LOWdocs/skills/llamafile/development.md91#### Step 3: Verify PatchesCOMMENT
Excessive Try-Catch Wrapping4 hits · 4 pts
SeverityFileLineSnippetContext
LOWtests/integration/tests/test_gpu.py27 except Exception:CODE
LOWtests/integration/tests/test_gpu.py38 except Exception:CODE
LOWtests/integration/utils/llamafile.py82 except Exception:CODE
LOWscripts/validate_docs.py44 except Exception:CODE
Self-Referential Comments1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUMllamafile/build-functions.sh22# This file contains common functions used by cuda.sh and rocm.shCOMMENT
Unused Imports3 hits · 3 pts
SeverityFileLineSnippetContext
LOWscripts/publish_docs.py10CODE
LOWscripts/generate_github_pages_redirects.py7CODE
LOWscripts/validate_docs.py14CODE
Slop Phrases2 hits · 2 pts
SeverityFileLineSnippetContext
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=iCODE
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=iCODE
Modern Structural Boilerplate1 hit · 1 pts
SeverityFileLineSnippetContext
LOWtests/integration/utils/llamafile.py16logger = logging.getLogger(__name__)CODE