GitHub - skorotkiewicz/grammatizator: A command-line story machine inspired by Roald Dahl's 1953 short story · GitHub
/" data-turbo-transient="true" />
Skip to content
Search or jump to...
Search code, repositories, users, issues, pull requests...
-->
Search
Clear
Search syntax tips
Provide feedback
--><br>We read every piece of feedback, and take your input very seriously.
Include my email address so I can be contacted
Cancel
Submit feedback
Saved searches
Use saved searches to filter your results more quickly
-->
Name
Query
To see all available qualifiers, see our documentation.
Cancel
Create saved search
Sign in
/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up
Appearance settings
Resetting focus
You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
{{ message }}
skorotkiewicz
grammatizator
Public
Notifications<br>You must be signed in to change notification settings
Fork
Star
main
BranchesTags
Go to file
CodeOpen more actions menu
Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit
History<br>2 Commits<br>2 Commits
docs
docs
README.md
README.md
grammatizator.py
grammatizator.py
View all files
Repository files navigation
The Great Automatic Grammatizator
"It can produce any type of story I desire simply by pressing the required button."<br>— Adolph Knipe, 1953
A command-line story machine inspired by Roald Dahl's 1953 short story. Works with any OpenAI-compatible API — local models, remote endpoints, whatever you're running.
Requirements
pip install openai
Python 3.8+. No other dependencies.
Quickstart
python grammatizator.py
On first run it asks three questions:
Base URL [http://192.168.0.124:8888/v1]: ← your endpoint<br>API key [not-needed]: ← or a real key if required<br>Model name: mistral ← whatever your server serves
Then press buttons. Pull the switch. Collect your story.
Configuration
You can skip the prompts entirely with environment variables:
export GRAMMATIZATOR_URL=http://192.168.0.124:8888/v1<br>export GRAMMATIZATOR_MODEL=mistral<br>export GRAMMATIZATOR_KEY=not-needed
python grammatizator.py
Or edit the three DEFAULT_* constants at the top of the file.
To re-enter connection details at any time:
python grammatizator.py --config
The Control Panel
Row<br>Purpose<br>Options
1 — Master<br>Genre<br>satirical, romantic, humorous, philosophical, erotic, historical, political, straight
2 — Basic<br>Theme<br>army life, pioneer days, civil war, wild west, seafaring, city crime, forbidden love…
3 — Style<br>Voice<br>classical, whimsical, racy, Hemingway, Faulkner, Joyce, feminine, pulp magazine
4 — Magazine<br>Target publication<br>Today's Woman, Reader's Digest, Saturday Evening Post, The New Yorker…
5 — Length<br>Output size<br>flash (~300w), short (~800w), standard (~1500w)
Pedal — Passion<br>Emotional intensity<br>1 restrained → 5 volcanic
Note on the passion pedal: Mr Bohlen once pressed too hard. The result was outrageous. Use with care.
How It Works
Each story is generated by your model, guided by a prompt assembled from your button selections. The machine faithfully replicates Knipe's original design specifications, including his secret trick of inserting one long, obscure word per story so that "the reader thinks the man is very wise and clever."
The Story
Dahl wrote The Great Automatic Grammatizator in 1953 — seventy years before large language models existed. It ends with a writer, children starving in the next room, hand creeping toward the contract.
Give us strength, Oh Lord, to let our children starve.
A. Knipe / J. Bohlen Inc., Electrical Engineers
About
A command-line story machine inspired by Roald Dahl's 1953 short story
Resources
Readme
Uh oh!
There was an error while loading. Please reload this page.
Activity
Stars
stars
Watchers
watching
Forks
forks
Report repository
Contributors
Uh oh!
There was an error while loading. Please reload this page.
Languages
Python<br>100.0%
You can’t perform that action at this time.