- Python 100%
terminal-cat #
A tiny nonverbal local-LLM cat toy.
Run #
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
export CAT_LLM_BASE_URL=http://127.0.0.1:8080/v1
export CAT_LLM_MODEL=local-model
python cat.py
The endpoint must provide an OpenAI-compatible /chat/completions API with tool/function calling support.
Edit prompts/cat.md, prompts/environment.md, and prompts/rules.md while the program is stopped to change the cat and its world.
Commands: pet, feed, pick up, spray, quit. Pressing Enter also advances immediately; otherwise the cat acts automatically every CAT_TICK_SECONDS seconds (default 8).
Memory and roaming #
The cat keeps a rolling memory of the last 10 complete turns. A turn contains a stimulus (time passing or a user command), the cat's nonverbal action, and the resulting observable scene. Those turns are injected back into the next model request so the cat can maintain short-term continuity alongside its explicit body state.
roam takes a freeform destination argument, so the model can choose things such as the kitchen, under the sofa, toward the window, or the mysterious paper bag without gaining a general-purpose verbal channel. Roaming also updates the cat's coarse explicit location state.
Each turn uses two local-model inferences: the first is forced to choose exactly one cat-action tool, and the second is a constrained narrator that turns the tool result into short, externally observable prose. The narrator is instructed not to expose the cat's thoughts or human-language dialogue.
Credits #
Project was generated with ChatGPT, GPT-5.6 Sol, running in the ChatGPT product harness, in September 2026.
The cat itself is whatever local language model you configure with CAT_LLM_MODEL; ChatGPT is not required at runtime.
License #
0BSD (BSD Zero Clause License). You may use, copy, modify, and distribute the project without an attribution requirement. See LICENSE.
Configuration #
Copy the example config:
cp .env.example .env
For a default local llama.cpp server, the included values should work as-is:
CAT_LLM_BASE_URL=http://127.0.0.1:8080/v1
CAT_LLM_MODEL=local-model
CAT_LLM_API_KEY=
CAT_TURN_INTERVAL=8
The real .env is ignored by Git.
How a turn works #
The Cat receives its personality/environment prompts, its private hunger meter, persistent physical state, and the last 10 complete turns of stimulus + action + observable result. It must choose one nonverbal tool action.
A second model call acts only as a narrator. It receives the chosen action and observable scene state, but not the hidden hunger meter, and turns instructions such as You have meowed. Describe the scene. into the prose shown in the terminal.
Hunger is intentionally never displayed to the user. There is no status command: the user can infer hunger only from The Cat's behaviour.
Physical state persists. pick up holds the cat until put down, or until a held cat uses swat(user) / bite(user), which makes the user reflexively put it down.