ThinkFacility

Error messages

Error rendering prompt with jinja template

The message

Error rendering prompt with jinja template
LM Studio as of September 26, 2026 read September 26, 2026LM Studiolocal modelschat template

What it means

Before a model sees your chat, LM Studio runs the model's prompt template (a small Jinja program shipped with the model) to turn the messages into text. That program failed, so nothing was sent to the model. The quoted text after the colon says why.

What to do

Read the quoted reason, update LM Studio, and try the lmstudio-community build of the model. Failing that, edit the template under My Models, gear icon, Prompt Template.

LM Studio shows this when you send a message, or returns it from its local server when an app sends a request. In the chat window it looks like this (the part in quotes changes):

Failed to send message
Error rendering prompt with jinja template: "Unknown test: sequence".

This is usually an issue with the model's prompt template. If you are using a popular model, you can try to search the model under lmstudio-community, which will have fixed prompt templates. If you cannot find one, you are welcome to post this issue to our discord or issue tracker on GitHub. Alternatively, if you know how to write jinja templates, you can override the prompt template in My Models > model settings > Prompt Template.

Every chat model comes with a prompt template, a short program written in Jinja (a templating language) that turns a list of messages and tools into the exact text the model was trained on. LM Studio reads it from the model file's metadata and runs it on every request. When the template throws an error, LM Studio stops there. As of September 26, 2026, 38 issues on LM Studio's bug tracker carry this message.

Reading the part in quotes

Everything after the colon is the real error, and in the reports we read it falls into two kinds.

A Jinja feature LM Studio doesn't have. LM Studio runs templates with its own Jinja engine, and some templates use pieces it doesn't implement. "Unknown test: sequence" is the common one in 2026: Gemma 4's template checks is sequence, and an August report on LM Studio 0.4.20+1 (#2233) found that any number in a tool result or tool argument reaches that check and fails, even with the template from LM Studio's own model catalog. "Unknown StringValue filter: safe" comes from Qwen3 Coder templates (#1342). And "Cannot call something that is not a function: got UndefinedValue" means the template called a function the engine lacks. The LM Studio team member who answers as yagil on GitHub said in February 2025 (#393) that one cause was strftime, which LM Studio didn't support, and suggested removing that part of the template.

The template refusing your messages on purpose. Templates can raise their own errors. Qwen 3.5's template on Hugging Face raises "No user query found in messages." when it can't find a user message that isn't a wrapped tool result, which is why it turns up in agent setups (MCP servers, opencode, OpenClaw) in #1586 and #1855, and with a RAG document on the first message in a comment on #1537.

Fixes, in the order to try them

When the model came from LM Studio's own catalog

The Gemma 4 reports (#2233, and #2238 for a 26B tool list with an enum) were both open on September 26, 2026, and both involve the template that ships in LM Studio's hub entry. Until a fix lands, the working options are an edited template or leaving tools off for that model. People in #1586 and #2048 posted their own replacement templates; they're unofficial, so read one before pasting it in.

Other lines the same feature prints

Match yours against these if the one at the top of the page is not quite it. They come from the same code and mean related things.

  • Failed to send message
  • Error rendering prompt with jinja template: "Unknown test: sequence".
  • Error rendering prompt with jinja template: "Unknown StringValue filter: safe".
  • Error rendering prompt with jinja template: "No user query found in messages.".
  • Error rendering prompt with jinja template: "Cannot call something that is not a function: got UndefinedValue".
  • This is usually an issue with the model's prompt template.