The best ChatGPT that $100 can buy.
This report summarizes scanner evidence for karpathy/nanochat, a Python project with 58,545 GitHub stars. SynthScan examined 9,834 lines of code across 45 source files, recording 149 pattern matches distributed across 14 syntactic categories. The legacy adjusted pattern signal is 34.1 (High 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.
Use each vector to guide manual verification of the underlying findings.
Can maintainers explain intent, assumptions, and trade-offs? 59 finding(s).
Are imports declared and package/API names verified? 4 finding(s).
Are wrappers, guards, and repeated structures necessary? 122 finding(s).
Which changes need focused human review? 149 finding(s).
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.
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.
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.
The scanner identified 149 distinct pattern matches across 14 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.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | tasks/smoltalk.py | 24 | # --------------------------------------------------------------------- | COMMENT |
| MEDIUM | tasks/smoltalk.py | 40 | # --------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_engine.py | 12 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | tests/test_attention_fallback.py | 48 | # ============================================================================= | COMMENT |
| MEDIUM | tests/test_attention_fallback.py | 50 | # ============================================================================= | COMMENT |
| MEDIUM | tests/test_attention_fallback.py | 251 | # ============================================================================= | COMMENT |
| MEDIUM | tests/test_attention_fallback.py | 253 | # ============================================================================= | COMMENT |
| MEDIUM | tests/test_attention_fallback.py | 337 | # ============================================================================= | COMMENT |
| MEDIUM | tests/test_attention_fallback.py | 339 | # ============================================================================= | COMMENT |
| MEDIUM | nanochat/execution.py | 30 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | nanochat/dataset.py | 19 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | nanochat/dataset.py | 29 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | nanochat/dataset.py | 83 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | nanochat/tokenizer.py | 28 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | nanochat/tokenizer.py | 261 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | nanochat/engine.py | 23 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | nanochat/engine.py | 81 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | nanochat/engine.py | 139 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | nanochat/engine.py | 158 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | nanochat/flash_attention.py | 20 | # ============================================================================= | COMMENT |
| MEDIUM | nanochat/flash_attention.py | 22 | # ============================================================================= | COMMENT |
| MEDIUM | nanochat/flash_attention.py | 74 | # ============================================================================= | COMMENT |
| MEDIUM | nanochat/flash_attention.py | 76 | # ============================================================================= | COMMENT |
| MEDIUM | nanochat/flash_attention.py | 112 | # ============================================================================= | COMMENT |
| MEDIUM | nanochat/flash_attention.py | 114 | # ============================================================================= | COMMENT |
| MEDIUM | nanochat/flash_attention.py | 188 | # ============================================================================= | COMMENT |
| MEDIUM | nanochat/flash_attention.py | 190 | # ============================================================================= | COMMENT |
| MEDIUM | nanochat/core_eval.py | 14 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | nanochat/optim.py | 17 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | nanochat/optim.py | 65 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | nanochat/optim.py | 182 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | nanochat/checkpoint_manager.py | 145 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/infer_bench.py | 46 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/infer_bench.py | 95 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/infer_bench.py | 124 | # ------------------------------------------------------------------------ | COMMENT |
| MEDIUM | scripts/infer_bench.py | 182 | # ------------------------------------------------------------------------ | COMMENT |
| MEDIUM | scripts/infer_bench.py | 197 | # ------------------------------------------------------------------------ | COMMENT |
| MEDIUM | scripts/chat_eval.py | 25 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/chat_eval.py | 82 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/chat_eval.py | 154 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/chat_eval.py | 177 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/base_train.py | 39 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/base_train.py | 82 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/base_train.py | 119 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/base_train.py | 126 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/base_train.py | 164 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/base_train.py | 242 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/base_train.py | 248 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/base_train.py | 306 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | scripts/base_train.py | 322 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | scripts/base_train.py | 328 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM⚡ | scripts/base_train.py | 335 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/base_train.py | 388 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/base_train.py | 505 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/base_train.py | 545 | # ------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/chat_rl.py | 30 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/chat_rl.py | 62 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/chat_rl.py | 77 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/chat_rl.py | 148 | # ----------------------------------------------------------------------------- | COMMENT |
| MEDIUM | scripts/chat_rl.py | 193 | # ----------------------------------------------------------------------------- | COMMENT |
| 20 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/test_engine.py | 158 | def test_multi_sample_first_token_diversity(): | CODE |
| LOW | tests/test_engine.py | 201 | def test_seed_reproducibility(): | CODE |
| LOW | tests/test_engine.py | 214 | def test_temperature_zero_determinism(): | CODE |
| LOW | tests/test_engine.py | 226 | def test_max_tokens_respected(): | CODE |
| LOW | tests/test_engine.py | 249 | def test_different_seeds_introduce_variation_when_temperature_nonzero(): | CODE |
| LOW | tests/test_tokenizer.py | 31 | def test_encode_decode_roundtrip(tokenizer): | CODE |
| LOW | tests/test_tokenizer.py | 47 | def test_encode_prepend_append(tokenizer): | CODE |
| LOW | tests/test_tokenizer.py | 61 | def test_render_conversation_masks(tokenizer): | CODE |
| LOW | tests/test_tokenizer.py | 82 | def test_render_conversation_system_message_merged(tokenizer): | CODE |
| LOW | tests/test_tokenizer.py | 95 | def test_render_conversation_tool_parts(tokenizer): | CODE |
| LOW | tests/test_tokenizer.py | 117 | def test_render_conversation_truncation(tokenizer): | CODE |
| LOW | tests/test_tokenizer.py | 126 | def test_render_for_completion(tokenizer): | CODE |
| LOW | tests/test_optim.py | 48 | def test_adamw_matches_torch_reference(): | CODE |
| LOW | tests/test_optim.py | 99 | def test_muon_update_is_orthogonalized(): | CODE |
| LOW | tests/test_execution.py | 20 | def test_exception_is_captured(): | CODE |
| LOW | tests/test_execution.py | 26 | def test_timeout_kills_infinite_loop(): | CODE |
| LOW⚡ | tests/test_execution.py | 48 | def test_destructive_functions_disabled(evil): | CODE |
| LOW⚡ | tests/test_execution.py | 58 | def test_writes_go_to_tempdir(): | CODE |
| LOW⚡ | tests/test_execution.py | 64 | def test_environment_is_scrubbed(): | CODE |
| LOW⚡ | tests/test_execution.py | 73 | def test_tricky_string_content(): | CODE |
| LOW | tests/test_attention_fallback.py | 155 | def test_kvcache_single_token(self): | CODE |
| LOW | tests/test_attention_fallback.py | 182 | def test_kvcache_single_token_sliding_window(self): | CODE |
| LOW | tests/test_attention_fallback.py | 215 | def test_backward_gradients_match(self): | CODE |
| LOW | tests/test_tasks.py | 46 | def test_mixture_covers_all_examples_deterministically(): | CODE |
| LOW | tests/test_tasks.py | 60 | def test_mixture_oversampling(): | CODE |
| LOW | tests/test_tasks.py | 73 | def test_hub_dataset_shuffle_matches_numpy(): | CODE |
| LOW | tests/test_tasks.py | 84 | def test_render_mc_letter_binding(): | CODE |
| LOW | nanochat/tokenizer.py | 129 | def decode_single_token_bytes(self, token_id): | CODE |
| LOW | nanochat/dataloader.py | 74 | def tokenizing_distributed_data_loader_with_state_bos_bestfit( | CODE |
| LOW | nanochat/dataloader.py | 163 | def tokenizing_distributed_data_loader_bos_bestfit(*args, **kwargs): | CODE |
| LOW | nanochat/checkpoint_manager.py | 22 | def _patch_missing_config_keys(model_config_kwargs): | CODE |
| LOW | nanochat/gpt.py | 270 | def _precompute_rotary_embeddings(self, seq_len, head_dim, base=100000, device=None): | CODE |
| LOW | scripts/chat_sft.py | 180 | def sft_data_generator_bos_bestfit(split, buffer_size=100): | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tasks/common.py | 45 | CODE | |
| LOW | nanochat/dataset.py | 84 | CODE | |
| LOW | nanochat/tokenizer.py | 96 | CODE | |
| LOW | nanochat/tokenizer.py | 140 | CODE | |
| LOW | nanochat/engine.py | 176 | CODE | |
| LOW | nanochat/engine.py | 277 | CODE | |
| LOW | nanochat/dataloader.py | 25 | CODE | |
| LOW | nanochat/dataloader.py | 74 | CODE | |
| LOW | scripts/chat_eval.py | 87 | CODE | |
| LOW | scripts/base_eval.py | 128 | CODE | |
| LOW | scripts/chat_sft.py | 180 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | nanochat/engine.py | 54 | # Check if it's a pure math expression (old behavior) | COMMENT |
| LOW | nanochat/engine.py | 60 | # Check if it's a string operation we support | COMMENT |
| LOW⚡ | runs/scaling_laws.sh | 34 | # Check if a run already exists in results | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | nanochat/dataset.py | 122 | except: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | nanochat/tokenizer.py | 195 | # simple string => simply add the tokens | COMMENT |
| LOW | nanochat/tokenizer.py | 202 | # string part => simply add the tokens | COMMENT |
| LOW | nanochat/gpt.py | 523 | # inference: just return the logits directly | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | nanochat/engine.py | 41 | except Exception as e: | CODE |
| MEDIUM | nanochat/engine.py | 35 | def eval_with_timeout(formula, max_time=3): | CODE |
| LOW | nanochat/flash_attention.py | 45 | except Exception: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | nanochat/gpt.py | 15 | CODE | |
| LOW | nanochat/gpt.py | 22 | CODE | |
| LOW | scripts/chat_cli.py | 8 | CODE | |
| LOW | scripts/base_eval.py | 29 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | nanochat/execution.py | 134 | CODE | |
| LOW | nanochat/fp8.py | 154 | CODE | |
| LOW | scripts/base_eval.py | 123 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | nanochat/core_eval.py | 175 | # Sample few-shot examples (excluding current item) | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | scripts/chat_eval.py | 159 | # Create the evaluation object | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | runs/speedrun.sh | 1 | #!/bin/bash | COMMENT |
| LOW | runs/speedrun.sh | 21 | # install uv (if not already installed) | COMMENT |
| LOW | runs/speedrun.sh | 41 | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | nanochat/common.py | 69 | logger = logging.getLogger(__name__) | CODE |
| LOW | nanochat/checkpoint_manager.py | 17 | logger = logging.getLogger(__name__) | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | scripts/chat_rl.py | 112 | seed=seed, # must make sure to change the seed for each sampling step | CODE |