Repository Analysis

simonw/llm

Access large language models from the command-line

11.2 Low AI signal View on GitHub
11.2
Adjusted Score
11.2
Raw Score
100%
Time Factor
2026-05-17
Last Push
11,960
Stars
Python
Language
38,566
Lines of Code
104
Files
434
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 0HIGH 5MEDIUM 5LOW 424

Pattern Findings

434 matches across 9 categories. Click a row to expand file-level details.

Hyper-Verbose Identifiers356 hits · 323 pts
SeverityFileLineSnippet
LOWllm/hookspecs.py19def register_embedding_models(register):
LOWllm/hookspecs.py24def register_template_loaders(register):
LOWllm/hookspecs.py29def register_fragment_loaders(register):
LOWllm/models.py186def _get_arguments_input_schema(function, name):
LOWllm/models.py3115def _remove_titles_recursively(obj):
LOWllm/__init__.py232def get_embedding_models_with_aliases() -> List["EmbeddingModelWithAliases"]:
LOWllm/__init__.py274def get_embedding_model_aliases() -> Dict[str, EmbeddingModel]:
LOWllm/__init__.py496def get_default_embedding_model():
LOWllm/__init__.py500def set_default_embedding_model(model):
LOWllm/embeddings.py173 def embed_multi_with_metadata(
LOWllm/cli.py111async def display_async_stream_events(events, *, show_reasoning=True):
LOWllm/cli.py206def process_fragments_in_chat(
LOWllm/cli.py297def resolve_attachment_with_type(value: str, mimetype: str) -> Attachment:
LOWllm/cli.py313def attachment_types_callback(ctx, param, values) -> List[Attachment]:
LOWllm/cli.py2300def model_matches_id_or_alias(model_with_aliases, model_ids):
LOWllm/cli.py2307def render_model_with_aliases(
LOWllm/cli.py2375def render_model_with_options(model_id, *, async_=False):
LOWllm/utils.py182def extract_fenced_code_block(text: str, last: bool = False) -> Optional[str]:
LOWllm/default_plugins/openai_models.py382def register_embedding_models(register):
LOWllm/default_plugins/openai_models.py1409 def _reasoning_text_from_item(self, item):
LOWtests/test_cli_openai_models.py46def test_openai_options_min_max():
LOWtests/test_cli_openai_models.py205def test_openai_image_detail_option_description(model_id, expected_description):
LOWtests/test_cli_openai_models.py210def test_openai_image_detail_option_is_sent_on_image_attachments(httpx_mock):
LOWtests/test_cli_openai_models.py357def test_openai_image_detail_original_is_rejected_for_other_models():
LOWtests/test_async_parity.py16def test_echo_registered_for_both():
LOWtests/test_async_parity.py25async def test_async_to_dict_captures_chain_and_output():
LOWtests/test_async_parity.py39async def test_async_to_dict_raises_before_awaited():
LOWtests/test_async_parity.py47async def test_async_from_dict_rehydrates():
LOWtests/test_async_parity.py65async def test_async_from_dict_then_reply_continues():
LOWtests/test_async_parity.py89async def test_async_from_row_response_messages_synthesized(tmp_path):
LOWtests/test_async_parity.py121async def test_async_load_conversation_follow_up_preserves_chain(tmp_path):
LOWtests/test_async_parity.py172async def test_sync_and_async_produce_identical_chain():
LOWtests/test_async_parity.py191async def test_async_chain_tool_result_turn_has_full_chain():
LOWtests/test_async_parity.py230async def test_astream_events_matches_stream_events_for_text_only():
LOWtests/test_async_parity.py260async def test_async_from_dict_model_override():
LOWtests/test_async_parity.py272def test_sync_from_dict_model_override():
LOWtests/test_async_parity.py284async def test_async_to_dict_preserves_datetime():
LOWtests/test_async_parity.py294async def test_async_to_dict_preserves_usage_when_set(async_mock_model):
LOWtests/test_async_parity.py312async def test_async_reply_messages_kwarg_appends():
LOWtests/test_async_parity.py325async def test_async_full_chain_to_dict_round_trip_three_turns():
LOWtests/test_async_parity.py365async def test_async_reply_chains_three_turns():
LOWtests/test_utils.py112def test_extract_fenced_code_block(input, last, expected):
LOWtests/test_utils.py318def test_test_truncate_string_keep_end(
LOWtests/test_utils.py386def test_backtick_count_adjustment(content: str, backtick_count: int):
LOWtests/test_utils.py471def test_toolbox_config_capture():
LOWtests/conftest.py31def user_path_with_embeddings(user_path):
LOWtests/conftest.py199def register_embed_demo_model(embed_demo, mock_model, async_mock_model):
LOWtests/conftest.py204 def register_embedding_models(self, register):
LOWtests/conftest.py252def mocked_openai_chat_returning_fenced_code(httpx_mock):
LOWtests/conftest.py296def mocked_openai_chat_stream(httpx_mock):
LOWtests/conftest.py402def mocked_openai_completion_logprobs_stream(httpx_mock):
LOWtests/conftest.py413def mocked_openai_completion_logprobs(httpx_mock):
LOWtests/test_llm_logs.py138def test_logs_text_with_options(user_path):
LOWtests/test_llm_logs.py217def test_logs_extract_first_code(args, log_path):
LOWtests/test_llm_logs.py236def test_logs_extract_last_code(args, log_path):
LOWtests/test_llm_logs.py418def test_logs_schema_data_ids(schema_log_path):
LOWtests/test_llm_logs.py713def test_logs_fragments_markdown(fragments_fixture):
LOWtests/test_llm_logs.py896def test_expand_fragment_json(fragments_fixture, arg):
LOWtests/test_llm_logs.py916def test_expand_fragment_markdown(fragments_fixture):
LOWtests/test_llm_logs.py1017def test_log_to_db_persists_visible_reasoning(logs_db, mock_model):
296 more matches not shown…
Cross-Language Confusion5 hits · 30 pts
SeverityFileLineSnippet
HIGHllm/utils.py668 if re.match(r'\s*(["\[\d\-]|true|false|null)', arg_body, re.I):
HIGHtests/test_llm_logs.py1075 """When reasoning is empty/null, no heading appears (existing
HIGHtests/test_plugins.py460 '[{"id": 2, "tool_id": 1, "name": "upper", "output": "ONE", "tool_call_id": null, "exception": null, "at
HIGHtests/test_plugins.py465 '[{"id": 3, "tool_id": 1, "name": "upper", "output": "TWO", "tool_call_id": null, "exception": null, "at
HIGHtests/test_plugins.py473 '[{"id": 4, "tool_id": 1, "name": "upper", "output": "THREE", "tool_call_id": null, "exception": null, "
Deep Nesting27 hits · 27 pts
SeverityFileLineSnippet
LOWllm/plugins.py21
LOWllm/models.py476
LOWllm/models.py1041
LOWllm/models.py1335
LOWllm/models.py1753
LOWllm/models.py2074
LOWllm/cli.py131
LOWllm/cli.py519
LOWllm/cli.py1086
LOWllm/cli.py1657
LOWllm/cli.py2694
LOWllm/cli.py3180
LOWllm/cli.py3310
LOWllm/cli.py3505
LOWllm/cli.py3405
LOWllm/utils.py77
LOWllm/utils.py312
LOWllm/utils.py554
LOWllm/parts.py253
LOWllm/default_plugins/openai_models.py2029
LOWllm/default_plugins/openai_models.py775
LOWllm/default_plugins/openai_models.py942
LOWllm/default_plugins/openai_models.py1060
LOWllm/default_plugins/openai_models.py1223
LOWllm/default_plugins/openai_models.py1511
LOWllm/default_plugins/openai_models.py1738
LOWtests/test_templates.py464
Unused Imports23 hits · 20 pts
SeverityFileLineSnippet
LOWllm/__init__.py1
LOWllm/__init__.py2
LOWllm/__init__.py2
LOWllm/__init__.py6
LOWllm/__init__.py6
LOWllm/__init__.py6
LOWllm/__init__.py6
LOWllm/__init__.py6
LOWllm/__init__.py6
LOWllm/__init__.py6
LOWllm/__init__.py6
LOWllm/__init__.py6
LOWllm/__init__.py6
LOWllm/__init__.py6
LOWllm/__init__.py6
LOWllm/__init__.py6
LOWllm/__init__.py29
LOWllm/__init__.py29
LOWllm/__init__.py29
LOWllm/__init__.py29
LOWllm/__init__.py29
LOWllm/__init__.py36
LOWllm/__init__.py37
Excessive Try-Catch Wrapping11 hits · 11 pts
SeverityFileLineSnippet
LOWllm/models.py1828 except Exception as ex:
LOWllm/models.py2139 except Exception as ex:
LOWllm/models.py2202 except Exception as ex:
MEDIUMllm/cli.py290def convert(self, value, param, ctx):
LOWllm/cli.py187 except Exception as ex:
LOWllm/cli.py961 except Exception as ex:
LOWllm/cli.py1477 except Exception as ex:
LOWllm/cli.py4034 except Exception as ex:
LOWllm/default_plugins/openai_models.py1445 except Exception:
LOWdocs/plugins/plugin-hooks.md221 except Exception as e:
LOWdocs/plugins/plugin-hooks.md271 except Exception as ex:
Self-Referential Comments4 hits · 10 pts
SeverityFileLineSnippet
MEDIUMllm/cli.py3784 # Create a test Options object to validate
MEDIUMtests/test_templates.py158 # Create a file to test attachment
MEDIUMtests/test_chat_templates.py35 # Create a system fragment file
MEDIUMdocs/conf.py6# This file is execfile()d with the current directory set to its
Redundant / Tautological Comments4 hits · 6 pts
SeverityFileLineSnippet
LOWllm/cli.py3446 # Read the file twice - first time is to get a count
LOWllm/utils.py377 # Check if the schema is newline-separated or comma-separated
LOWtests/test_utils.py392 # Check if the correct number of backticks is used
LOW.github/workflows/stable-docs.yml52 # Check if the list of files is non-empty
Over-Commented Block3 hits · 3 pts
SeverityFileLineSnippet
LOWllm/models.py881 # str yields are wrapped as text events (with part_index resolved
LOWdocs/conf.py1#!/usr/bin/env python3
LOWdocs/conf.py121# -- Options for LaTeX output ---------------------------------------------
Overly Generic Function Names1 hit · 1 pts
SeverityFileLineSnippet
LOWllm/utils.py108 def handle_request(self, request: httpx.Request) -> httpx.Response: