Repository Analysis

karpathy/nanochat

The best ChatGPT that $100 can buy.

28.9 Moderate AI signal View on GitHub
28.9
Adjusted Score
28.9
Raw Score
100%
Time Factor
2026-05-05
Last Push
54,381
Stars
Python
Language
11,877
Lines of Code
47
Files
143
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 0HIGH 0MEDIUM 95LOW 48

Pattern Findings

143 matches across 10 categories. Click a row to expand file-level details.

Decorative Section Separators92 hits · 282 pts
SeverityFileLineSnippet
MEDIUMtasks/smoltalk.py25 # ---------------------------------------------------------------------
MEDIUMtasks/smoltalk.py41 # ---------------------------------------------------------------------
MEDIUMtests/test_engine.py12# -----------------------------------------------------------------------------
MEDIUMtests/test_attention_fallback.py48# =============================================================================
MEDIUMtests/test_attention_fallback.py50# =============================================================================
MEDIUMtests/test_attention_fallback.py251# =============================================================================
MEDIUMtests/test_attention_fallback.py253# =============================================================================
MEDIUMtests/test_attention_fallback.py337# =============================================================================
MEDIUMtests/test_attention_fallback.py339# =============================================================================
MEDIUMnanochat/execution.py35# -----------------------------------------------------------------------------
MEDIUMnanochat/dataset.py19# -----------------------------------------------------------------------------
MEDIUMnanochat/dataset.py29# -----------------------------------------------------------------------------
MEDIUMnanochat/dataset.py83# -----------------------------------------------------------------------------
MEDIUMnanochat/tokenizer.py32# -----------------------------------------------------------------------------
MEDIUMnanochat/tokenizer.py157# -----------------------------------------------------------------------------
MEDIUMnanochat/tokenizer.py387# -----------------------------------------------------------------------------
MEDIUMnanochat/engine.py23# -----------------------------------------------------------------------------
MEDIUMnanochat/engine.py81# -----------------------------------------------------------------------------
MEDIUMnanochat/engine.py139# -----------------------------------------------------------------------------
MEDIUMnanochat/engine.py158# -----------------------------------------------------------------------------
MEDIUMnanochat/flash_attention.py20# =============================================================================
MEDIUMnanochat/flash_attention.py22# =============================================================================
MEDIUMnanochat/flash_attention.py66# =============================================================================
MEDIUMnanochat/flash_attention.py68# =============================================================================
MEDIUMnanochat/flash_attention.py104# =============================================================================
MEDIUMnanochat/flash_attention.py106# =============================================================================
MEDIUMnanochat/flash_attention.py180# =============================================================================
MEDIUMnanochat/flash_attention.py182# =============================================================================
MEDIUMnanochat/core_eval.py14# -----------------------------------------------------------------------------
MEDIUMnanochat/optim.py15# -----------------------------------------------------------------------------
MEDIUMnanochat/optim.py52# -----------------------------------------------------------------------------
MEDIUMnanochat/optim.py150# -----------------------------------------------------------------------------
MEDIUMnanochat/optim.py295# -----------------------------------------------------------------------------
MEDIUMnanochat/checkpoint_manager.py146# -----------------------------------------------------------------------------
MEDIUMnanochat/report.py201# -----------------------------------------------------------------------------
MEDIUMnanochat/report.py391# -----------------------------------------------------------------------------
MEDIUMscripts/chat_eval.py26# -----------------------------------------------------------------------------
MEDIUMscripts/chat_eval.py83# -----------------------------------------------------------------------------
MEDIUMscripts/chat_eval.py155# -----------------------------------------------------------------------------
MEDIUMscripts/chat_eval.py179# -----------------------------------------------------------------------------
MEDIUMscripts/base_train.py39# -----------------------------------------------------------------------------
MEDIUMscripts/base_train.py82# -----------------------------------------------------------------------------
MEDIUMscripts/base_train.py119# -----------------------------------------------------------------------------
MEDIUMscripts/base_train.py126# -----------------------------------------------------------------------------
MEDIUMscripts/base_train.py164# -----------------------------------------------------------------------------
MEDIUMscripts/base_train.py242# -----------------------------------------------------------------------------
MEDIUMscripts/base_train.py248# -----------------------------------------------------------------------------
MEDIUMscripts/base_train.py306# -----------------------------------------------------------------------------
MEDIUMscripts/base_train.py322# -----------------------------------------------------------------------------
MEDIUMscripts/base_train.py328# -----------------------------------------------------------------------------
MEDIUMscripts/base_train.py335# -----------------------------------------------------------------------------
MEDIUMscripts/base_train.py388# -----------------------------------------------------------------------------
MEDIUMscripts/base_train.py505 # -------------------------------------------------------------------------
MEDIUMscripts/base_train.py545 # -------------------------------------------------------------------------
MEDIUMscripts/chat_rl.py30# -----------------------------------------------------------------------------
MEDIUMscripts/chat_rl.py62# -----------------------------------------------------------------------------
MEDIUMscripts/chat_rl.py77# -----------------------------------------------------------------------------
MEDIUMscripts/chat_rl.py148# -----------------------------------------------------------------------------
MEDIUMscripts/chat_rl.py193# -----------------------------------------------------------------------------
MEDIUMscripts/base_eval.py42# -----------------------------------------------------------------------------
32 more matches not shown…
Hyper-Verbose Identifiers15 hits · 15 pts
SeverityFileLineSnippet
LOWtests/test_engine.py158def test_multi_sample_first_token_diversity():
LOWtests/test_engine.py201def test_seed_reproducibility():
LOWtests/test_engine.py214def test_temperature_zero_determinism():
LOWtests/test_engine.py226def test_max_tokens_respected():
LOWtests/test_engine.py249def test_different_seeds_introduce_variation_when_temperature_nonzero():
LOWtests/test_attention_fallback.py155 def test_kvcache_single_token(self):
LOWtests/test_attention_fallback.py182 def test_kvcache_single_token_sliding_window(self):
LOWtests/test_attention_fallback.py215 def test_backward_gradients_match(self):
LOWnanochat/ui.html386 async function generateAssistantResponse() {
LOWnanochat/dataloader.py74def tokenizing_distributed_data_loader_with_state_bos_bestfit(
LOWnanochat/dataloader.py163def tokenizing_distributed_data_loader_bos_bestfit(*args, **kwargs):
LOWnanochat/checkpoint_manager.py23def _patch_missing_config_keys(model_config_kwargs):
LOWnanochat/gpt.py268 def _precompute_rotary_embeddings(self, seq_len, head_dim, base=100000, device=None):
LOWscripts/chat_sft.py187def sft_data_generator_bos_bestfit(split, buffer_size=100):
LOWdev/gen_synthetic_data.py312def sample_diversity_elements(rng):
Deep Nesting14 hits · 14 pts
SeverityFileLineSnippet
LOWtasks/customjson.py17
LOWnanochat/execution.py214
LOWnanochat/dataset.py84
LOWnanochat/tokenizer.py225
LOWnanochat/tokenizer.py266
LOWnanochat/engine.py176
LOWnanochat/engine.py282
LOWnanochat/dataloader.py25
LOWnanochat/dataloader.py74
LOWnanochat/report.py251
LOWscripts/chat_eval.py88
LOWscripts/chat_web.py306
LOWscripts/base_eval.py178
LOWscripts/chat_sft.py187
AI Slop Vocabulary4 hits · 9 pts
SeverityFileLineSnippet
LOWnanochat/tokenizer.py321 # simple string => simply add the tokens
LOWnanochat/tokenizer.py328 # string part => simply add the tokens
LOWnanochat/gpt.py480 # inference: just return the logits directly
MEDIUMdev/gen_synthetic_data.py40# Load the comprehensive knowledge base
Redundant / Tautological Comments4 hits · 7 pts
SeverityFileLineSnippet
LOWnanochat/engine.py54 # Check if it's a pure math expression (old behavior)
LOWnanochat/engine.py60 # Check if it's a string operation we support
LOWnanochat/report.py34 # Check if repo is dirty (has uncommitted changes)
LOWruns/scaling_laws.sh34# Check if a run already exists in results
Excessive Try-Catch Wrapping5 hits · 6 pts
SeverityFileLineSnippet
LOWnanochat/engine.py41 except Exception as e:
MEDIUMnanochat/engine.py35def eval_with_timeout(formula, max_time=3):
LOWnanochat/flash_attention.py37 except Exception:
LOWscripts/chat_web.py371 except Exception as e:
LOWdev/gen_synthetic_data.py461 except Exception as e:
Over-Commented Block5 hits · 5 pts
SeverityFileLineSnippet
LOWtasks/spellingbee.py301 # print(ex['messages'][1]['content'])
LOWruns/speedrun.sh1#!/bin/bash
LOWruns/speedrun.sh21# install uv (if not already installed)
LOWruns/speedrun.sh41
LOWruns/runcpu.sh61# Sometimes the model likes it if you first say Hi before you ask it questions.
Self-Referential Comments1 hit · 3 pts
SeverityFileLineSnippet
MEDIUMscripts/chat_eval.py160 # Create the evaluation object
Unused Imports2 hits · 2 pts
SeverityFileLineSnippet
LOWnanochat/gpt.py15
LOWscripts/chat_cli.py8
Slop Phrases1 hit · 1 pts
SeverityFileLineSnippet
LOWscripts/chat_rl.py112 seed=seed, # must make sure to change the seed for each sampling step