This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| """ | |
| microreasoning.py — 1984 words. 12 steps of associative resonance. | |
| not a transformer. not pretending to be. | |
| why? good question. really, why does this thing exist? | |
| because someone wanted to generate one coherent word per step | |
| instead of the gibberish we all love from char-level models. | |
| so here's the deal: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * neoleo.c -- Language Emergent Organism (single-file edition) | |
| * | |
| * Complete autonomous digital organism in one C file. | |
| * D.N.A. from mini-arianna. Arianna -> Leo. Mother -> Son. | |
| * | |
| * Build: cc neoleo.c -O2 -lm -lsqlite3 -lpthread -o neoleo | |
| * Run: ./neoleo | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define _GNU_SOURCE | |
| /* | |
| * doe.c — Democracy of Experts | |
| * | |
| * inference architecture with a living LoRA parliament. | |
| * indexes any GGUF read-only. learns by living, not by training. | |
| * | |
| * θ = ε + γ + αδ | |
| * ε = indexed weights (read-only substrate) | |
| * γ = LoRA personality (living experts, Hebbian-trained via NOTORCH) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * lee.c v7 — Vision-Language Model in pure C | |
| * | |
| * Named after Bruce Lee (the only man who beat Chuck Norris) | |
| * and Minhyeok Lee (whose self-identity framework gives Chuck his soul). | |
| * | |
| * Sees images. Speaks words. Adds numbers. Zero dependencies. | |
| * Tape-based autograd with arena bump allocator. | |
| * | |
| * Architecture: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import math | |
| import random | |
| random.seed(42) | |
| # ----------------------------------------------------------------------------- | |
| # Tape-based Autograd Engine | |
| # ----------------------------------------------------------------------------- | |
| class Tape: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //go:build ignore | |
| /* | |
| * molequla.c | |
| * A dependency-free, single-file, continually-learning GPT organism in pure C. | |
| * | |
| * Compile: gcc -O2 -o molequla molequla.c -lsqlite3 -lpthread -lm | |
| * With BLAS: gcc -O2 -DUSE_BLAS -o molequla molequla.c -lsqlite3 -lpthread -lm -lopenblas | |
| * macOS: gcc -O2 -DUSE_BLAS -o molequla molequla.c -lsqlite3 -lpthread -lm -framework Accelerate | |
| * |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| # -*- coding: utf-8 -*- | |
| """ | |
| molequla.py | |
| A single-file, async, continually-learning GPT organism. One dependency: numpy. | |
| - Trains on nonames.txt (one sentence per line) | |
| - Keeps SQLite memory (tiny chat loop) | |
| - Maintains a bounded corpus reservoir (never bloats) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>molequla.js — a GPT organism in your browser</title> | |
| </head> | |
| <body> | |
| <!-- | |
| molequla.html |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| The most atomic way to train and run inference for a GPT in pure, dependency-free Python. | |
| This file is the complete algorithm. | |
| Everything else is just efficiency. | |
| @karpathy | |
| """ | |
| import os # os.path.exists | |
| import math # math.log, math.exp |