Repository Analysis

simonw/llm

Access large language models from the command-line

11.9 Low AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of simonw/llm, a Python project with 12,184 GitHub stars. SynthScan v2.0 examined 40,029 lines of code across 106 source files, recording 490 pattern matches distributed across 12 syntactic categories. The overall adjusted score of 11.9 places this repository in the Low 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).

11.9
Adjusted Score
11.9
Raw Score
100%
Time Factor
2026-07-09
Last Push
12.2K
Stars
Python
Language
40.0K
Lines of Code
106
Files
490
Pattern Hits
2026-07-14
Scan Date
0.05
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 5MEDIUM 8LOW 477

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 490 distinct pattern matches across 12 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.

Hyper-Verbose Identifiers391 hits · 348 pts
SeverityFileLineSnippetContext
LOWllm/hookspecs.py19def register_embedding_models(register):CODE
LOWllm/hookspecs.py24def register_template_loaders(register):CODE
LOWllm/hookspecs.py29def register_fragment_loaders(register):CODE
LOWllm/models.py187def _get_arguments_input_schema(function, name):CODE
LOWllm/models.py216def _implementation_arguments(tool: "Tool", tool_call: "ToolCall") -> dict:CODE
LOWllm/models.py2632def _append_tool_results_to_chain(chain, tool_results, attachments) -> List[Any]:CODE
LOWllm/models.py2684def _trailing_pending_tool_calls(messages) -> List[ToolCall]:CODE
LOWllm/models.py3441def _remove_titles_recursively(obj):CODE
LOWllm/__init__.py234def get_embedding_models_with_aliases() -> List["EmbeddingModelWithAliases"]:CODE
LOWllm/__init__.py276def get_embedding_model_aliases() -> Dict[str, EmbeddingModel]:CODE
LOWllm/__init__.py498def get_default_embedding_model():CODE
LOWllm/__init__.py502def set_default_embedding_model(model):CODE
LOWllm/embeddings.py173 def embed_multi_with_metadata(CODE
LOWllm/cli.py111async def display_async_stream_events(events, *, show_reasoning=True):CODE
LOWllm/cli.py206def process_fragments_in_chat(CODE
LOWllm/cli.py297def resolve_attachment_with_type(value: str, mimetype: str) -> Attachment:CODE
LOWllm/cli.py313def attachment_types_callback(ctx, param, values) -> List[Attachment]:CODE
LOWllm/cli.py2072 def _format_tool_call_arguments(arguments):STRING
LOWllm/cli.py2349def model_matches_id_or_alias(model_with_aliases, model_ids):STRING
LOWllm/cli.py2356def render_model_with_aliases(STRING
LOWllm/cli.py2424def render_model_with_options(model_id, *, async_=False):STRING
LOWllm/utils.py182def extract_fenced_code_block(text: str, last: bool = False) -> Optional[str]:CODE
LOWllm/default_plugins/openai_models.py382def register_embedding_models(register):CODE
LOWllm/default_plugins/openai_models.py1409 def _reasoning_text_from_item(self, item):CODE
LOWtests/test_cli_openai_models.py46def test_openai_options_min_max():CODE
LOWtests/test_cli_openai_models.py205def test_openai_image_detail_option_description(model_id, expected_description):CODE
LOWtests/test_cli_openai_models.py210def test_openai_image_detail_option_is_sent_on_image_attachments(httpx_mock):CODE
LOWtests/test_cli_openai_models.py357def test_openai_image_detail_original_is_rejected_for_other_models():CODE
LOWtests/test_async_parity.py16def test_echo_registered_for_both():CODE
LOWtests/test_async_parity.py25async def test_async_to_dict_captures_chain_and_output():CODE
LOWtests/test_async_parity.py39async def test_async_to_dict_raises_before_awaited():CODE
LOWtests/test_async_parity.py47async def test_async_from_dict_rehydrates():CODE
LOWtests/test_async_parity.py65async def test_async_from_dict_then_reply_continues():CODE
LOWtests/test_async_parity.py89async def test_async_from_row_response_messages_synthesized(tmp_path):CODE
LOWtests/test_async_parity.py121async def test_async_load_conversation_follow_up_preserves_chain(tmp_path):CODE
LOWtests/test_async_parity.py172async def test_sync_and_async_produce_identical_chain():CODE
LOWtests/test_async_parity.py191async def test_async_chain_tool_result_turn_has_full_chain():CODE
LOWtests/test_async_parity.py230async def test_astream_events_matches_stream_events_for_text_only():CODE
LOWtests/test_async_parity.py260async def test_async_from_dict_model_override():CODE
LOWtests/test_async_parity.py272def test_sync_from_dict_model_override():CODE
LOWtests/test_async_parity.py284async def test_async_to_dict_preserves_datetime():CODE
LOWtests/test_async_parity.py294async def test_async_to_dict_preserves_usage_when_set(async_mock_model):CODE
LOWtests/test_async_parity.py312async def test_async_reply_messages_kwarg_appends():CODE
LOWtests/test_async_parity.py325async def test_async_full_chain_to_dict_round_trip_three_turns():CODE
LOWtests/test_async_parity.py365async def test_async_reply_chains_three_turns():CODE
LOWtests/test_utils.py112def test_extract_fenced_code_block(input, last, expected):CODE
LOWtests/test_utils.py318def test_test_truncate_string_keep_end(CODE
LOWtests/test_utils.py386def test_backtick_count_adjustment(content: str, backtick_count: int):CODE
LOWtests/test_utils.py471def test_toolbox_config_capture():CODE
LOWtests/conftest.py44def user_path_with_embeddings(user_path):CODE
LOWtests/conftest.py212def register_embed_demo_model(embed_demo, mock_model, async_mock_model):CODE
LOWtests/conftest.py217 def register_embedding_models(self, register):CODE
LOWtests/conftest.py265def mocked_openai_chat_returning_fenced_code(httpx_mock):CODE
LOWtests/conftest.py309def mocked_openai_chat_stream(httpx_mock):CODE
LOWtests/conftest.py415def mocked_openai_completion_logprobs_stream(httpx_mock):CODE
LOWtests/conftest.py426def mocked_openai_completion_logprobs(httpx_mock):CODE
LOWtests/test_llm_logs.py138def test_logs_text_with_options(user_path):CODE
LOWtests/test_llm_logs.py174def test_logs_token_usage_details_are_markdown_code(user_path):CODE
LOWtests/test_llm_logs.py252def test_logs_extract_first_code(args, log_path):CODE
LOWtests/test_llm_logs.py271def test_logs_extract_last_code(args, log_path):CODE
331 more matches not shown…
Cross-Language Confusion5 hits · 30 pts
SeverityFileLineSnippetContext
HIGHllm/utils.py668 if re.match(r'\s*(["\[\d\-]|true|false|null)', arg_body, re.I):CODE
HIGHtests/test_llm_logs.py1179 """When reasoning is empty/null, no heading appears (existingSTRING
HIGHtests/test_plugins.py467 '[{"id": 2, "tool_id": 1, "name": "upper", "output": "ONE", "tool_call_id": "tc_TCID", "exception": nullCODE
HIGHtests/test_plugins.py472 '[{"id": 3, "tool_id": 1, "name": "upper", "output": "TWO", "tool_call_id": "tc_TCID", "exception": nullCODE
HIGHtests/test_plugins.py480 '[{"id": 4, "tool_id": 1, "name": "upper", "output": "THREE", "tool_call_id": "tc_TCID", "exception": nuCODE
Deep Nesting27 hits · 26 pts
SeverityFileLineSnippetContext
LOWllm/plugins.py21CODE
LOWllm/models.py520CODE
LOWllm/models.py1112CODE
LOWllm/models.py1415CODE
LOWllm/models.py1833CODE
LOWllm/models.py2173CODE
LOWllm/cli.py131CODE
LOWllm/cli.py519CODE
LOWllm/cli.py1086CODE
LOWllm/cli.py1657CODE
LOWllm/cli.py2743CODE
LOWllm/cli.py3229CODE
LOWllm/cli.py3359CODE
LOWllm/cli.py3554CODE
LOWllm/cli.py3454CODE
LOWllm/utils.py77CODE
LOWllm/utils.py312CODE
LOWllm/utils.py554CODE
LOWllm/parts.py253CODE
LOWllm/default_plugins/openai_models.py2029CODE
LOWllm/default_plugins/openai_models.py775CODE
LOWllm/default_plugins/openai_models.py942CODE
LOWllm/default_plugins/openai_models.py1060CODE
LOWllm/default_plugins/openai_models.py1223CODE
LOWllm/default_plugins/openai_models.py1511CODE
LOWllm/default_plugins/openai_models.py1738CODE
LOWtests/test_templates.py464CODE
Unused Imports24 hits · 19 pts
SeverityFileLineSnippetContext
LOWllm/__init__.py1CODE
LOWllm/__init__.py2CODE
LOWllm/__init__.py2CODE
LOWllm/__init__.py6CODE
LOWllm/__init__.py6CODE
LOWllm/__init__.py6CODE
LOWllm/__init__.py6CODE
LOWllm/__init__.py6CODE
LOWllm/__init__.py6CODE
LOWllm/__init__.py6CODE
LOWllm/__init__.py6CODE
LOWllm/__init__.py6CODE
LOWllm/__init__.py6CODE
LOWllm/__init__.py6CODE
LOWllm/__init__.py6CODE
LOWllm/__init__.py6CODE
LOWllm/__init__.py6CODE
LOWllm/__init__.py30CODE
LOWllm/__init__.py30CODE
LOWllm/__init__.py30CODE
LOWllm/__init__.py30CODE
LOWllm/__init__.py30CODE
LOWllm/__init__.py37CODE
LOWllm/__init__.py38CODE
Excessive Try-Catch Wrapping14 hits · 14 pts
SeverityFileLineSnippetContext
LOWllm/models.py1927 except Exception as ex:CODE
LOWllm/models.py2240 except Exception as ex:CODE
LOWllm/models.py2295 except Exception as ex:CODE
LOWllm/models.py2339 except Exception as ex:CODE
LOWllm/models.py2363 except Exception as ex:CODE
LOWllm/models.py2381 except Exception as ex:CODE
MEDIUMllm/cli.py290def convert(self, value, param, ctx):CODE
LOWllm/cli.py187 except Exception as ex:CODE
LOWllm/cli.py961 except Exception as ex:CODE
LOWllm/cli.py1477 except Exception as ex:CODE
LOWllm/cli.py4083 except Exception as ex:STRING
LOWllm/default_plugins/openai_models.py1445 except Exception:CODE
LOWdocs/plugins/plugin-hooks.md221 except Exception as e:CODE
LOWdocs/plugins/plugin-hooks.md271 except Exception as ex:CODE
AI Structural Patterns12 hits · 10 pts
SeverityFileLineSnippetContext
LOWllm/models.py411CODE
LOWllm/models.py650CODE
LOWllm/models.py700CODE
LOWllm/models.py778CODE
LOWllm/models.py831CODE
LOWllm/models.py3105CODE
LOWllm/models.py3145CODE
LOWllm/models.py3224CODE
LOWllm/models.py3264CODE
LOWllm/default_plugins/openai_models.py710CODE
LOWllm/default_plugins/openai_models.py1460CODE
LOWllm/default_plugins/openai_models.py1689CODE
Self-Referential Comments4 hits · 10 pts
SeverityFileLineSnippetContext
MEDIUMllm/cli.py3833 # Create a test Options object to validateSTRING
MEDIUMtests/test_templates.py158 # Create a file to test attachmentCOMMENT
MEDIUMtests/test_chat_templates.py35 # Create a system fragment fileCOMMENT
MEDIUMdocs/conf.py6# This file is execfile()d with the current directory set to itsCOMMENT
Modern AI Meta-Vocabulary3 hits · 8 pts
SeverityFileLineSnippetContext
MEDIUMllm/__init__.py439 # Try to resolve it to an embedding modelCOMMENT
MEDIUMtests/test_openai_responses.py574 # item, otherwise the model loses its chain of thought.COMMENT
MEDIUMdocs/embeddings/python-api.md40To work with embeddings in this way you will need an instance of a [sqlite-utils Database](https://sqlite-utils.datasettCODE
Redundant / Tautological Comments4 hits · 6 pts
SeverityFileLineSnippetContext
LOWllm/cli.py3495 # Read the file twice - first time is to get a countCOMMENT
LOWllm/utils.py377 # Check if the schema is newline-separated or comma-separatedCOMMENT
LOWtests/test_utils.py392 # Check if the correct number of backticks is usedCOMMENT
LOW.github/workflows/stable-docs.yml52 # Check if the list of files is non-emptyCOMMENT
Modern Structural Boilerplate3 hits · 2 pts
SeverityFileLineSnippetContext
LOWllm/__init__.py49__all__ = [CODE
LOWllm/cli.py3986def set_model_option(model_id: str, key: str, value: Any) -> None:STRING
LOWllm/serialization.py41__all__ = [CODE
Over-Commented Block2 hits · 2 pts
SeverityFileLineSnippetContext
LOWdocs/conf.py1#!/usr/bin/env python3COMMENT
LOWdocs/conf.py121# -- Options for LaTeX output ---------------------------------------------COMMENT
Overly Generic Function Names1 hit · 1 pts
SeverityFileLineSnippetContext
LOWllm/utils.py108 def handle_request(self, request: httpx.Request) -> httpx.Response:CODE