AI · zero-dependency · MIT

larzmarkov

A small Markov-chain text generator, from scratch.

Trains a word-to-next-word chain from a corpus of lines, then generates new text by randomly walking it - the same core idea behind autocomplete and classic chatbots, in about 25 real lines. Zero network, zero deps - runs even on the bare-metal LarzOS kernel.

larzscript pkg install markov
View on GitHub →Learn the stack

What you get

Try it

import "markov" as markov
let chain = markov.train(["the quick brown fox", "the lazy dog sleeps", "the quick dog runs"])
print(markov.generate(chain, 6))
Output
lazy dog runs

Why it's in the Larz Stack

larzmarkov is a real Larzscript package (larzscript pkg install markov) - money-native, zero dependencies, the same language as the rest of the estate, not a separate Python runtime. It composes with the rest of the Larz Stack and the Larz framework.