LM Studio System Prompt: Set, Save, and Test Instructions
LM Studio lets you set a system prompt in the chat interface and save it as a preset. Here is how to set one, which template options affect how it is delivered, and how to keep your prompts and rules outside any one local session.
Updated 5 min read
LM Studio is a desktop application for running local language models on your own machine. It provides a chat interface, an API server, and model management. You can set a system prompt directly in the chat view, save configurations as presets, and control which chat template the model uses. Tools like fenbs keep the prompts you want to reuse and the project rules that should apply across sessions and tools, outside the LM Studio configuration.
Check the LM Studio documentation (opens in a new tab) for current interface details. The UI and feature set change between LM Studio versions.
Setting a system prompt in the chat interface
When you open a chat in LM Studio, the System Prompt field appears above the conversation. Type your instructions there. They apply to the current conversation from the first message. The system prompt persists within the conversation; starting a new chat begins a fresh session without the previous prompt unless you save a preset.
The system prompt field in LM Studio is plain text. You can use any instruction style: a persona, a set of rules, background context, or a combination. The model receives these instructions in the system turn of the formatted prompt, using whatever chat template applies to the loaded model.
Saving a configuration as a preset
To reuse a system prompt across sessions, save the current configuration as a preset. LM Studio presets store the system prompt text, the model parameters (temperature, context length, and similar settings), and the model itself. When you load the preset, LM Studio applies all those settings to the new session.
Name presets clearly so you can find them later. A name like "Legal research assistant - Llama 3.1 8B" is more useful than "Preset 3." Include the model family in the name because a system prompt tuned for one model may need adjustments for another.
Chat templates and system prompt delivery
LM Studio reads the chat template from the model's GGUF file or from a separate template file. This template defines how the system prompt, user messages, and assistant responses are formatted into the raw text the model receives. For most models downloaded through LM Studio, the correct template is bundled with the model.
If you load a model that LM Studio cannot identify automatically, it may ask you to choose a template or apply a default one. Applying the wrong template causes the system prompt to arrive in the wrong position or without the expected tokens, which the model may ignore. Check the model's documentation or Hugging Face model card to find the correct template name.
To verify that the template is correct, open the Advanced settings in the chat view. LM Studio can show you the raw formatted prompt. Read through it and confirm your system prompt appears in the expected position with the expected surrounding tokens.
Testing that your instructions applied
After setting a system prompt, test it with a question whose answer would differ without it. If you set a tone ("respond formally, no contractions"), check the response style. If you set a scope ("answer only questions about Python"), ask about a different topic and check the response.
A simple diagnostic: ask the model to describe its role or instructions. A model that correctly received the system prompt will describe your rules. One that did not may give a generic description. If the model says it has no special instructions, the system prompt was not applied -- check the template.
The LM Studio local API server
LM Studio includes an API server that presents an OpenAI-compatible endpoint at http://localhost:1234/v1. You can send requests from code or other tools using the standard messages format, including a system role message. The server applies the loaded model's chat template automatically. This is useful for testing prompts programmatically or connecting other tools to your local model.
Keep project rules outside any one local session
LM Studio presets are local to one machine. fenbs keeps your project tasks, Decisions and rules, and Skills and prompts in one place that persists across machines and sessions. When you start a new LM Studio session for a project, load the project context from fenbs first -- or connect another AI tool via MCP to fenbs and use LM Studio for the raw model work alongside it.
Create a free accountFree for one person · No credit card · Works with Claude, ChatGPT, Cursor and more
System prompts with model-specific considerations
Different model families interpret instructions with different consistency. An instruction to always respond in JSON works reliably with models fine-tuned for structured output but may produce inconsistent results with instruction-tuned models not trained on that format. LM Studio lets you load many model families, so it is a useful environment for testing the same system prompt across different architectures.
When you find that a model ignores or partially follows an instruction, check two things. First, whether the chat template is correct -- the model may not be receiving the system turn properly. Second, whether the instruction is too complex for that model's capability. Breaking a multi-rule instruction into simpler, explicit statements often helps smaller models follow them more consistently.
How to do this with fenbs
- Create a free account. Start a personal kanban board for your local model work.
- Add a task for each system prompt you are developing. Note the model, the LM Studio version, and the chat template.
- After testing a prompt, save the configuration as a preset in LM Studio and record the preset name and model in the task.
- Save the system prompt text as a Skill in fenbs so it is available on other machines or sessions. Note the model family it was tested on.
- Write standing project rules as Decisions in fenbs. When you start a new session on a project, read the Decisions and rules before setting up your LM Studio prompt.
Related: system prompt for local LLM goes deeper on chat templates and the Hugging Face template format. System prompt examples has patterns worth adapting. Prompt engineering covers the general principles.