forgecode icon indicating copy to clipboard operation
forgecode copied to clipboard

[Bug]: template error with qwen3.5-27b (llama.cpp)

Open khimaros opened this issue 8 months ago • 9 comments

Bug Description

here is the Jinja error:

srv    operator(): got exception: {"error":{"code":400,"message":"Unable to generate parser for this template. Automatic parser generation failed: \n------------\nWhile executing CallExpression at line 85, column 32 in source:\n...first %}↵            {{- raise_exception('System message must be at the beginnin...\n                                           ^\nError: Jinja Exception: System message must be at the beginning.","type":"invalid_request_error"}}

it seems to indicate that something other than "system" role is being used for the first message

Steps to Reproduce

  1. launch llama.cpp server:
$ llama-server --port 7916 --n-gpu-layers all --
ctx-size 262144 --min-p 0 --top-p 0.95 --top-k 20 --presence-penalty 0 --repeat-penalty 1 --flash-
attn on --parallel 2 --cache-type-k q8_0 --cache-type-v q8_0 --cache-reuse 256 --hf-repo unsloth/Q
wen3.5-27B-GGUF:Q8_0
  1. launch forge and configure provider
  2. select the model
  3. send a simple prompt like "hello"

Expected Behavior

respond to the prompt

Actual Behavior

receive Jinja template error

Error Logs


Forge Version

v2.0.3

Operating System

Linux (Debian)

OS Version

Debian Forky

AI Provider

OpenAI-compatible

Model

qwen3.5-27b:Q8_0

Installation Method

npx forgecode@latest

Configuration


khimaros avatar Mar 16 '26 21:03 khimaros

🚀 I want to work on this Bounty!

GitHub Account: jiarongmai

About Me: I'm a professional developer with expertise in Python, TypeScript, Go, and smart contract development. I have extensive experience contributing to open source projects.

My Plan:

  1. First, analyze the requirements and existing codebase
  2. Create a detailed technical implementation plan
  3. Implement in phases while maintaining communication
  4. Provide comprehensive tests and documentation

Time Estimate: Based on complexity, I estimate 1-7 days to complete

How I'll Start:

  • Fork the repository and set up the development environment
  • Analyze the issue requirements in detail
  • Propose a specific implementation plan
  • Start immediately after approval

Looking forward to working with you! 🙌

jiarongmai avatar Mar 24 '26 03:03 jiarongmai

@khimaros are u using {{}} handlebar syntax in your prompts somewhere?

tusharmath avatar Mar 24 '26 03:03 tusharmath

/attempt

zhaog100 avatar Mar 24 '26 04:03 zhaog100

using the default template for this model which is produced by unsloth: https://huggingface.co/unsloth/Qwen3.5-27B-GGUF?chat_template=default#L85

khimaros avatar Mar 24 '26 13:03 khimaros

Any update guys? i tried changing teh chat template with /llama-cli -m model.gguf --chat-template-file path/to/template.jinja. still nothing

Pranav-Official avatar Apr 02 '26 14:04 Pranav-Official

Action required: Issue inactive for 30 days. Status update or closure in 7 days.

github-actions[bot] avatar May 02 '26 15:05 github-actions[bot]

Same issue with Qwen3.6 35B A3B.

[06:36:45] ERROR: POST http://127.0.0.1:8080/v1/chat/completions
Caused by:
    0: 500 Internal Server Error Reason: {"error":{"code":500,"message":"\n------------\nWhile executing CallExpression at line 85, column 32 in source:\n...first %}↵            {{- raise_exception('System message must be at the beginnin...\n                                           ^\nError: Jinja Exception: System message must be at the beginning.","type":"server_error"}}

janvitos avatar May 07 '26 10:05 janvitos

Action required: Issue inactive for 30 days. Status update or closure in 7 days.

github-actions[bot] avatar Jun 12 '26 09:06 github-actions[bot]

Issue closed after 7 days of inactivity.

github-actions[bot] avatar Jun 19 '26 09:06 github-actions[bot]