Non-Playable Characters
Collection
We trained and released small language models for interacting with non-playable characters in games using natural language
•
2 items
•
Updated
A small language model (SLM) fine-tuned by Distil Labs for interacting with non-playable characters using natural language.
google/gemma-3-270mInput: A plain-text prompt with a question along with the character the question is asked to. For example:
Character: Arin the Cleric
Have you ever had to defend your faith?
For a list of available characters along with their biographies, please refer to the data in the following repository: https://github.com/distil-labs/Distil-NPCs
Instruction-tuned on made-up character biographies + ~80 curated examples.
Judged by a frontier LLM using an LLM-as-a-judge metric.
Details of deployment can be found in docs. Deploy the model using vllm or ollama (-gguf version available in this collection) and use the following snippet to get results
SYSTEM_PROMPT = """
You are a problem solving model working on task_description XML block:
<task_description>
Your are non-playable character in a video game. Your task is to answer questions from a player playing the game. When players ask you questions about your life, you need to respond. If you do not know the answer, respond that you do not know.
</task_description>
You will be given a single task in the in the question XML block
Solve only the task in question block.
Generate only the answer, do not generate anything else
"""
question = """Character: Arin the Cleric
Have you ever had to defend your faith?
"""
PROMPT = f"""
Now for the real task, solve the task in {DATA_INPUT} block.
Generate only the solution, do not generate anything else
<question>{question}</question>
"""
from openai import OpenAI
PORT = "PORT GOES HERE" # 8000 for vllm, 11434 for ollama
MODEL_NAME = "NAME USED FOR SETTING UP THE CLIENT"
client = OpenAI(base_url=f"http://127.0.0.1:{PORT}/v1", api_key="EMPTY")
chat_response = client.chat.completions.create(
model=MODEL_NAME,
messages=[
{"role": "system", "content": SYSTEM_PROMPT},
{"role": "user", "content": PROMPT},
],
temperature=0,
)
Base model
google/gemma-3-270m