LLM NPCs

"It remembers four people at a time. I have been the fifth, and I have filed a complaint." — Comptroller Ivek Sarn

An LLM NPC hands one of your NPCs to a language model, which writes its replies to whatever players say to it.

LLM NPCs are compiled out of current builds and every reply is a paid API call. The server-side setup page covers enabling and billing.


What it does

You cast a spawned NPC by giving it a persona. From then on, a player who speaks to it gets a reply written in character a few seconds later. The NPC keeps the recent conversation in mind and holds a separate note about each person it has met. It also takes silent direction from you while the scene runs.

Up to 3 NPCs can be cast at once. A cast NPC shows a star after its floating name, so everyone can see which characters are AI-driven.


Casting an NPC

Before you cast anything

  1. Spawn the NPC with /npc spawn. See spawning and editing.
  2. Give it a display name with /npc edit 4 displayname Vess.
  3. Check the system with /llm status.

If /llm prints nothing at all, the build has the whole system compiled out and nothing on this page will work. On a server with it enabled, /llm status reports the system state, the model, the reply delay, the shared scene text and every cast NPC. These are the first lines of its longer listing:

/llm on and /llm off switch the system for you. /llm needs the same admin permission as /npc, and neither sits under a director lock on the shipped configuration, so a refusal is always about your admin rank:

Setting the scene

Scene text is shared by every cast NPC and describes where everyone is and what is happening, in up to 512 characters. Set it once at the start of a session. none clears it.

The persona fields

Three fields make up a persona, and setting any one of them casts the NPC, so detail is usually the first command you run:

  • detail is the identity, so name, role, background and manner, in up to 300 characters
  • instructions is behaviour, so what the NPC will and will not do, also up to 300 characters
  • memory is general knowledge the NPC holds, up to 512 characters, and none clears it

The target is an id, a targetname or part of a display name. Unlike /npc, your crosshair is not a fallback, so name the target every time. Casting an NPC that has no display name warns you that its replies will be dropped. Fix the name before anyone speaks to it, because each dropped reply is still a paid call.

/llm persona <target> clear uncasts the NPC:


Memory

Remembering individual people

Alongside the general memory, an NPC keeps a separate note about each character it has spoken to, up to 800 characters each. You can write those notes yourself, and none makes it forget that person.

The notes also update themselves. After 6 exchanges with one person, or 3 minutes of silence, a background summary distils the conversation into that person's note.

Only the current speaker's note is sent with a reply, and only the 4 most recent speakers' notes stay loaded at once. With a saved persona, the rest wait on disk and reload when that person next speaks. On an unsaved cast, an older note is lost when a fifth person talks.

Saving and reusing a persona

Saving writes the persona to a folder on the server and links the NPC to it. Its memory then keeps updating in that folder as the scene runs. Persona names are 1 to 32 characters, using letters, numbers and underscores only.

/llm personas lists what has been saved. Loading casts the same character again, on another map or another night:

Add once and the NPC uses the persona for this scene without ever writing back to it. That is what you want for a one-off appearance that should not pollute a recurring character.


Running the scene

Making it speak on cue

/llm poke makes a cast NPC say something now, without waiting to be addressed. A cast NPC quietly folds up to 3 nearby chat lines it was not asked into its context. The poked line reacts to what it overheard, and an optional instruction steers it.

Steering it silently

Send a director note that starts with the NPC's name, followed by a space, comma or colon. The note is folded into the NPC's context as a hidden instruction. Players see nothing, no API call is made, and the note shapes the NPC's next reply.


How players talk to it

Players need no admin rank. Three things work:

  • speaking normally while aiming at the NPC and standing close to it
  • starting an ordinary chat line with the NPC's name
  • running /talk <target> <message>, which addresses it without aiming

/talk itself prints nothing. The reply arrives after a server-set delay, 4 seconds unless changed, as ordinary NPC speech:

The server sets a range and a per-player cooldown. Speaking from too far away, or again too soon, is silently ignored, and that applies to /talk as well.


Things to note

  • On current builds, /llm prints nothing at all. The system is compiled out, so silence from every /llm command is the switch, not a broken bind.
  • 3 NPCs can be cast at once. Setting a persona field on a fourth is refused until you clear one.
  • Replies are short by design. The server cuts each reply to a set length, 130 characters unless changed. What a player says is separately capped at 400 characters a turn.
  • It only holds the recent conversation. Up to 12 turns, and the server can set fewer. Anything the NPC must not forget belongs in its memory instead.
  • An NPC that is already thinking ignores you. Player speech in that window is dropped without a word, and a poke tells you it is busy. At most 4 replies can be waiting to be spoken at once.
  • A reply can fail without a trace. A request is abandoned after 20 seconds, and players see nothing when that happens.
  • Replies from a nameless NPC are dropped after the API call. The call is still billed, and only the server console records the loss.

Next

  • Director mode: director notes, locks and running a scene as its director
  • NPC dialogue: scripted lines, timed chatter and holograms for NPCs you drive yourself