14MB foundation model for tiny devices; phones, wearables, smart home, and robots.
This report presents the forensic synthetic code analysis of cactus-compute/needle, a Python project with 4,725 GitHub stars. SynthScan v2.0 examined 5,644 lines of code across 31 source files, recording 59 pattern matches distributed across 6 syntactic categories. The overall adjusted score of 11.1 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).
Longitudinal tracking requires multiple scan runs. Once this repository is re-scanned after new commits land, this chart will visualise how the synthetic code signal evolves over time — enabling you to detect whether AI authorship is growing, stabilising, or being actively corrected by human engineers.
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 59 distinct pattern matches across 6 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 | needle/model/quantize.py | 70 | def quantize_params_configured(params): | CODE |
| LOW | needle/model/tokenizer.py | 82 | def _download_tokenizer_from_hf(prefix): | CODE |
| LOW | tests/test_inference.py | 21 | def test_structured_extraction(): | CODE |
| LOW | tests/test_inference.py | 72 | def test_extract_keeps_agent_tools(): | CODE |
| LOW | tests/test_generate.py | 7 | def test_parse_array_variants(): | CODE |
| LOW | tests/test_generate.py | 19 | def test_collect_tools_dedups_by_name(): | CODE |
| LOW | tests/test_generate.py | 27 | def test_generate_examples_attaches_tools(monkeypatch): | CODE |
| LOW | tests/test_generate.py | 39 | def test_generate_examples_requires_api_key(monkeypatch): | CODE |
| LOW | tests/test_generate.py | 47 | def test_openrouter_url_can_be_overridden_from_environment(monkeypatch): | CODE |
| LOW⚡ | tests/test_generate.py | 71 | def test_generate_dataset_hits_target_concurrently(monkeypatch): | CODE |
| LOW⚡ | tests/test_generate.py | 81 | def test_generate_dataset_dedups_and_terminates(monkeypatch): | CODE |
| LOW⚡ | tests/test_generate.py | 91 | def test_augment_jsonl_appends_generated(monkeypatch, tmp_path): | CODE |
| LOW | tests/test_build.py | 14 | def test_build_exports_loadable_cact(tiny_checkpoint, tmp_path): | CODE |
| LOW | tests/test_build.py | 39 | def test_export_round_trips_a_projection(tiny_checkpoint, tmp_path): | CODE |
| LOW | tests/test_finetune.py | 34 | def test_finetune_writes_adapter(tiny_checkpoint, tmp_path): | CODE |
| LOW | tests/test_finetune.py | 56 | def test_finetune_then_build_merges(tiny_checkpoint, tmp_path): | CODE |
| LOW | tests/test_render.py | 13 | def test_render_example_markers(): | CODE |
| LOW | tests/test_render.py | 30 | def test_render_example_accepts_function_calls_alias(): | CODE |
| LOW | tests/test_render.py | 38 | def test_encode_loss_mask_targets_only(tok): | CODE |
| LOW | tests/test_render.py | 55 | def test_load_jsonl_shapes_and_skips_invalid(tok, tmp_path): | CODE |
| LOW | tests/test_tools.py | 13 | def test_basic_schema_types_and_required(): | CODE |
| LOW | tests/test_tools.py | 26 | def test_defaults_are_optional(): | CODE |
| LOW | tests/test_tools.py | 35 | def test_literal_list_and_dict_types(): | CODE |
| LOW | tests/test_tools.py | 53 | def test_optional_annotation_not_required(): | CODE |
| LOW | tests/test_tools.py | 86 | def test_field_constraints_and_docstring_args(): | CODE |
| LOW | tests/test_tools.py | 105 | def test_docstring_description_falls_back_to_args(): | CODE |
| LOW | tests/test_tools.py | 117 | def test_pydantic_model_schema(): | CODE |
| LOW | tests/test_tools.py | 133 | def test_tool_decorator_preserves_callable(): | CODE |
| LOW | tests/test_lora.py | 4 | def test_lora_target_paths_selects_projection_kernels(): | CODE |
| LOW | tests/test_lora.py | 20 | def test_init_lora_shapes_and_zero_b(): | CODE |
| LOW | tests/test_lora.py | 34 | def test_merge_lora_is_identity_when_b_zero(): | CODE |
| LOW | tests/test_lora.py | 48 | def test_merge_lora_adds_scaled_delta(): | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | needle/__init__.py | 114 | except Exception as exc: | CODE |
| LOW | needle/cli.py | 43 | except Exception: | CODE |
| LOW | needle/cli.py | 84 | except Exception: | CODE |
| LOW | needle/playground/server.py | 94 | except Exception as exc: | CODE |
| LOW | needle/playground/server.py | 169 | except Exception as exc: | CODE |
| MEDIUM | needle/playground/server.py | 133 | def do_POST(self): | CODE |
| LOW | needle/agent/tools.py | 114 | except Exception: | CODE |
| LOW | needle/model/tokenizer.py | 108 | except Exception as e: | CODE |
| LOW | needle/model/finetune.py | 124 | except Exception as exc: | CODE |
| LOW | tests/conftest.py | 16 | except Exception: | CODE |
| MEDIUM | tests/conftest.py | 7 | def _engine_available(): | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | needle/__init__.py | 78 | CODE | |
| LOW | needle/cli.py | 18 | CODE | |
| LOW | needle/cli.py | 97 | CODE | |
| LOW | needle/cli.py | 54 | CODE | |
| LOW | needle/playground/server.py | 114 | CODE | |
| LOW | needle/playground/server.py | 133 | CODE | |
| LOW | needle/model/export.py | 317 | CODE | |
| LOW | needle/model/export.py | 396 | CODE | |
| LOW | needle/model/finetune.py | 92 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | needle/__init__.py | 4 | CODE | |
| LOW | needle/__init__.py | 6 | CODE | |
| LOW | needle/__init__.py | 6 | CODE | |
| LOW | needle/model/quantize.py | 2 | CODE | |
| LOW | needle/model/export.py | 84 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | needle/__init__.py | 9 | __all__ = ["Needle", "tool", "Field", "extract", "__version__"] | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | needle/agent/tools.py | 18 | CODE |