AI Slop Code RIsk Monitor

ml-explore/mlx-lm

Run LLMs with MLX

7.1 Moderate pattern signal View on GitHub

Maintenance and Governance Review

This report summarizes scanner evidence for ml-explore/mlx-lm, a Python project with 7,267 GitHub stars. SynthScan examined 72,608 lines of code across 241 source files, recording 413 pattern matches distributed across 16 syntactic categories. The legacy adjusted pattern signal is 7.1 (Moderate pattern signal); it is not an authorship estimate.

Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.

7.1
Adjusted Signal
7.1
Raw Pattern Score
100%
Time Factor
2026-10-10
Last Push
7.3K
Stars
Python
Language
72.6K
Lines of Code
241
Files
413
Pattern Hits
2026-10-12
Scan Date
0.10
HC Hit Rate

Risk Review · v3

Use each vector to guide manual verification of the underlying findings.

Cognitive Ownership Risk 22.5/100 · LOW

Can maintainers explain intent, assumptions, and trade-offs? 355 finding(s).

Hallucinated Dependency & Supply Chain Risk 1.8/100 · LOW

Are imports declared and package/API names verified? 19 finding(s).

Agent Over-Engineering Ratio 21.9/100 · LOW

Are wrappers, guards, and repeated structures necessary? 296 finding(s).

PR Review Velocity Impact 31.5/100 · MEDIUM

Which changes need focused human review? 413 finding(s).

What These Metrics Mean

Adjusted Signal
Legacy pattern score normalized per 1,000 scanned lines and multiplied by the repository-level time factor. It is not an estimate of AI authorship.
Raw Pattern Score
Sum of severity- and context-weighted pattern findings before applying the time factor.
Time Factor
A coarse multiplier based on repository last-push metadata. It does not identify when individual code was written.
Pattern Hits
Count of configured pattern findings. Review each location and surrounding code before acting.
HC Hit Rate
High- and critical-severity findings per scanned file. Severity is a configured detector weight, not proof of a vulnerability or authorship.
Lines / Files
Scan coverage denominators used by the legacy normalized score.

Pattern-Signal History

This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.

Severity Breakdown

Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.

CRITICAL 0HIGH 23MEDIUM 11LOW 379

Directory Score Breakdown

This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.

Pattern Findings

The scanner identified 413 distinct pattern matches across 16 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. 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 configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.

