Access large language models from the command-line
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).
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 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.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | llm/hookspecs.py | 19 | def register_embedding_models(register): | CODE |
| LOW⚡ | llm/hookspecs.py | 24 | def register_template_loaders(register): | CODE |
| LOW⚡ | llm/hookspecs.py | 29 | def register_fragment_loaders(register): | CODE |
| LOW | llm/models.py | 187 | def _get_arguments_input_schema(function, name): | CODE |
| LOW | llm/models.py | 216 | def _implementation_arguments(tool: "Tool", tool_call: "ToolCall") -> dict: | CODE |
| LOW | llm/models.py | 2632 | def _append_tool_results_to_chain(chain, tool_results, attachments) -> List[Any]: | CODE |
| LOW | llm/models.py | 2684 | def _trailing_pending_tool_calls(messages) -> List[ToolCall]: | CODE |
| LOW | llm/models.py | 3441 | def _remove_titles_recursively(obj): | CODE |
| LOW | llm/__init__.py | 234 | def get_embedding_models_with_aliases() -> List["EmbeddingModelWithAliases"]: | CODE |
| LOW | llm/__init__.py | 276 | def get_embedding_model_aliases() -> Dict[str, EmbeddingModel]: | CODE |
| LOW | llm/__init__.py | 498 | def get_default_embedding_model(): | CODE |
| LOW | llm/__init__.py | 502 | def set_default_embedding_model(model): | CODE |
| LOW | llm/embeddings.py | 173 | def embed_multi_with_metadata( | CODE |
| LOW | llm/cli.py | 111 | async def display_async_stream_events(events, *, show_reasoning=True): | CODE |
| LOW | llm/cli.py | 206 | def process_fragments_in_chat( | CODE |
| LOW | llm/cli.py | 297 | def resolve_attachment_with_type(value: str, mimetype: str) -> Attachment: | CODE |
| LOW | llm/cli.py | 313 | def attachment_types_callback(ctx, param, values) -> List[Attachment]: | CODE |
| LOW | llm/cli.py | 2072 | def _format_tool_call_arguments(arguments): | STRING |
| LOW | llm/cli.py | 2349 | def model_matches_id_or_alias(model_with_aliases, model_ids): | STRING |
| LOW | llm/cli.py | 2356 | def render_model_with_aliases( | STRING |
| LOW | llm/cli.py | 2424 | def render_model_with_options(model_id, *, async_=False): | STRING |
| LOW | llm/utils.py | 182 | def extract_fenced_code_block(text: str, last: bool = False) -> Optional[str]: | CODE |
| LOW | llm/default_plugins/openai_models.py | 382 | def register_embedding_models(register): | CODE |
| LOW | llm/default_plugins/openai_models.py | 1409 | def _reasoning_text_from_item(self, item): | CODE |
| LOW | tests/test_cli_openai_models.py | 46 | def test_openai_options_min_max(): | CODE |
| LOW | tests/test_cli_openai_models.py | 205 | def test_openai_image_detail_option_description(model_id, expected_description): | CODE |
| LOW | tests/test_cli_openai_models.py | 210 | def test_openai_image_detail_option_is_sent_on_image_attachments(httpx_mock): | CODE |
| LOW | tests/test_cli_openai_models.py | 357 | def test_openai_image_detail_original_is_rejected_for_other_models(): | CODE |
| LOW | tests/test_async_parity.py | 16 | def test_echo_registered_for_both(): | CODE |
| LOW | tests/test_async_parity.py | 25 | async def test_async_to_dict_captures_chain_and_output(): | CODE |
| LOW | tests/test_async_parity.py | 39 | async def test_async_to_dict_raises_before_awaited(): | CODE |
| LOW | tests/test_async_parity.py | 47 | async def test_async_from_dict_rehydrates(): | CODE |
| LOW | tests/test_async_parity.py | 65 | async def test_async_from_dict_then_reply_continues(): | CODE |
| LOW | tests/test_async_parity.py | 89 | async def test_async_from_row_response_messages_synthesized(tmp_path): | CODE |
| LOW | tests/test_async_parity.py | 121 | async def test_async_load_conversation_follow_up_preserves_chain(tmp_path): | CODE |
| LOW | tests/test_async_parity.py | 172 | async def test_sync_and_async_produce_identical_chain(): | CODE |
| LOW | tests/test_async_parity.py | 191 | async def test_async_chain_tool_result_turn_has_full_chain(): | CODE |
| LOW | tests/test_async_parity.py | 230 | async def test_astream_events_matches_stream_events_for_text_only(): | CODE |
| LOW | tests/test_async_parity.py | 260 | async def test_async_from_dict_model_override(): | CODE |
| LOW | tests/test_async_parity.py | 272 | def test_sync_from_dict_model_override(): | CODE |
| LOW | tests/test_async_parity.py | 284 | async def test_async_to_dict_preserves_datetime(): | CODE |
| LOW | tests/test_async_parity.py | 294 | async def test_async_to_dict_preserves_usage_when_set(async_mock_model): | CODE |
| LOW | tests/test_async_parity.py | 312 | async def test_async_reply_messages_kwarg_appends(): | CODE |
| LOW | tests/test_async_parity.py | 325 | async def test_async_full_chain_to_dict_round_trip_three_turns(): | CODE |
| LOW | tests/test_async_parity.py | 365 | async def test_async_reply_chains_three_turns(): | CODE |
| LOW | tests/test_utils.py | 112 | def test_extract_fenced_code_block(input, last, expected): | CODE |
| LOW | tests/test_utils.py | 318 | def test_test_truncate_string_keep_end( | CODE |
| LOW | tests/test_utils.py | 386 | def test_backtick_count_adjustment(content: str, backtick_count: int): | CODE |
| LOW | tests/test_utils.py | 471 | def test_toolbox_config_capture(): | CODE |
| LOW | tests/conftest.py | 44 | def user_path_with_embeddings(user_path): | CODE |
| LOW | tests/conftest.py | 212 | def register_embed_demo_model(embed_demo, mock_model, async_mock_model): | CODE |
| LOW | tests/conftest.py | 217 | def register_embedding_models(self, register): | CODE |
| LOW | tests/conftest.py | 265 | def mocked_openai_chat_returning_fenced_code(httpx_mock): | CODE |
| LOW | tests/conftest.py | 309 | def mocked_openai_chat_stream(httpx_mock): | CODE |
| LOW | tests/conftest.py | 415 | def mocked_openai_completion_logprobs_stream(httpx_mock): | CODE |
| LOW | tests/conftest.py | 426 | def mocked_openai_completion_logprobs(httpx_mock): | CODE |
| LOW | tests/test_llm_logs.py | 138 | def test_logs_text_with_options(user_path): | CODE |
| LOW | tests/test_llm_logs.py | 174 | def test_logs_token_usage_details_are_markdown_code(user_path): | CODE |
| LOW | tests/test_llm_logs.py | 252 | def test_logs_extract_first_code(args, log_path): | CODE |
| LOW | tests/test_llm_logs.py | 271 | def test_logs_extract_last_code(args, log_path): | CODE |
| 331 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | llm/utils.py | 668 | if re.match(r'\s*(["\[\d\-]|true|false|null)', arg_body, re.I): | CODE |
| HIGH | tests/test_llm_logs.py | 1179 | """When reasoning is empty/null, no heading appears (existing | STRING |
| HIGH⚡ | tests/test_plugins.py | 467 | '[{"id": 2, "tool_id": 1, "name": "upper", "output": "ONE", "tool_call_id": "tc_TCID", "exception": null | CODE |
| HIGH⚡ | tests/test_plugins.py | 472 | '[{"id": 3, "tool_id": 1, "name": "upper", "output": "TWO", "tool_call_id": "tc_TCID", "exception": null | CODE |
| HIGH⚡ | tests/test_plugins.py | 480 | '[{"id": 4, "tool_id": 1, "name": "upper", "output": "THREE", "tool_call_id": "tc_TCID", "exception": nu | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | llm/plugins.py | 21 | CODE | |
| LOW | llm/models.py | 520 | CODE | |
| LOW | llm/models.py | 1112 | CODE | |
| LOW | llm/models.py | 1415 | CODE | |
| LOW | llm/models.py | 1833 | CODE | |
| LOW | llm/models.py | 2173 | CODE | |
| LOW | llm/cli.py | 131 | CODE | |
| LOW | llm/cli.py | 519 | CODE | |
| LOW | llm/cli.py | 1086 | CODE | |
| LOW | llm/cli.py | 1657 | CODE | |
| LOW | llm/cli.py | 2743 | CODE | |
| LOW | llm/cli.py | 3229 | CODE | |
| LOW | llm/cli.py | 3359 | CODE | |
| LOW | llm/cli.py | 3554 | CODE | |
| LOW | llm/cli.py | 3454 | CODE | |
| LOW | llm/utils.py | 77 | CODE | |
| LOW | llm/utils.py | 312 | CODE | |
| LOW | llm/utils.py | 554 | CODE | |
| LOW | llm/parts.py | 253 | CODE | |
| LOW | llm/default_plugins/openai_models.py | 2029 | CODE | |
| LOW | llm/default_plugins/openai_models.py | 775 | CODE | |
| LOW | llm/default_plugins/openai_models.py | 942 | CODE | |
| LOW | llm/default_plugins/openai_models.py | 1060 | CODE | |
| LOW | llm/default_plugins/openai_models.py | 1223 | CODE | |
| LOW | llm/default_plugins/openai_models.py | 1511 | CODE | |
| LOW | llm/default_plugins/openai_models.py | 1738 | CODE | |
| LOW | tests/test_templates.py | 464 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | llm/__init__.py | 1 | CODE | |
| LOW | llm/__init__.py | 2 | CODE | |
| LOW | llm/__init__.py | 2 | CODE | |
| LOW | llm/__init__.py | 6 | CODE | |
| LOW | llm/__init__.py | 6 | CODE | |
| LOW | llm/__init__.py | 6 | CODE | |
| LOW | llm/__init__.py | 6 | CODE | |
| LOW | llm/__init__.py | 6 | CODE | |
| LOW | llm/__init__.py | 6 | CODE | |
| LOW | llm/__init__.py | 6 | CODE | |
| LOW | llm/__init__.py | 6 | CODE | |
| LOW | llm/__init__.py | 6 | CODE | |
| LOW | llm/__init__.py | 6 | CODE | |
| LOW | llm/__init__.py | 6 | CODE | |
| LOW | llm/__init__.py | 6 | CODE | |
| LOW | llm/__init__.py | 6 | CODE | |
| LOW | llm/__init__.py | 6 | CODE | |
| LOW | llm/__init__.py | 30 | CODE | |
| LOW | llm/__init__.py | 30 | CODE | |
| LOW | llm/__init__.py | 30 | CODE | |
| LOW | llm/__init__.py | 30 | CODE | |
| LOW | llm/__init__.py | 30 | CODE | |
| LOW | llm/__init__.py | 37 | CODE | |
| LOW | llm/__init__.py | 38 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | llm/models.py | 1927 | except Exception as ex: | CODE |
| LOW | llm/models.py | 2240 | except Exception as ex: | CODE |
| LOW | llm/models.py | 2295 | except Exception as ex: | CODE |
| LOW | llm/models.py | 2339 | except Exception as ex: | CODE |
| LOW | llm/models.py | 2363 | except Exception as ex: | CODE |
| LOW | llm/models.py | 2381 | except Exception as ex: | CODE |
| MEDIUM | llm/cli.py | 290 | def convert(self, value, param, ctx): | CODE |
| LOW | llm/cli.py | 187 | except Exception as ex: | CODE |
| LOW | llm/cli.py | 961 | except Exception as ex: | CODE |
| LOW | llm/cli.py | 1477 | except Exception as ex: | CODE |
| LOW | llm/cli.py | 4083 | except Exception as ex: | STRING |
| LOW | llm/default_plugins/openai_models.py | 1445 | except Exception: | CODE |
| LOW | docs/plugins/plugin-hooks.md | 221 | except Exception as e: | CODE |
| LOW | docs/plugins/plugin-hooks.md | 271 | except Exception as ex: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | llm/models.py | 411 | CODE | |
| LOW | llm/models.py | 650 | CODE | |
| LOW | llm/models.py | 700 | CODE | |
| LOW | llm/models.py | 778 | CODE | |
| LOW | llm/models.py | 831 | CODE | |
| LOW | llm/models.py | 3105 | CODE | |
| LOW | llm/models.py | 3145 | CODE | |
| LOW | llm/models.py | 3224 | CODE | |
| LOW | llm/models.py | 3264 | CODE | |
| LOW | llm/default_plugins/openai_models.py | 710 | CODE | |
| LOW | llm/default_plugins/openai_models.py | 1460 | CODE | |
| LOW | llm/default_plugins/openai_models.py | 1689 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | llm/cli.py | 3833 | # Create a test Options object to validate | STRING |
| MEDIUM | tests/test_templates.py | 158 | # Create a file to test attachment | COMMENT |
| MEDIUM | tests/test_chat_templates.py | 35 | # Create a system fragment file | COMMENT |
| MEDIUM | docs/conf.py | 6 | # This file is execfile()d with the current directory set to its | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | llm/__init__.py | 439 | # Try to resolve it to an embedding model | COMMENT |
| MEDIUM | tests/test_openai_responses.py | 574 | # item, otherwise the model loses its chain of thought. | COMMENT |
| MEDIUM | docs/embeddings/python-api.md | 40 | To work with embeddings in this way you will need an instance of a [sqlite-utils Database](https://sqlite-utils.datasett | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | llm/cli.py | 3495 | # Read the file twice - first time is to get a count | COMMENT |
| LOW | llm/utils.py | 377 | # Check if the schema is newline-separated or comma-separated | COMMENT |
| LOW | tests/test_utils.py | 392 | # Check if the correct number of backticks is used | COMMENT |
| LOW | .github/workflows/stable-docs.yml | 52 | # Check if the list of files is non-empty | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | llm/__init__.py | 49 | __all__ = [ | CODE |
| LOW | llm/cli.py | 3986 | def set_model_option(model_id: str, key: str, value: Any) -> None: | STRING |
| LOW | llm/serialization.py | 41 | __all__ = [ | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | docs/conf.py | 1 | #!/usr/bin/env python3 | COMMENT |
| LOW | docs/conf.py | 121 | # -- Options for LaTeX output --------------------------------------------- | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | llm/utils.py | 108 | def handle_request(self, request: httpx.Request) -> httpx.Response: | CODE |