Distribute and run LLMs with a single file.
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).
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.
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.
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.
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.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | diffusionfile/diffusionfile.cpp | 1 | // -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*- | COMMENT |
| LOW | llama.cpp.patches/fetch-ui-assets.sh | 1 | #!/bin/bash | COMMENT |
| LOW | llama.cpp.patches/renames.sh | 1 | #!/usr/bin/env bash | COMMENT |
| LOW | transcribefile/cosmo_compat.c | 1 | // Cosmopolitan libc compatibility shims for transcribefile. | COMMENT |
| LOW | transcribefile/main.cpp | 1 | // -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*- | COMMENT |
| LOW | tests/fa_helpers_test.cpp | 1 | // -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*- | COMMENT |
| LOW | tests/fa_helpers_test.cpp | 21 | // These tests compare our AVX-512-optimized llamafile_fa_* helpers | COMMENT |
| LOW | tests/fa_helpers_test.cpp | 41 | #include <vector> | COMMENT |
| LOW | tests/backend_ops_harness.cpp | 1 | // -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*- | COMMENT |
| LOW | tests/backend_ops_harness.cpp | 21 | // variants included) computed on each registered backend against the CPU | COMMENT |
| LOW | tests/transcribefile_smoke.sh | 1 | #!/usr/bin/env bash | COMMENT |
| LOW | tests/extract_data_uris_test.cpp | 1 | // -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*- | COMMENT |
| LOW | tests/gpu_backend_test.cpp | 1 | // -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*- | COMMENT |
| LOW | tests/gpu_backend_test.cpp | 21 | // The device-count gate exercised here is the fix for issue #988: a backend | COMMENT |
| LOW | tests/integration/run_tests.sh | 1 | #!/bin/bash | COMMENT |
| LOW | tests/sgemm/iqk_legacy_test.cpp | 1 | // -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*- | COMMENT |
| LOW | tests/sgemm/sgemm_test_utils.h | 1 | // -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*- | COMMENT |
| LOW | tests/sgemm/sgemm_test_utils.h | 201 | COMMENT | |
| LOW | tests/sgemm/sgemm_vecdot_test.cpp | 1 | // -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*- | COMMENT |
| LOW | tests/sgemm/sgemm_vecdot_test.cpp | 21 | // ============================================================================ | COMMENT |
| LOW | tests/sgemm/sgemm_vecdot_test.cpp | 41 | // - Both implementations tend to perform similarly here since memory is | COMMENT |
| LOW | tests/sgemm/sgemm_vecdot_test.cpp | 61 | // - Lower is better | COMMENT |
| LOW | tests/sgemm/sgemm_matmul_test.cpp | 1 | // -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*- | COMMENT |
| LOW | tests/sgemm/sgemm_matmul_test.cpp | 21 | // ============================================================================ | COMMENT |
| LOW | tests/sgemm/sgemm_matmul_test.cpp | 41 | // | COMMENT |
| LOW | tests/sgemm/sgemm_matmul_test.cpp | 61 | // Accuracy (ULP = Units in Last Place): | COMMENT |
| LOW | tests/sgemm/q8_0_layout_test.cpp | 1 | // q8_0_layout_test: Diagnostic for block_q8_0 vs block_q8_0_x4 memory layout | COMMENT |
| LOW | tests/sgemm/sgemm_sss_test.cpp | 1 | // -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*- | COMMENT |
| LOW | tests/sgemm/sgemm_sss_test.cpp | 21 | // ============================================================================ | COMMENT |
| LOW | tests/sgemm/sgemm_sss_test.cpp | 41 | // - Single-precision accumulation | COMMENT |
| LOW | tests/sgemm/sgemm_sss_test.cpp | 61 | // - "ulp average": Mean ULP difference across all output elements | COMMENT |
| LOW | tests/sgemm/iqk_test.cpp | 1 | // -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*- | COMMENT |
| LOW | tests/sgemm/iqk_test.cpp | 21 | // ============================================================================ | COMMENT |
| LOW | tests/sgemm/iqk_test.cpp | 41 | // - Prompt processing involves large matrix multiplications with these types | COMMENT |
| LOW | tests/sgemm/iqk_test.cpp | 61 | // METRICS: | COMMENT |
| LOW | tests/sgemm/iqk_test.cpp | 81 | #include "ggml.h" | COMMENT |
| LOW | tests/strsm/build_and_run.sh | 1 | #!/bin/bash | COMMENT |
| LOW | llamafile/tinyblas_cpu_sgemm_amd_fma.cpp | 1 | #ifdef __x86_64__ | COMMENT |
| LOW | llamafile/cuda.sh | 1 | #!/bin/bash | COMMENT |
| LOW | llamafile/cuda.sh | 21 | # | COMMENT |
| LOW | llamafile/tinyblas_cpu_sgemm_amd_avx2.cpp | 1 | #ifdef __x86_64__ | COMMENT |
| LOW | llamafile/tinyblas_cpu_mixmul_amd_avx2.cpp | 1 | #ifdef __x86_64__ | COMMENT |
| LOW | llamafile/chatbot_file.cpp | 1 | // -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*- | COMMENT |
| LOW | llamafile/version.h | 1 | // -*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*- | COMMENT |
| LOW | llamafile/version.h | 21 | #define LLAMAFILE_MAJOR 0 | COMMENT |
| LOW | llamafile/xterm.h | 1 | // -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*- | COMMENT |
| LOW | llamafile/args.cpp | 1 | // -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*- | COMMENT |
| LOW | llamafile/tinyblas_cpu_mixmul_amd_avx512f.cpp | 1 | #ifdef __x86_64__ | COMMENT |
| LOW | llamafile/image.cpp | 1 | // -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*- | COMMENT |
| LOW | llamafile/tinyblas_cpu_mixmul_amd_fma.cpp | 1 | #ifdef __x86_64__ | COMMENT |
| LOW | llamafile/datauri.h | 1 | // -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*- | COMMENT |
| LOW | llamafile/llama.cpp | 1 | // -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*- | COMMENT |
| LOW | llamafile/zip.c | 1 | // -*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*- | COMMENT |
| LOW | llamafile/fa_helpers_amd_avx512f.cpp | 1 | // -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*- | COMMENT |
| LOW | llamafile/gpu_backend.h | 1 | // -*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*- | COMMENT |
| LOW | llamafile/gpu_backend.h | 21 | #include <stdatomic.h> | COMMENT |
| LOW | llamafile/gpu_backend.h | 101 | // If the backend reports no usable devices it logs, on desc->tag, | COMMENT |
| LOW | llamafile/chatbot_comm.cpp | 1 | // -*- mode:c++;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*- | COMMENT |
| LOW | llamafile/cuda.c | 1 | // -*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*- | COMMENT |
| LOW | llamafile/cuda.c | 21 | // | COMMENT |
| 541 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/integration/tests/test_tool_calling.py | 88 | def test_tool_call_correct_function(self, llamafile, server_port, timeouts): | CODE |
| LOW | tests/integration/tests/test_tool_calling.py | 119 | def test_tool_call_with_arguments(self, llamafile, server_port, timeouts): | CODE |
| LOW | tests/integration/tests/test_multimodal.py | 48 | def test_cli_multiple_images_with_markers(self, llamafile, mmproj, test_image, timeouts): | CODE |
| LOW | tests/integration/tests/test_multimodal.py | 60 | def test_cli_multiple_images_marker_mismatch(self, llamafile, mmproj, test_image, timeouts): | CODE |
| LOW | tests/integration/tests/test_multimodal.py | 124 | def test_server_describe_image(self, llamafile, mmproj, test_image, server_port, timeouts): | CODE |
| LOW | tests/integration/tests/test_multimodal.py | 149 | def test_server_image_question(self, llamafile, mmproj, test_image, server_port, timeouts): | CODE |
| LOW | tests/integration/tests/test_server.py | 12 | def test_server_starts_and_responds(self, llamafile, server_port, timeouts): | CODE |
| LOW | tests/integration/tests/test_server.py | 25 | def test_server_chat_completion(self, llamafile, server_port, timeouts): | CODE |
| LOW | tests/integration/tests/test_server.py | 50 | def test_server_chat_completion_math(self, llamafile, server_port, timeouts): | CODE |
| LOW | tests/integration/tests/test_server.py | 81 | def test_server_with_temperature_zero(self, llamafile, server_port, timeouts): | CODE |
| LOW | tests/integration/tests/test_server.py | 127 | def test_server_with_max_tokens(self, llamafile, server_port, timeouts): | CODE |
| LOW | tests/integration/tests/test_ssl.py | 127 | def test_https_server_rejects_plaintext( | CODE |
| LOW | tests/integration/tests/test_ssl.py | 153 | def test_download_model_over_https( | CODE |
| LOW | tests/integration/tests/test_ssl.py | 193 | def test_download_rejects_untrusted_cert( | CODE |
| LOW | tests/integration/tests/test_combined.py | 14 | def test_combined_server_responds(self, llamafile, server_port, timeouts): | CODE |
| LOW | tests/integration/tests/test_combined.py | 36 | def test_combined_tui_and_server_simultaneously(self, llamafile, server_port, timeouts): | CODE |
| LOW | tests/integration/tests/test_cli.py | 48 | def test_nothink_removes_thinking(self, llamafile, timeouts): | CODE |
| LOW | tests/integration/tests/test_cli.py | 59 | def test_nothink_shorter_output(self, llamafile, timeouts): | CODE |
| LOW | tests/integration/tests/test_help.py | 90 | def test_help_mentions_llamafile(self, executable, mode_args): | CODE |
| LOW | tests/integration/tests/test_help.py | 103 | def test_help_lists_llamafile_flags(self, executable, mode_args): | CODE |
| LOW | tests/integration/tests/test_help.py | 127 | def test_help_lists_sampling_and_common_args(self, executable, mode_args): | CODE |
| LOW | tests/integration/tests/test_help.py | 156 | def test_missing_model_exits_nonzero(self, executable): | CODE |
| LOW | tests/integration/tests/test_help.py | 161 | def test_missing_model_mention_help(self, executable): | CODE |
| LOW | tests/integration/tests/test_tui.py | 10 | def test_tui_responds_to_hello(self, llamafile, tmp_path, timeouts): | CODE |
| LOW | tests/integration/tests/test_tui.py | 58 | def test_tui_thinking_visible(self, llamafile, tmp_path, timeouts): | CODE |
| LOW | tests/integration/utils/llamafile.py | 476 | def chat_completion_streaming( | CODE |
| LOW | tests/integration/utils/llamafile.py | 554 | def chat_completion_with_image( | CODE |
| LOW | tests/docs/test_github_pages_redirects.py | 12 | def load_redirect_generator_module(): | CODE |
| LOW | tests/docs/test_github_pages_redirects.py | 41 | def test_generate_github_pages_redirects(self) -> None: | CODE |
| LOW | tests/docs/test_github_pages_redirects.py | 72 | def test_serialize_json_for_script_escapes_html_sensitive_characters(self) -> None: | CODE |
| LOW | tests/docs/test_github_pages_redirects.py | 84 | def test_build_redirect_site_replaces_existing_output_and_skips_missing_images(self) -> None: | CODE |
| LOW | tests/docs/test_github_pages_redirects.py | 101 | def test_parse_args_and_main_success(self) -> None: | CODE |
| LOW | tests/docs/test_github_pages_redirects.py | 133 | def test_main_returns_error_for_missing_source(self) -> None: | CODE |
| LOW | tests/docs/test_github_pages_redirects.py | 151 | def test_script_entrypoint_exits_with_main_status(self) -> None: | CODE |
| LOW | scripts/generate_github_pages_redirects.py | 65 | def normalize_pages_base_path(pages_base_path: str) -> str: | CODE |
| LOW | scripts/generate_github_pages_redirects.py | 123 | def serialize_json_for_script(value: object, *, sort_keys: bool = False) -> str: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | third_party/mbedtls/error.c | 88 | /* Begin Auto-Generated Code. */ | COMMENT |
| HIGH | third_party/mbedtls/error.c | 422 | /* End Auto-Generated Code. */ | COMMENT |
| HIGH | third_party/mbedtls/error.c | 443 | /* Begin Auto-Generated Code. */ | COMMENT |
| HIGH | third_party/mbedtls/error.c | 634 | /* End Auto-Generated Code. */ | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | llamafile/tinyblas_cpu.h | 25 | // ╚═╝ ╚═╝╚═╝ ╚═╝ ╚══╝ ╚═════╝ ╚═══╝╚═╝ ╚═╝╚═════╝ | COMMENT |
| MEDIUM | scripts/validate_docs.py | 22 | # ── helpers ────────────────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | scripts/validate_docs.py | 32 | # ── 1. .gitbook.yaml ───────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | scripts/validate_docs.py | 61 | # ── 2. SUMMARY.md links ─────────────────────────────────────────────────────── | COMMENT |
| MEDIUM | scripts/validate_docs.py | 89 | # ── 3. Relative links inside markdown files ─────────────────────────────────── | COMMENT |
| MEDIUM | scripts/validate_docs.py | 115 | # ── main ───────────────────────────────────────────────────────────────────── | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | scripts/generate_github_pages_redirects.py | 150 | window.location.replace(target.toString()); | CODE |
| HIGH | scripts/generate_github_pages_redirects.py | 198 | const destination = redirectTargets[route] || docsBaseUrl.toString(); | CODE |
| HIGH | scripts/generate_github_pages_redirects.py | 202 | window.location.replace(target.toString()); | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tools/generate_patches.sh | 103 | # Check if the diff is empty | COMMENT |
| LOW | llama.cpp.patches/apply-patches.sh | 13 | # Check if status is dirty, if so, exit | COMMENT |
| LOW | tests/integration/tests/test_tool_calling.py | 73 | # Check if model made a tool call | COMMENT |
| LOW | llamafile/release.sh | 16 | # Check if make install actually created ZIP_DIR | COMMENT |
| LOW | whisper.cpp.patches/apply-patches.sh | 13 | # Check if status is dirty, if so, exit | COMMENT |
| LOW | stable-diffusion.cpp.patches/apply-patches.sh | 13 | # Check if status is dirty, if so, exit | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/transcribefile_smoke.sh | 15 | # Usage: | COMMENT |
| LOW | tests/integration/run_tests.sh | 4 | # Usage: | COMMENT |
| LOW | tests/strsm/build_and_run.sh | 21 | # Usage: | COMMENT |
| LOW | llamafile/cuda.sh | 25 | # Usage: | COMMENT |
| LOW | llamafile/rocm.sh | 25 | # Usage: | COMMENT |
| LOW | llamafile/vulkan.sh | 21 | # Usage: | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | localscore/nvml.cpp | 129 | // TODO we need a more robust way to import symbols and versions. | COMMENT |
| MEDIUM | third_party/stb/stb_vorbis.c | 51 | // 1.10 - 2017-03-03 - more robust seeking; fix negative ilog(); clear error in open_memory | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/integration/tests/test_gpu.py | 13 | CODE | |
| LOW | tests/integration/tests/test_gpu.py | 48 | CODE | |
| LOW | tests/integration/utils/llamafile.py | 19 | CODE | |
| LOW | tests/integration/utils/llamafile.py | 476 | CODE | |
| LOW | scripts/validate_docs.py | 94 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | docs/skills/llamafile/development.md | 62 | #### Step 1: Make Changes | COMMENT |
| LOW | docs/skills/llamafile/development.md | 72 | #### Step 2: Generate Patches | COMMENT |
| LOW | docs/skills/llamafile/development.md | 91 | #### Step 3: Verify Patches | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/integration/tests/test_gpu.py | 27 | except Exception: | CODE |
| LOW | tests/integration/tests/test_gpu.py | 38 | except Exception: | CODE |
| LOW | tests/integration/utils/llamafile.py | 82 | except Exception: | CODE |
| LOW | scripts/validate_docs.py | 44 | except Exception: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | llamafile/build-functions.sh | 22 | # This file contains common functions used by cuda.sh and rocm.sh | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | scripts/publish_docs.py | 10 | CODE | |
| LOW | scripts/generate_github_pages_redirects.py | 7 | CODE | |
| LOW | scripts/validate_docs.py | 14 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | .github/ISSUE_TEMPLATE/07-refactor.yml | 9 | Don't forget to [check for existing refactor issue tickets](https://github.com/Mozilla-Ocho/llamafile/issues?q=i | CODE |
| LOW | .github/ISSUE_TEMPLATE/06-refactor.yml | 9 | Don't forget to [check for existing refactor issue tickets](https://github.com/Mozilla-Ocho/llamafile/issues?q=i | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/integration/utils/llamafile.py | 16 | logger = logging.getLogger(__name__) | CODE |