Repository Analysis

lyogavin/airllm

AirLLM 70B inference with single 4GB GPU

19.4 Moderate AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of lyogavin/airllm, a Jupyter Notebook project with 22,559 GitHub stars. SynthScan v2.0 examined 8,170 lines of code across 49 source files, recording 132 pattern matches distributed across 9 syntactic categories. The overall adjusted score of 19.4 places this repository in the Moderate AI signal 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).

19.4
Adjusted Score
19.4
Raw Score
100%
Time Factor
2026-07-12
Last Push
22.6K
Stars
Jupyter Notebook
Language
8.2K
Lines of Code
49
Files
132
Pattern Hits
2026-07-14
Scan Date
0.12
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 6MEDIUM 3LOW 123

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 132 distinct pattern matches across 9 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.

Unused Imports52 hits · 52 pts
SeverityFileLineSnippetContext
LOWtraining/qlora.py4CODE
LOWair_llm/tests/test_automodel.py1CODE
LOWair_llm/airllm/__init__.py9CODE
LOWair_llm/airllm/__init__.py10CODE
LOWair_llm/airllm/__init__.py14CODE
LOWair_llm/airllm/__init__.py15CODE
LOWair_llm/airllm/__init__.py16CODE
LOWair_llm/airllm/__init__.py17CODE
LOWair_llm/airllm/airllm_base.py2CODE
LOWair_llm/airllm/airllm_base.py2CODE
LOWair_llm/airllm/airllm_base.py2CODE
LOWair_llm/airllm/airllm_base.py2CODE
LOWair_llm/airllm/airllm_base.py3CODE
LOWair_llm/airllm/airllm_base.py4CODE
LOWair_llm/airllm/airllm_base.py20CODE
LOWair_llm/airllm/airllm_qwen2.py2CODE
LOWair_llm/airllm/utils.py11CODE
LOWair_llm/airllm/utils.py11CODE
LOWair_llm/airllm/utils.py12CODE
LOWair_llm/airllm/utils.py12CODE
LOWair_llm/airllm/utils.py12CODE
LOWair_llm/airllm/utils.py12CODE
LOWair_llm/airllm/utils.py12CODE
LOWair_llm/airllm/utils.py22CODE
LOWair_llm/airllm/utils.py23CODE
LOWair_llm/airllm/airllm_llama_mlx.py2CODE
LOWair_llm/airllm/airllm_llama_mlx.py3CODE
LOWair_llm/airllm/airllm_llama_mlx.py4CODE
LOWair_llm/airllm/airllm_llama_mlx.py8CODE
LOWair_llm/airllm/airllm_llama_mlx.py13CODE
LOWair_llm/airllm/airllm_llama_mlx.py16CODE
LOWair_llm/airllm/airllm_llama_mlx.py16CODE
LOWair_llm/airllm/airllm_llama_mlx.py16CODE
LOWair_llm/airllm/airllm_llama_mlx.py16CODE
LOWair_llm/airllm/airllm_llama_mlx.py16CODE
LOWair_llm/airllm/airllm_llama_mlx.py17CODE
LOWair_llm/airllm/airllm_llama_mlx.py17CODE
LOWair_llm/airllm/persist/__init__.py1CODE
LOWair_llm/airllm/persist/mlx_model_persister.py10CODE
LOWair_llm/airllm/persist/mlx_model_persister.py12CODE
LOWrlhf/qlora_dpo.py4CODE
LOWrlhf/qlora_dpo.py5CODE
LOWrlhf/qlora_dpo.py13CODE
LOWrlhf/qlora_dpo.py43CODE
LOWrlhf/qlora_dpo.py43CODE
LOWrlhf/qlora_dpo.py43CODE
LOWscripts/test_cn_dataset_lenghts.py3CODE
LOWanima_100k/longer_training.py4CODE
LOWanima_100k/longer_training.py22CODE
LOWanima_100k/modeling_flash_llama.py21CODE
LOWanima_100k/modeling_flash_llama.py38CODE
LOWanima_100k/modeling_flash_llama.py38CODE
Hyper-Verbose Identifiers32 hits · 32 pts
SeverityFileLineSnippetContext
LOWtraining/qlora.py381def print_trainable_parameters(args, model):CODE
LOWtraining/qlora.py398def smart_tokenizer_and_embedding_resize(CODE
LOWtraining/qlora.py473def extract_unnatural_instructions_data(examples, extract_reformulations=False):CODE
LOWair_llm/tests/test_compression.py18 def test_should_compress_uncompress(self):CODE
LOWair_llm/tests/test_automodel.py16 def test_auto_model_should_return_correct_model(self):CODE
LOWair_llm/airllm/airllm_chatglm.py16 def get_use_better_transformer(self):CODE
LOWair_llm/airllm/airllm_chatglm.py25 def get_past_key_values_cache_seq_len(self, past_key_values):CODE
LOWair_llm/airllm/airllm_internlm.py16 def get_use_better_transformer(self):CODE
LOWair_llm/airllm/airllm_qwen.py16 def get_use_better_transformer(self):CODE
LOWair_llm/airllm/airllm_qwen.py22 def get_past_key_values_cache_seq_len(self, past_key_values):CODE
LOWair_llm/airllm/airllm_baichuan.py18 def get_use_better_transformer(self):CODE
LOWair_llm/airllm/airllm_base.py234 def set_layers_from_layer_names(self):CODE
LOWair_llm/airllm/airllm_base.py307 def _param_names_from_state_dict(self, state_dict):CODE
LOWair_llm/airllm/airllm_mistral.py16 def get_use_better_transformer(self):CODE
LOWair_llm/airllm/airllm_qwen2.py17 def get_use_better_transformer(self):CODE
LOWair_llm/airllm/utils.py85def uncompress_layer_state_dict(layer_state_dict):CODE
LOWair_llm/airllm/utils.py157def compress_layer_state_dict(layer_state_dict, compression=None):CODE
LOWair_llm/airllm/utils.py178def remove_real_and_linked_file(to_delete):CODE
LOWair_llm/airllm/utils.py372def find_or_create_local_splitted_path(model_local_path_or_repo_id, layer_shards_saving_path=None, compression=None,CODE
LOWair_llm/airllm/tokenization_baichuan.py172 def build_inputs_with_special_tokens(self, token_ids_0, token_ids_1=None):CODE
LOWair_llm/airllm/tokenization_baichuan.py220 def create_token_type_ids_from_sequences(CODE
LOWair_llm/airllm/airllm_mixtral.py16 def get_use_better_transformer(self):CODE
LOWair_llm/airllm/airllm_llama_mlx.py53def get_model_args_from_config(config):CODE
LOWrlhf/qlora_dpo.py429def print_trainable_parameters(args, model):CODE
LOWrlhf/qlora_dpo.py446def smart_tokenizer_and_embedding_resize(CODE
LOWrlhf/qlora_dpo.py516def extract_unnatural_instructions_data(examples, extract_reformulations=False):CODE
LOWanima_100k/longer_training.py99def get_sample_gen_test_examples():CODE
LOWanima_100k/longer_training.py454def print_trainable_parameters(args, model):CODE
LOWanima_100k/longer_training.py471def smart_tokenizer_and_embedding_resize(CODE
LOWanima_100k/longer_training.py546def extract_unnatural_instructions_data(examples, extract_reformulations=False):CODE
LOWanima_100k/modeling_flash_llama.py523 def _set_gradient_checkpointing(self, module, value=False):STRING
LOWanima_100k/modeling_flash_llama.py878 def prepare_inputs_for_generation(CODE
Cross-File Repetition6 hits · 30 pts
SeverityFileLineSnippetContext
HIGHtraining/qlora.py0prints the number of trainable parameters in the model.STRING
HIGHrlhf/qlora_dpo.py0prints the number of trainable parameters in the model.STRING
HIGHanima_100k/longer_training.py0prints the number of trainable parameters in the model.STRING
HIGHtraining/qlora.py0resize tokenizer and embedding. note: this is the unoptimized version that may make your embedding size not be divisibleSTRING
HIGHrlhf/qlora_dpo.py0resize tokenizer and embedding. note: this is the unoptimized version that may make your embedding size not be divisibleSTRING
HIGHanima_100k/longer_training.py0resize tokenizer and embedding. note: this is the unoptimized version that may make your embedding size not be divisibleSTRING
Deep Nesting19 hits · 19 pts
SeverityFileLineSnippetContext
LOWtraining/qlora.py306CODE
LOWtraining/qlora.py473CODE
LOWtraining/qlora.py510CODE
LOWtraining/qlora.py525CODE
LOWtraining/qlora.py549CODE
LOWtraining/qlora.py579CODE
LOWair_llm/tests/test_compression.py18CODE
LOWair_llm/airllm/utils.py85CODE
LOWair_llm/airllm/utils.py188CODE
LOWrlhf/qlora_dpo.py354CODE
LOWrlhf/qlora_dpo.py516CODE
LOWrlhf/qlora_dpo.py553CODE
LOWanima_100k/longer_training.py83CODE
LOWanima_100k/longer_training.py368CODE
LOWanima_100k/longer_training.py546CODE
LOWanima_100k/longer_training.py583CODE
LOWanima_100k/longer_training.py598CODE
LOWanima_100k/longer_training.py627CODE
LOWanima_100k/modeling_flash_llama.py948CODE
Excessive Try-Catch Wrapping10 hits · 12 pts
SeverityFileLineSnippetContext
LOWair_llm/airllm/__init__.py38 except Exception as _e: # noqa: BLE001 - optional family, keep package importableCODE
LOWair_llm/airllm/airllm_base.py117 except Exception:CODE
LOWair_llm/airllm/airllm_base.py167 except Exception:CODE
MEDIUMair_llm/airllm/airllm_base.py164def get_generation_config(self):CODE
LOWair_llm/airllm/utils.py79 except Exception as ex:CODE
LOWair_llm/airllm/persist/mlx_model_persister.py111 except Exception as ex:CODE
MEDIUMair_llm/airllm/persist/mlx_model_persister.py91def load_model(self, layer_name, path):CODE
LOWrlhf/qlora_dpo.py588 except Exception:CODE
LOWrlhf/qlora_dpo.py733 except Exception as e:CODE
LOWanima_100k/longer_training.py95 except Exception as e:CODE
AI Structural Patterns6 hits · 6 pts
SeverityFileLineSnippetContext
LOWair_llm/airllm/airllm_base.py50CODE
LOWair_llm/airllm/tokenization_baichuan.py57CODE
LOWair_llm/airllm/airllm_llama_mlx.py210CODE
LOWanima_100k/modeling_flash_llama.py624CODE
LOWanima_100k/modeling_flash_llama.py772CODE
LOWanima_100k/modeling_flash_llama.py948CODE
Modern Structural Boilerplate3 hits · 3 pts
SeverityFileLineSnippetContext
LOWtraining/qlora.py60logger = logging.getLogger(__name__)CODE
LOWrlhf/qlora_dpo.py62logger = logging.getLogger(__name__)CODE
LOWanima_100k/longer_training.py60logger = logging.getLogger(__name__)CODE
Over-Commented Block3 hits · 3 pts
SeverityFileLineSnippetContext
LOWair_llm/airllm/tokenization_baichuan.py1# Copyright 2023 Baichuan Inc. All Rights Reserved.COMMENT
LOW.github/workflows/release.yml1name: Publish to PyPICOMMENT
LOWanima_100k/modeling_flash_llama.py1# coding=utf-8COMMENT
Slop Phrases1 hit · 2 pts
SeverityFileLineSnippetContext
MEDIUManima_100k/extened_longchat_topiced_conversations.json1[{"TOPIC_ID": 1, "TOPIC": "The psychology of happiness", "CONVERSATION": "USER: I would like to discuss the topic of theCODE