// Management · RimWorld Mod
Fiction Primer
Generates short, character-driven fiction at key story moments using an LLM.
Generates short, character-driven fiction at key story moments using an LLM. The mod hooks into four events:
- Colony start: a full-screen primer dramatizing how your starting colonists arrived, drawing on each pawn's traits, skills, backstory, and xenotype, and on the chosen scenario.
- Pawn deaths: brief epitaphs colored by the cause and circumstances of each loss.
- Pawn arrivals: first-impression vignettes when a new colonist joins (recruit, refugee, drop pod, wanderer, ritual, etc.).
- Mental breaks: prose snapshots of the moment a pawn snaps.
All generated prose is archived in the letter history and on a Memorial Wall — a chronological, filterable view of every fiction moment in your colony. It's opened from the History tab, in the Statistics sub-tab.
REQUIRES YOUR OWN LLM PROVIDER. This mod sends prompts to an API endpoint you configure — it does not include a model. Any OpenAI-compatible chat completions endpoint works, including:
- OpenAI — https://api.openai.com/v1
- Anthropic — https://api.anthropic.com/v1 (via Anthropic's OpenAI-compat endpoint, with sk-ant-... keys and claude-sonnet / claude-haiku / claude-opus models)
- OpenRouter — https://openrouter.ai/api/v1 (one key, dozens of models)
- Google Gemini — https://generativelanguage.googleapis.com/v1beta/openai (free tier, see below)
- Local — Ollama, LM Studio, vLLM running on your machine
Local backends run on your machine for free. Hosted providers charge per token at their published rates — usage costs are billed by your chosen provider directly to you.
Free Option: Google Gemini
Google AI Studio gives out a free Gemini API key with a decent daily quota — more than enough for normal use (a handful of generations per in-game day). Setup:
1. Go to Google AI Studio, sign in with a Google account, and click Get API key → Create API key.
2. Copy the key (it starts with `AIza...`).
3. In RimWorld → Options → Mod Settings → Fiction Primer → API tab:
- API base URL: `https://generativelanguage.googleapis.com/v1beta/openai`
- API key: paste your `AIza...` key
- Model: `gemini-2.5-flash` (recommended — fast, free, and capable enough for the prose this mod generates). `gemini-2.5-pro` is also free but slower and has a tighter rate limit.
4. Click Test connection. A green confirmation means you're good.
The free tier is rate-limited (requests per minute and per day), not metered by token cost. If you hit a limit you'll see a "429" error in the letter — wait a minute and re-roll. No billing setup is required.
This mod was inspired by RimSaga created by blobwatanabe.