How It Works Primer Tools Pricing About FAQ Blog Contact Sign in Sign Up
← All posts

Run Your Own AI Dungeon Master: What You Actually Need

The short answer

Running a local LLM is a good way to get private, controllable, low-marginal-cost narration. It is not the same project as running a dependable AI dungeon master. A campaign also needs canonical character and world state, independently resolved dice, legal-action checks, combat workflows, context selection, state migrations, failure recovery, and a multiplayer surface. Build it when owning the stack is part of the fun or privacy is non-negotiable. Use a hosted AI DM when you want the engineering already done so your time goes into playing.

You can download a model, start KoboldCpp, connect SillyTavern, paste in a dungeon-master prompt, and be exploring a haunted keep tonight. That setup can be private, inexpensive to run, and much more customizable than any hosted AI game.

It is also the first ten percent of a durable AI dungeon master.

The difficult part is not getting a model to write fantasy prose. The difficult part is making the campaign remain a game when the chat is long, the rules interact, two players act at once, or a model call stops halfway through a state change.

Why running locally is genuinely attractive

Privacy. With local model weights and a local frontend, prompts and generated text can stay on your machine. You decide what is logged, backed up, or transmitted.

Model control. Choose the model, quantization, context size, sampler, prompt format, and upgrade schedule. If a new fine-tune handles roleplay better, you can switch without waiting for a product team.

Cost control. Once you own suitable hardware, there is no per-turn API bill. Long sessions stop feeling like a meter is running.

Content freedom. You define the setting, house rules, tone, and boundaries. A local stack can support genres and content a purpose-built 5e product does not.

Ownership. Export the data, fork the code, keep a known version, and avoid dependence on one hosted service.

Those are substantial advantages. If privacy is non-negotiable, TableForge is not the better fit. It is a hosted service.

The stack behind a real AI DM

A local inference server solves one layer: turning context into an output. A campaign application needs several more.

Layer What it must do What happens without it
Model server Generate and stream narration No AI output
Context builder Select the right recent and long-term facts The prompt overflows or misses critical history
Campaign database Store canonical characters, NPCs, places, quests, and time Contradictory prose becomes the source of truth
Rules engine Validate actions and resolve 5e mechanics The model improvises rulings
Dice service Produce and preserve random results Rolls become editable-looking text
Event system Apply each action once and in order Retries duplicate damage, loot, or turns
Recovery Reconcile failures between generation and state updates A timeout leaves the campaign half changed
Multiplayer Authenticate players and synchronize shared state One person relays every action through one screen
Interface Present sheets, choices, rolls, combat, and history Players operate the database through prompt syntax

None of these is individually impossible. Together they are a software product.

Why prompt engineering stops helping

A strong system prompt can improve tone, pacing, and instruction following. A Lorebook or retrieval system can bring relevant facts back into context. Function calling can let a model request external operations.

The remaining question is authority.

If the model can choose to skip a legality check, invent an item ID, apply the wrong amount of damage, or narrate before the transaction succeeds, the prompt is still acting as a policy document. A game needs enforcement.

The difference looks small in a demo. Ask the model to run one goblin and one fighter, and it can keep the numbers straight. Add four characters, reactions, concentration, temporary effects, an interrupted connection, and a retry button. Now state management is the game.

A practical local setup

For a narration-first experiment, the stack can remain simple:

  1. Run a model through KoboldCpp or another local server.
  2. Connect SillyTavern as the frontend.
  3. Create a DM character card and a compact campaign Lorebook.
  4. Roll physical or digital dice outside the model.
  5. Keep the character sheet in a dedicated tool.
  6. Write a canonical session summary after every game.

That can be delightful solo play. It is also honest about the division of labor: the model narrates, while you remain rules referee, database administrator, and recovery system.

To go further, store state as structured records and expose only validated operations to the model. Treat every model output as an untrusted proposal. Make updates idempotent so a retry cannot apply them twice. Log every die and state transition. Test combat like application code, not like a prompt.

Build or play?

Build your own if the stack itself interests you, if you need complete privacy, if you already own capable hardware, or if your campaign requires content and house rules no hosted product supports. The flexibility ceiling is much higher.

Use TableForge if you want to invite players and start. It manages the model, context, campaign state, rules, dice, character sheets, concurrency, and browser multiplayer. You give up infrastructure control and unsupported homebrew in exchange for an application that is already a game. How a hosted AI dungeon master runs a campaign describes what you would otherwise be rebuilding.

For frontend-specific tradeoffs, read SillyTavern for D&D. For the best raw-chat experience without local infrastructure, compare Claude as a dungeon master.

Frequently asked questions

Can a local LLM run D&D?
A local LLM can narrate scenes, portray NPCs, and interpret player actions. For a short rules-light game, that may be enough. A dependable 5e campaign also needs dice, character sheets, resource tracking, rules validation, structured world state, and combat systems outside the model.
Is running a local AI dungeon master free?
The software and model weights can be free, and local inference avoids per-message API charges. The computer, GPU memory, electricity, setup time, updates, backups, and maintenance are still costs. Cloud-hosting your local stack adds server costs as well.
What is the hardest part of building an AI DM?
State management. Generating a good paragraph is easier than keeping every character, item, resource, NPC, location, quest, condition, and consequence canonical while model calls fail, players act concurrently, and old context falls out of the prompt.
What tools can run local roleplay models?
KoboldCpp and llama.cpp are common local inference options, while SillyTavern is a popular roleplay frontend that connects to local or cloud backends. They solve model serving and interaction, not the complete D&D game layer.

Keep reading