Repository Analysis

simonw/llm

Access large language models from the command-line

14.2 Low AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of simonw/llm, a Python project with 12,421 GitHub stars. SynthScan v2.0 examined 50,965 lines of code across 109 source files, recording 799 pattern matches distributed across 13 syntactic categories. The overall adjusted score of 14.2 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).

14.2
Adjusted Score
14.2
Raw Score
100%
Time Factor
2026-08-22
Last Push
12.4K
Stars
Python
Language
51.0K
Lines of Code
109
Files
799
Pattern Hits
2026-08-29
Scan Date
0.08
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 9MEDIUM 10LOW 780

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 799 distinct pattern matches across 13 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 Identifiers674 hits · 553 pts
SeverityFileLineSnippetContext
LOWllm/hookspecs.py18def register_embedding_models(register):CODE
LOWllm/hookspecs.py23def register_template_loaders(register):CODE
LOWllm/hookspecs.py28def register_fragment_loaders(register):CODE
LOWllm/models.py260def _get_arguments_input_schema(function, name):CODE
LOWllm/models.py289def _implementation_arguments(tool: "Tool", tool_call: "ToolCall") -> dict:CODE
LOWllm/models.py2707def _append_tool_results_to_chain(chain, tool_results, attachments) -> list[Any]:CODE
LOWllm/models.py2760def _trailing_pending_tool_calls(messages) -> list[ToolCall]:CODE
LOWllm/models.py3216 def supported_server_side_tools(self) -> tuple[type[ServerSideTool], ...]:CODE
LOWllm/models.py3651def _remove_titles_recursively(obj):CODE
LOWllm/__init__.py237def get_embedding_models_with_aliases() -> list["EmbeddingModelWithAliases"]:CODE
LOWllm/__init__.py279def get_embedding_model_aliases() -> dict[str, EmbeddingModel]:CODE
LOWllm/__init__.py501def get_default_embedding_model():CODE
LOWllm/__init__.py505def set_default_embedding_model(model):CODE
LOWllm/embeddings.py183 def embed_multi_with_metadata(CODE
LOWllm/cli.py122async def display_async_stream_events(events, *, show_reasoning=True):CODE
LOWllm/cli.py299def process_fragments_in_chat(CODE
LOWllm/cli.py388def resolve_attachment_with_type(value: str, mimetype: str) -> Attachment:CODE
LOWllm/cli.py404def attachment_types_callback(ctx, param, values) -> list[Attachment]:CODE
LOWllm/cli.py439def _merge_template_attachments(template, attachments, attachment_types):CODE
LOWllm/cli.py1764def logs_json_for_response_ids(db, ids):STRING
LOWllm/cli.py2066 def _format_tool_call_arguments(arguments):STRING
LOWllm/cli.py2380def model_matches_id_or_alias(model_with_aliases, model_ids):STRING
LOWllm/cli.py2387def render_model_with_aliases(STRING
LOWllm/cli.py2455def render_model_with_options(model_id, *, async_=False):STRING
LOWllm/utils.py181def extract_fenced_code_block(text: str, last: bool = False) -> str | None:CODE
LOWllm/logs.py1581def _instances_by_tool_call_id(CODE
LOWllm/default_plugins/openai_models.py427def register_embedding_models(register):CODE
LOWllm/default_plugins/openai_models.py1833 def supported_server_side_tools(self):CODE
LOWllm/default_plugins/openai_models.py2116 def _finalize_responses_kwargs(self, prompt, stream, instructions=None):CODE
LOWllm/default_plugins/openai_models.py2149 def _reasoning_text_from_item(self, item):CODE
LOWllm/default_plugins/openai_models.py2194 def _reasoning_refresh_events(self, response_json, done_events):CODE
LOWllm/default_plugins/openai_models.py2325 def _refresh_server_tool_events(self, output, done_events):CODE
LOWllm/default_plugins/openai_models.py2350 def _non_streaming_output_events(self, output, response):CODE
LOWtests/test_cli_openai_models.py49def test_openai_options_min_max():CODE
LOWtests/test_cli_openai_models.py108def test_deprecated_models_are_not_registered(model_id):CODE
LOWtests/test_cli_openai_models.py217def test_code_interpreter_cli_tool_is_resolved_from_model(httpx_mock):CODE
LOWtests/test_cli_openai_models.py274def test_code_interpreter_cli_tool_is_reused_on_continue(httpx_mock, user_path):CODE
LOWtests/test_cli_openai_models.py395def test_web_search_cli_tool_is_resolved_from_model(httpx_mock):CODE
LOWtests/test_cli_openai_models.py453def test_tools_list_for_model_includes_server_side_tools():CODE
LOWtests/test_cli_openai_models.py485def test_tools_list_for_model_with_no_server_side_tools():CODE
LOWtests/test_cli_openai_models.py496def test_tools_list_rejects_unknown_model():CODE
LOWtests/test_cli_openai_models.py520def test_openai_image_detail_option_description(model_id, expected_description):CODE
LOWtests/test_cli_openai_models.py525def test_openai_image_detail_option_is_sent_on_image_attachments(httpx_mock):CODE
LOWtests/test_cli_openai_models.py672def test_openai_image_detail_original_is_rejected_for_other_models():CODE
LOWtests/test_async_parity.py17def test_echo_registered_for_both():CODE
LOWtests/test_async_parity.py26async def test_async_to_dict_captures_chain_and_output():CODE
LOWtests/test_async_parity.py40async def test_async_to_dict_raises_before_awaited():CODE
LOWtests/test_async_parity.py48async def test_async_from_dict_rehydrates():CODE
LOWtests/test_async_parity.py66async def test_async_from_dict_then_reply_continues():CODE
LOWtests/test_async_parity.py90async def test_async_from_row_response_messages_synthesized(tmp_path):CODE
LOWtests/test_async_parity.py136async def test_async_load_conversation_follow_up_preserves_chain(tmp_path):CODE
LOWtests/test_async_parity.py188async def test_sync_and_async_produce_identical_chain():CODE
LOWtests/test_async_parity.py207async def test_async_chain_tool_result_turn_has_full_chain():CODE
LOWtests/test_async_parity.py246async def test_astream_events_matches_stream_events_for_text_only():CODE
LOWtests/test_async_parity.py276async def test_async_from_dict_model_override():CODE
LOWtests/test_async_parity.py288def test_sync_from_dict_model_override():CODE
LOWtests/test_async_parity.py300async def test_async_to_dict_preserves_datetime():CODE
LOWtests/test_async_parity.py310async def test_async_to_dict_preserves_usage_when_set(async_mock_model):CODE
LOWtests/test_async_parity.py328async def test_async_reply_messages_kwarg_appends():CODE
LOWtests/test_async_parity.py341async def test_async_full_chain_to_dict_round_trip_three_turns():CODE
614 more matches not shown…
Cross-Language Confusion7 hits · 40 pts
SeverityFileLineSnippetContext
HIGHllm/utils.py699 if re.match(r'\s*(["\[\d\-]|true|false|null)', arg_body, re.IGNORECASE):CODE
HIGHllm/logs.py1082 where json_extract(je.value, '$.literal') is not null)CODE
HIGHllm/migrations.py676 and p2.tool_name is not null) as toolsCODE
HIGHtests/test_llm_logs.py1387 """When reasoning is empty/null, no heading appears (existingSTRING
HIGHtests/test_plugins.py479 '[{"id": ID, "tool_id": 1, "name": "upper", "output": "ONE", "tool_call_id": "tc_TCID", "exception": nulCODE
HIGHtests/test_plugins.py484 '[{"id": ID, "tool_id": 1, "name": "upper", "output": "TWO", "tool_call_id": "tc_TCID", "exception": nulCODE
HIGHtests/test_plugins.py492 '[{"id": ID, "tool_id": 1, "name": "upper", "output": "THREE", "tool_call_id": "tc_TCID", "exception": nCODE
Deep Nesting39 hits · 34 pts
SeverityFileLineSnippetContext
LOWllm/plugins.py23CODE
LOWllm/models.py604CODE
LOWllm/models.py104CODE
LOWllm/models.py1311CODE
LOWllm/models.py1879CODE
LOWllm/models.py2226CODE
LOWllm/models.py3009CODE
LOWllm/cli.py136CODE
LOWllm/cli.py228CODE
LOWllm/cli.py685CODE
LOWllm/cli.py1412CODE
LOWllm/cli.py1683CODE
LOWllm/cli.py1878CODE
LOWllm/cli.py2802CODE
LOWllm/cli.py3358CODE
LOWllm/cli.py3501CODE
LOWllm/cli.py3699CODE
LOWllm/cli.py2087CODE
LOWllm/cli.py3595CODE
LOWllm/utils.py76CODE
LOWllm/utils.py311CODE
LOWllm/utils.py585CODE
LOWllm/logs.py85CODE
LOWllm/logs.py878CODE
LOWllm/parts.py253CODE
LOWllm/default_plugins/openai_models.py489CODE
LOWllm/default_plugins/openai_models.py3037CODE
LOWllm/default_plugins/openai_models.py580CODE
LOWllm/default_plugins/openai_models.py1215CODE
LOWllm/default_plugins/openai_models.py1385CODE
LOWllm/default_plugins/openai_models.py1503CODE
LOWllm/default_plugins/openai_models.py1746CODE
LOWllm/default_plugins/openai_models.py1927CODE
LOWllm/default_plugins/openai_models.py2037CODE
LOWllm/default_plugins/openai_models.py2233CODE
LOWllm/default_plugins/openai_models.py2350CODE
LOWllm/default_plugins/openai_models.py2480CODE
LOWllm/default_plugins/openai_models.py2724CODE
LOWtests/test_templates.py510CODE
Unused Imports26 hits · 20 pts
SeverityFileLineSnippetContext
LOWllm/__init__.py11CODE
LOWllm/__init__.py12CODE
LOWllm/__init__.py12CODE
LOWllm/__init__.py16CODE
LOWllm/__init__.py17CODE
LOWllm/__init__.py17CODE
LOWllm/__init__.py17CODE
LOWllm/__init__.py17CODE
LOWllm/__init__.py17CODE
LOWllm/__init__.py17CODE
LOWllm/__init__.py17CODE
LOWllm/__init__.py17CODE
LOWllm/__init__.py17CODE
LOWllm/__init__.py17CODE
LOWllm/__init__.py17CODE
LOWllm/__init__.py17CODE
LOWllm/__init__.py17CODE
LOWllm/__init__.py17CODE
LOWllm/__init__.py17CODE
LOWllm/__init__.py42CODE
LOWllm/__init__.py42CODE
LOWllm/__init__.py42CODE
LOWllm/__init__.py42CODE
LOWllm/__init__.py42CODE
LOWllm/__init__.py51CODE
LOWtests/test_options_parameter.py89CODE
Excessive Try-Catch Wrapping15 hits · 14 pts
SeverityFileLineSnippetContext
LOWllm/models.py1980 except Exception as ex: # noqa: BLE001CODE
LOWllm/models.py2300 except Exception as ex: # noqa: BLE001CODE
LOWllm/models.py2355 except Exception as ex: # noqa: BLE001CODE
LOWllm/models.py2399 except Exception as ex: # noqa: BLE001CODE
LOWllm/models.py2423 except Exception as ex: # noqa: BLE001CODE
LOWllm/models.py2441 except Exception as ex: # noqa: BLE001CODE
MEDIUMllm/cli.py381def convert(self, value, param, ctx):CODE
LOWllm/cli.py282 except Exception as ex: # noqa: BLE001CODE
LOWllm/cli.py1142 except Exception as ex:CODE
LOWllm/cli.py1663 except Exception as ex: # noqa: BLE001STRING
LOWllm/cli.py4227 except Exception as ex: # noqa: BLE001STRING
LOWllm/default_plugins/openai_models.py829 except Exception as ex:CODE
LOWllm/default_plugins/openai_models.py2185 except Exception: # noqa: BLE001CODE
LOWdocs/plugins/plugin-hooks.md221 except Exception as e:CODE
LOWdocs/plugins/plugin-hooks.md271 except Exception as ex:CODE
Modern AI Meta-Vocabulary5 hits · 14 pts
SeverityFileLineSnippetContext
MEDIUMllm/__init__.py442 # Try to resolve it to an embedding modelCOMMENT
MEDIUMtests/test_embed_cli.py180 # --key should be passed through to the embedding modelCOMMENT
MEDIUMtests/test_embed_cli.py201 # --key should be passed through to the embedding model for embed-multi tooCOMMENT
MEDIUMtests/test_openai_responses.py1242 # item, otherwise the model loses its chain of thought.COMMENT
MEDIUMdocs/embeddings/python-api.md50To work with embeddings in this way you will need an instance of a [sqlite-utils Database](https://sqlite-utils.datasettCODE
AI Structural Patterns15 hits · 12 pts
SeverityFileLineSnippetContext
LOWllm/models.py493CODE
LOWllm/models.py823CODE
LOWllm/models.py877CODE
LOWllm/models.py956CODE
LOWllm/models.py1010CODE
LOWllm/models.py3263CODE
LOWllm/models.py3310CODE
LOWllm/models.py3389CODE
LOWllm/models.py3435CODE
LOWllm/logs.py1307CODE
LOWllm/logs.py1650CODE
LOWllm/default_plugins/openai_models.py1148CODE
LOWllm/default_plugins/openai_models.py1651CODE
LOWllm/default_plugins/openai_models.py2422CODE
LOWllm/default_plugins/openai_models.py2668CODE
Magic Placeholder Names2 hits · 10 pts
SeverityFileLineSnippetContext
HIGHREADME.md84Add `--key your-api-key` if the endpoint requires authentication. See [Run against an endpoint without configuring it](hCODE
HIGHdocs/index.md52Add `--key your-api-key` if the endpoint requires authentication. See {ref}`Run against an endpoint without configuring CODE
Self-Referential Comments4 hits · 10 pts
SeverityFileLineSnippetContext
MEDIUMllm/cli.py3977 # Create a test Options object to validateSTRING
MEDIUMtests/test_templates.py160 # Create a file to test attachmentCOMMENT
MEDIUMtests/test_chat_templates.py38 # Create a system fragment fileCOMMENT
MEDIUMdocs/conf.py3# This file is execfile()d with the current directory set to itsCOMMENT
Redundant / Tautological Comments4 hits · 6 pts
SeverityFileLineSnippetContext
LOWllm/cli.py3636 # Read the file twice - first time is to get a countCOMMENT
LOWllm/utils.py376 # Check if the schema is newline-separated or comma-separatedCOMMENT
LOWtests/test_utils.py434 # 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 Boilerplate4 hits · 3 pts
SeverityFileLineSnippetContext
LOWllm/__init__.py53__all__ = [CODE
LOWllm/cli.py4130def set_model_option(model_id: str, key: str, value: Any) -> None:STRING
LOWllm/logs.py45__all__ = [CODE
LOWllm/serialization.py41__all__ = [CODE
Over-Commented Block3 hits · 3 pts
SeverityFileLineSnippetContext
LOWllm/migrations.py721 # only while sorted by path.COMMENT
LOWdocs/conf.py1from subprocess import PIPE, PopenCOMMENT
LOWdocs/conf.py121 # The paper size ('letterpaper' or 'a4paper').COMMENT
Overly Generic Function Names1 hit · 1 pts
SeverityFileLineSnippetContext
LOWllm/utils.py107 def handle_request(self, request: httpx2.Request) -> httpx2.Response:CODE