Doesn"t work with LM Studio

#35
by Romataurus - opened

It doesn"t work with LM Studio (0.4.16 build 2) and i don"t know why because base model Gemma4-12b works well. I tried several versions (4q, 6q) on a powerfull machine with GPU and a laptop. It doesn"t work

This message: "Failed to regenerate message
Error rendering prompt with jinja template: "Cannot call something that is not a function: got UndefinedValue".

same here (all updated). It works with koboldcpp.

@Romataurus @realcorsair Known LM Studio limitation β€” not the weights or your machines. That UndefinedValue error is LM Studio's template engine (minja) choking on this model's chat template: it uses jinja features (.get(), namespace, the thinking channel + Gemma 4's native tool format) that minja doesn't fully implement, so it fails at render time before the model even runs. Base Gemma 4 works because its GGUF ships a simpler, minja-safe template; my fine-tune carries the full native-tool template, which is exactly what minja can't handle. That's also why it runs fine in koboldcpp β€” different template path.

Fixes:

  • Easiest: stay on koboldcpp (as @realcorsair found), or use llama.cpp llama-server --jinja β€” both render the real template, and llama-server is the most reliable for tool/agentic use.
  • Want to stay in LM Studio for plain chat: override the template in My Models β†’ model settings β†’ Prompt Template with a minja-safe version (I can share one). Honest caveat: that only fixes plain chat β€” it won't make tool-calling reliable in minja.

So nothing's broken on your end β€” it's a client-side template-engine gap. Happy to drop the minja-safe chat template here if you'd like it.

Sign up or log in to comment