Hyper-Verbose Identifiers183 hits · 169 pts
SeverityFileLineSnippetContext
LOWmlx_lm/server.py1234 def validate_model_parameters(self) -> None:CODE
LOWmlx_lm/server.py1579 def completion_usage_response(CODE
LOWmlx_lm/generate.py476def speculative_generate_step(CODE
LOWmlx_lm/generate.py848def _normalize_logits_processors(logits_processors, *, n):CODE
LOWmlx_lm/tokenizer_utils.py313def _infer_structural_markers(tokenizer):CODE
LOWmlx_lm/convert.py20def mixed_quant_predicate_builder(CODE
LOWmlx_lm/utils.py74def maybe_set_recommended_wired_limit() -> Optional[int]:CODE
LOWmlx_lm/utils.py309def _compressed_tensors_quantization(quantization_config: dict) -> dict:CODE
LOWmlx_lm/utils.py1206def does_model_support_input_embeddings(model: nn.Module) -> bool:CODE
LOWmlx_lm/sample_utils.py294 def repetition_penalty_processor(tokens, logits):CODE
LOWmlx_lm/sample_utils.py326 def presence_penalty_processor(tokens, logits):CODE
LOWmlx_lm/sample_utils.py355 def frequency_penalty_processor(tokens, logits):CODE
LOWmlx_lm/tool_parsers/minimax_m2.py30def _extract_types_from_schema(schema: Any) -> list[str]:CODE
LOWmlx_lm/tool_parsers/minimax_m2.py91def _convert_param_value_with_types(value: str, param_types: list[str]) -> Any:CODE
LOWmlx_lm/tool_parsers/minimax_m2.py159def _get_param_types_from_config(param_name: str, param_config: dict) -> list[str]:CODE
LOWmlx_lm/tool_parsers/glm47.py162def _parse_plain_text_tool_call(text: str, tools: list[Any] | None):CODE
LOWmlx_lm/tool_parsers/pythonic.py65def _parse_pythonic_tool_call(text: str) -> ToolCall | list[ToolCall] | None:CODE
LOWmlx_lm/tuner/utils.py195def print_trainable_parameters(model):CODE
LOWmlx_lm/models/rope_utils.py150 def yarn_find_correction_range():CODE
LOWmlx_lm/models/gemma3n.py223 def compute_router_modalities(self, x: mx.array) -> mx.array:CODE
LOWmlx_lm/models/gemma4_text.py486 def _project_per_layer_inputs(CODE
LOWmlx_lm/models/qwen3_next.py207 def fix_query_key_value_ordering(CODE
LOWmlx_lm/models/gated_delta.py152def _make_gated_delta_kernel_xtree():STRING
LOWmlx_lm/models/gated_delta.py247def _make_gated_delta_packed_kernel():STRING
LOWmlx_lm/models/gated_delta.py532def gated_delta_kernel_unpacked(STRING
LOWmlx_lm/models/deepseek_v2.py56def yarn_find_correction_range(CODE
LOWmlx_lm/models/base.py64def quantized_scaled_dot_product_attention(CODE
LOWmlx_lm/models/base.py110def scaled_dot_product_attention(CODE
LOWmlx_lm/models/nemotron-nas.py85def _ffn_mult_to_intermediate_size(ffn_mult: float, n_embd: int) -> int:CODE
LOWmlx_lm/chat_templates/deepseek_v32.py83def tool_calls_from_openai_format(tool_calls):STRING
LOWtests/test_tuner_trainer.py52 def test_iterate_batches_seed(self):CODE
LOWtests/test_tuner_trainer.py135 def test_granitemoehybrid_backward(self):CODE
LOWtests/test_tuner_trainer.py190 def test_switch_layers_backward(self):CODE
LOWtests/test_tuner_trainer.py206 def test_group_expert_select_backward(self):CODE
LOWtests/test_tool_parsing.py196 def test_pythonic_single_quoted_args_with_commas(self):CODE
LOWtests/test_tool_parsing.py278 def test_pythonic_nested_args(self):CODE
LOWtests/test_tool_parsing.py298 def test_pythonic_parallel_calls(self):CODE
LOWtests/test_tool_parsing.py308 def test_pythonic_invalid_calls(self):CODE
LOWtests/test_tuner_utils.py26 def test_quantized_print_trainable_parameters(self):CODE
LOWtests/test_tuner_utils.py63 def test_print_trainable_parameters(self):CODE
LOWtests/test_tuner_utils.py119 def test_unknown_tensor_name_raises(self):CODE
LOWtests/test_tuner_utils.py131 def test_wrong_tensor_shape_raises(self):CODE
LOWtests/test_tuner_utils.py152 def test_base_weight_tensor_rejected(self):CODE
LOWtests/test_tuner_utils.py164 def test_valid_dora_adapter_loads(self):CODE
LOWtests/test_utils.py46 def test_load_config_decodes_tagged_floats(self):CODE
LOWtests/test_utils.py96 def test_make_shards_oversized_weight(self):CODE
LOWtests/test_utils.py157 def test_load_model_with_custom_get_classes(self):CODE
LOWtests/test_utils.py283 def test_infer_quant_config_unknown_packing(self):CODE
LOWtests/test_utils.py294 def test_load_model_with_mixed_bit_derived_mla_projection(self):CODE
LOW⚡tests/test_utils.py407 def test_model_file_blocked_by_default(self):STRING
LOW⚡tests/test_utils.py415 def test_model_file_loads_with_trust_remote_code(self):CODE
LOW⚡tests/test_utils.py423 def test_normal_model_unaffected_by_default(self):CODE
LOWtests/test_utils.py441 def test_compressed_tensors_known_formats(self):CODE
LOWtests/test_utils.py455 def test_compressed_tensors_float_quantized_is_rejected(self):CODE
LOWtests/test_datsets.py64 def test_completions_mask_prompt(self):CODE
LOWtests/test_tokenizers.py77 def test_detokenizers_are_independent(self):CODE
LOWtests/test_tokenizers.py102 def test_naive_detokenizer_holds_back_partial_characters(self):CODE
LOWtests/test_deepseek_v41.py30 def test_cached_matches_forward(self):CODE
LOWtests/test_generate.py36 def test_generate_step_processor_sees_prefilled_prompt(self):CODE
LOWtests/test_generate.py58 def test_generate_with_logit_bias(self):CODE
123 more matches not shown…
Empty Error Handlers19 hits · 95 pts
SeverityFileLineSnippetContext
HIGHmlx_lm/server.py487except QueueEmpty:CODE
HIGHmlx_lm/tokenizer_utils.py333except (ValueError, TypeError):CODE
HIGHmlx_lm/utils.py373except json.JSONDecodeError:CODE
HIGHmlx_lm/share.py259except Exception:CODE
HIGHmlx_lm/tool_parsers/longcat.py40except Exception:CODE
HIGHmlx_lm/tool_parsers/longcat.py45except Exception:CODE
HIGHmlx_lm/tool_parsers/longcat.py56except json.JSONDecodeError:CODE
HIGHmlx_lm/tool_parsers/qwen3_coder.py85except json.JSONDecodeError:CODE
HIGHmlx_lm/tool_parsers/minimax_m2.py145except json.JSONDecodeError:CODE
HIGHmlx_lm/tool_parsers/kimi_k2.py31except Exception:CODE
HIGHmlx_lm/tool_parsers/kimi_k2.py36except Exception:CODE
HIGHmlx_lm/tool_parsers/glm47.py45except Exception:CODE
HIGHmlx_lm/tool_parsers/glm47.py50except Exception:CODE
HIGHmlx_lm/tool_parsers/pythonic.py106except (ValueError, SyntaxError):CODE
HIGHmlx_lm/models/cache.py1624except ValueError:CODE
HIGHmlx_lm/models/gemma4_text.py637except (IndexError, ValueError):CODE
HIGHtests/test_server.py686except (BrokenPipeError, ConnectionResetError, OSError):CODE
HIGHtests/test_chat.py112except SystemExit:CODE
HIGHtests/test_chat.py169except SystemExit:CODE
AI Structural Patterns74 hits · 74 pts
SeverityFileLineSnippetContext
LOWmlx_lm/server.py1264CODE
LOWmlx_lm/generate.py304CODE
LOWmlx_lm/generate.py476CODE
LOWmlx_lm/generate.py1523CODE
LOWmlx_lm/convert.py85CODE
LOWmlx_lm/sample_utils.py13CODE
LOWmlx_lm/tuner/dora.py210CODE
LOWmlx_lm/tuner/dora.py224CODE
LOWmlx_lm/tuner/lora.py280CODE
LOWmlx_lm/models/granitemoe.py152CODE
LOWmlx_lm/models/olmo3.py163CODE
LOWmlx_lm/models/lille-130m.py108CODE
LOWmlx_lm/models/rope_utils.py127CODE
LOWmlx_lm/models/phi3.py156CODE
LOWmlx_lm/models/apertus.py133CODE
LOWmlx_lm/models/bitnet.py92CODE
LOWmlx_lm/models/bitnet.py142CODE
LOWmlx_lm/models/glm.py128CODE
LOWmlx_lm/models/openelm.py162CODE
LOWmlx_lm/models/dbrx.py186CODE
LOWmlx_lm/models/llama4.py206CODE
LOWmlx_lm/models/gemma3_text.py161CODE
LOWmlx_lm/models/afm7.py302CODE
LOWmlx_lm/models/afm7.py326CODE
LOWmlx_lm/models/afm7.py382CODE
LOWmlx_lm/models/gemma3n.py375CODE
LOWmlx_lm/models/hunyuan_v1_dense.py174CODE
LOWmlx_lm/models/olmo2.py147CODE
LOWmlx_lm/models/gpt2.py108CODE
LOWmlx_lm/models/gpt2.py168CODE
LOWmlx_lm/models/internlm2.py136CODE
LOWmlx_lm/models/mimo.py120CODE
LOWmlx_lm/models/lfm2_moe.py276CODE
LOWmlx_lm/models/Klear.py184CODE
LOWmlx_lm/models/helium.py121CODE
LOWmlx_lm/models/internlm3.py175CODE
LOWmlx_lm/models/qwen3_moe.py182CODE
LOWmlx_lm/models/starcoder2.py109CODE
LOWmlx_lm/models/minicpm.py141CODE
LOWmlx_lm/models/nemotron.py160CODE
LOWmlx_lm/models/phi3small.py238CODE
LOWmlx_lm/models/seed_oss.py125CODE
LOWmlx_lm/models/llama.py148CODE
LOWmlx_lm/models/jamba.py281CODE
LOWmlx_lm/models/qwen3_5.py240CODE
LOWmlx_lm/models/gemma2.py149CODE
LOWmlx_lm/models/gemma2.py201CODE
LOWmlx_lm/models/cohere2.py199CODE
LOWmlx_lm/models/lfm2.py242CODE
LOWmlx_lm/models/deepseek.py199CODE
LOWmlx_lm/models/minicpm3.py190CODE
LOWmlx_lm/models/youtu_llm.py179CODE
LOWmlx_lm/models/gemma.py122CODE
LOWmlx_lm/models/gemma.py171CODE
LOWmlx_lm/models/gpt_bigcode.py123CODE
LOWmlx_lm/models/qwen3_next.py381CODE
LOWmlx_lm/models/ministral3.py164CODE
LOWmlx_lm/models/qwen3.py137CODE
LOWmlx_lm/models/exaone.py114CODE
LOWmlx_lm/models/gpt_neox.py175CODE
14 more matches not shown…
Deep Nesting75 hits · 74 pts
SeverityFileLineSnippetContext
LOWmlx_lm/server.py121CODE
LOWmlx_lm/server.py656CODE
LOWmlx_lm/server.py904CODE
LOWmlx_lm/server.py1376CODE
LOWmlx_lm/generate.py476CODE
LOWmlx_lm/generate.py1910CODE
LOWmlx_lm/generate.py1355CODE
LOWmlx_lm/tokenizer_utils.py619CODE
LOWmlx_lm/tokenizer_utils.py663CODE
LOWmlx_lm/convert.py20CODE
LOWmlx_lm/utils.py409CODE
LOWmlx_lm/utils.py696CODE
LOWmlx_lm/utils.py1080CODE
LOWmlx_lm/share.py121CODE
LOWmlx_lm/share.py173CODE
LOWmlx_lm/share.py210CODE
LOWmlx_lm/manage.py40CODE
LOWmlx_lm/lora.py225CODE
LOWmlx_lm/tool_parsers/qwen3_coder.py37CODE
LOWmlx_lm/tool_parsers/minimax_m2.py30CODE
LOWmlx_lm/tool_parsers/minimax_m2.py91CODE
LOWmlx_lm/tool_parsers/minimax_m2.py166CODE
LOWmlx_lm/quant/awq.py248CODE
LOWmlx_lm/tuner/datasets.py178CODE
LOWmlx_lm/tuner/trainer.py221CODE
LOWmlx_lm/models/rope_utils.py291CODE
LOWmlx_lm/models/hunyuan.py294CODE
LOWmlx_lm/models/kimi_linear.py491CODE
LOWmlx_lm/models/muse_glimmer.py245CODE
LOWmlx_lm/models/gemma3n.py379CODE
LOWmlx_lm/models/glm4_moe.py319CODE
LOWmlx_lm/models/minimax_m3_vl.py474CODE
LOWmlx_lm/models/bailing_moe.py347CODE
LOWmlx_lm/models/deepseek_v32.py485CODE
LOWmlx_lm/models/bailing_hybrid.py660CODE
LOWmlx_lm/models/olmoe.py197CODE
LOWmlx_lm/models/bailing_moe_linear.py529CODE
LOWmlx_lm/models/rwkv7.py163CODE
LOWmlx_lm/models/nemotron_h.py450CODE
LOWmlx_lm/models/cache.py43CODE
LOWmlx_lm/models/cache.py82CODE
LOWmlx_lm/models/cache.py58CODE
LOWmlx_lm/models/cache.py1554CODE
LOWmlx_lm/models/phixtral.py187CODE
LOWmlx_lm/models/mimo_v2_flash.py323CODE
LOWmlx_lm/models/laguna.py352CODE
LOWmlx_lm/models/exaone_moe.py330CODE
LOWmlx_lm/models/bailing_moe_v3.py514CODE
LOWmlx_lm/models/jamba.py347CODE
LOWmlx_lm/models/dots1.py296CODE
LOWmlx_lm/models/step3p5.py407CODE
LOWmlx_lm/models/glm4_moe_lite.py384CODE
LOWmlx_lm/models/deepseek.py246CODE
LOWmlx_lm/models/kimi_k3.py898CODE
LOWmlx_lm/models/phimoe.py216CODE
LOWmlx_lm/models/gemma4_text.py505CODE
LOWmlx_lm/models/gemma4_text.py612CODE
LOWmlx_lm/models/mistral4.py389CODE
LOWmlx_lm/models/gpt_oss.py220CODE
LOWmlx_lm/models/afmoe.py355CODE
15 more matches not shown…
Self-Referential Comments8 hits · 24 pts
SeverityFileLineSnippetContext
MEDIUMmlx_lm/server.py907 # Define the progress callbackCOMMENT
MEDIUMmlx_lm/server.py1205 # Create the completion requestCOMMENT
MEDIUMmlx_lm/server.py1425 # Create the token generatorCOMMENT
MEDIUMmlx_lm/server.py1702 # Create a list of available modelsCOMMENT
MEDIUMmlx_lm/generate.py368 # Create the KV cache for generationCOMMENT
MEDIUMmlx_lm/generate.py525 # Create the KV cache for generationCOMMENT
MEDIUMmlx_lm/models/cache.py189 # Create an instance of cls without calling __init__COMMENT
MEDIUMmlx_lm/models/minicpm3.py128 # Create the full query and key tensors by combining the partsCOMMENT
Excessive Try-Catch Wrapping17 hits · 18 pts
SeverityFileLineSnippetContext
LOWmlx_lm/server.py450 except Exception as e:CODE
LOWmlx_lm/server.py708 except Exception as e:CODE
LOWmlx_lm/server.py776 except Exception as e:CODE
LOWmlx_lm/server.py1010 except Exception as e:CODE
LOWmlx_lm/server.py1432 except Exception as e:CODE
MEDIUMmlx_lm/server.py447def _run_generate(self):CODE
LOWmlx_lm/share.py259 except Exception:CODE
LOWmlx_lm/tool_parsers/longcat.py40 except Exception:CODE
LOWmlx_lm/tool_parsers/longcat.py45 except Exception:CODE
LOWmlx_lm/tool_parsers/kimi_k2.py31 except Exception:CODE
LOWmlx_lm/tool_parsers/kimi_k2.py36 except Exception:CODE
LOWmlx_lm/tool_parsers/glm47.py45 except Exception:CODE
LOWmlx_lm/tool_parsers/glm47.py50 except Exception:CODE
LOWmlx_lm/tool_parsers/glm47.py81 except Exception:CODE
LOWtests/test_server.py713 except Exception as e:CODE
MEDIUMbenchmarks/server_benchmark.py146 print(f"Error {response.status}: {error_body}")CODE
LOWbenchmarks/server_benchmark.py168 except Exception as e:CODE
Unused Imports17 hits · 17 pts
SeverityFileLineSnippetContext
LOWmlx_lm/__init__.py5CODE
LOWmlx_lm/__init__.py9CODE
LOWmlx_lm/__init__.py10CODE
LOWmlx_lm/__init__.py10CODE
LOWmlx_lm/__init__.py10CODE
LOWmlx_lm/__init__.py11CODE
LOWmlx_lm/tool_parsers/laguna.py11CODE
LOWmlx_lm/tool_parsers/laguna.py11CODE
LOWmlx_lm/tool_parsers/laguna.py11CODE
LOWmlx_lm/tuner/__init__.py3CODE
LOWmlx_lm/tuner/__init__.py3CODE
LOWmlx_lm/tuner/__init__.py3CODE
LOWmlx_lm/tuner/__init__.py4CODE
LOWmlx_lm/models/solar_open.py7CODE
LOWmlx_lm/models/bailing_moe_v3.py3CODE
LOWmlx_lm/models/qwen3_next.py3CODE
LOWmlx_lm/models/olmo.py14CODE
Docstring Block Structure2 hits · 10 pts
SeverityFileLineSnippetContext
HIGHmlx_lm/utils.py417 Load and initialize the model from a given path. Args: model_path (Path): The path to load the model fSTRING
HIGHmlx_lm/utils.py648 Load the model and tokenizer from a given path or a huggingface repository. Args: path_or_hf_repo (PatSTRING
Cross-Language Confusion2 hits · 10 pts
SeverityFileLineSnippetContext
HIGHmlx_lm/models/cache.py1695 self._lru.push(model, tokens, cache_type)CODE
HIGHtests/test_tool_parsing.py282 'ingredientList=[{"name": "noodles", "organic": true, "unit": null}], 'CODE
Redundant / Tautological Comments6 hits · 9 pts
SeverityFileLineSnippetContext
LOWmlx_lm/generate.py1801 # Check if we have sequences and add them to the prompt batchCOMMENT
LOWmlx_lm/perplexity.py180 # Print resultsCOMMENT
LOWmlx_lm/share.py246 # Check if any node has the dataCOMMENT
LOWmlx_lm/models/cache.py1576 # Check if we found a prefix at any pointCOMMENT
LOWmlx_lm/models/granitemoehybrid.py253 # Check if RoPE should be used based on position_embedding_typeCOMMENT
LOWmlx_lm/models/falcon_h1.py458 # Check if needs sanitizationCOMMENT
Modern Structural Boilerplate3 hits · 3 pts
SeverityFileLineSnippetContext
LOWmlx_lm/__init__.py13__all__ = [CODE
LOWmlx_lm/generate_utils.py8__all__ = ["BatchCounters", "BatchCountersSnapshot", "BatchStats"]CODE
LOWmlx_lm/tool_parsers/laguna.py13__all__ = ["parse_tool_call", "tool_call_start", "tool_call_end"]CODE
Modern AI Meta-Vocabulary1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUMmlx_lm/models/muse_glimmer.py6# text/agentic inference needs. Architecture verified against Meta's referenceCOMMENT
Over-Commented Block3 hits · 3 pts
SeverityFileLineSnippetContext
LOWmlx_lm/models/muse_glimmer.py1# Copyright © 2026 Apple Inc.COMMENT
LOWexamples/lora_config.yaml1# The path to the local model directory or Hugging Face repo.COMMENT
LOWexamples/lora_config.yaml81 dropout: 0.0COMMENT
Verbosity Indicators1 hit · 2 pts
SeverityFileLineSnippetContext
LOWmlx_lm/models/minimax.py309 # Step 2: Handle MoE expert weights restructuringCOMMENT
Structural Annotation Overuse1 hit · 2 pts
SeverityFileLineSnippetContext
LOWmlx_lm/models/minimax.py309 # Step 2: Handle MoE expert weights restructuringCOMMENT
Slop Phrases1 hit · 2 pts
SeverityFileLineSnippetContext
LOWexamples/tool_use.py14# An example tool, make sure to include a docstring and type hintsCOMMENT