tinytowns

A tiny GPT that makes up new town names in the style of real ones. It runs in your browser, with no server and no API key.

It learned the letter patterns of 128,435 real place names. It does not know which places exist, so most names it writes are new.

Type some letters. The bars show the model's guesses for the next letter.

The playground needs JavaScript.

Use it in your code

For a game, a map maker or a story tool. One file, no dependencies, in a browser or Node 18+.

npm install @dave8172/tinytowns
import TinyTowns from "@dave8172/tinytowns";

const model = await TinyTowns.load(TinyTowns.url("tinytowns-small"));
model.sample();                               // a new name
model.sample("port", { temperature: 0.8 });   // one that starts with "port"

Sizes, temperature, repeatable names and offline use: the guide on GitHub.

How small is it?

The three sizes have 4,572, 105,052 and about 1 million numbers. A chat model has billions. Every one of them can be read: the code and each build step are public.

Place names: GeoNames, CC BY 4.0. Fonts: Pixelify Sans, Jersey 10 and Atkinson Hyperlegible Next, SIL Open Font License (in fonts/). Made by dave8172.