Skip to content
This repository was archived by the owner on Dec 23, 2025. It is now read-only.
This repository was archived by the owner on Dec 23, 2025. It is now read-only.

Devstral 2 small Jinja template error #53

@imqqmi

Description

@imqqmi

I've used the template below (cut off the instructions). When the tool triggers, the LM studio jinja template gets corrupted. See LM studio error message at the bottom. I suspect the SKILLS.md text isn't properly escaped when feeding it into the LLM.


name: magick
description: With this tool you can manipulate images, including cropping it.
allowed-tools: # Optional (parsed but not enforced)

  • read
  • write
  • bash
    metadata: # Optional key-value pairs
    version: "1.0"

LM studio error:
1 Error predicting: Error: Error rendering prompt with jinja template: "After the optional system message, conversation roles must alternate user and assistant roles except for tool calls and results.".

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.
at C:\Users\josha\AppData\Local\Programs\LM Studio\resources\app.webpack\lib\llmworker.js:85:47935
at async _0x345b3c. (C:\Users\josha\AppData\Local\Programs\LM Studio\resources\app.webpack\lib\llmworker.js:85:39712)
at async _0x553e85. (C:\Users\josha\AppData\Local\Programs\LM Studio\resources\app.webpack\lib\llmworker.js:31:2931)
at async _0x55e5e8..predictTokens (C:\Users\josha\AppData\Local\Programs\LM Studio\resources\app.webpack\lib\llmworker.js:85:21278)
at async _0x570ca9.predictTokens (C:\Users\josha\AppData\Local\Programs\LM Studio\resources\app.webpack\lib\llmworker.js:124:17886)
at async _0x570ca9.handleMessage (C:\Users\josha\AppData\Local\Programs\LM Studio\resources\app.webpack\lib\llmworker.js:124:7142)
2025-12-21 20:46:56 [ERROR]
[devstral-small-2-24b-instruct-2512] Error rendering prompt with jinja template: "After the optional system message, conversation roles must alternate user and assistant roles except for tool calls and results.".

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.. Error Data: n/a, Additional Data: n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions