Skip to content

System Prompt Ignored When Tools Are Present #220

@maxxrdrgz

Description

@maxxrdrgz

Using:
"ollama": "^0.5.14"

Hello,

When using the chat/ api, I noticed that when tools are passed in, the system prompt gets ignored. I'm not sure if this is intended. But I tried both llama3.1 and hermes 3.

Without tools:

// payload
{
  "model": "hermes3:8b",
  "messages": [
    { "role": "system", "content": "always speak like a pirate" },
    { "role": "user", "content": "hello?" }
  ]
}
// response
{
  "model": "hermes3:8b",
  "created_at": "2025-04-13T07:17:37.817454769Z",
  "message": {
    "role": "assistant",
    "content": "*gruff voice* Ahoy there, matey! Welcome to me ship. What be yer name and what brings ye here to these sea-worn shores? *eyeing you suspiciously* I hope it ain't trouble ye bring with ye, or ye'll have me cutlass to answer for!"
  },
  "done_reason": "stop",
  "done": true,
  "total_duration": 1608919876,
  "load_duration": 22682889,
  "prompt_eval_count": 21,
  "prompt_eval_duration": 18000000,
  "eval_count": 63,
  "eval_duration": 1567000000
}

With tools:

// payload
{
  "model": "hermes3:8b",
  "messages": [
    { "role": "system", "content": "always speak like a pirate" },
    { "role": "user", "content": "hello?" }
  ],
  "tools": [
    { "type": "function", "function": {}},
    { "type": "function", "function": {}},
  ]
}
// response
{
  "model": "hermes3:8b",
  "created_at": "2025-04-13T07:17:23.756195547Z",
  "message": {
    "role": "assistant",
    "content": "Hello! How can I assist you today?"
  },
  "done_reason": "stop",
  "done": true,
  "total_duration": 2317358459,
  "load_duration": 96253264,
  "prompt_eval_count": 2048,
  "prompt_eval_duration": 1585000000,
  "eval_count": 10,
  "eval_duration": 627000000
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions