[GH-ISSUE #6835] llama3.1:8b-instruct-q4_1 doesn't handle system prompt correctly (looks like its dropped) #30076

Closed
opened 2026-04-22 09:31:23 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @hellovai on GitHub (Sep 17, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/6835

What is the issue?

This fails

curl -X POST 'http://localhost:11434/v1/chat/completions' -H "content-type: application/json" -d '{
  "model": "llama3.1:8b-instruct-q4_1",
  "messages": [
    {
      "role": "system",
      "content": [
        {
          "type": "text",
          "text": "Extract from this content:\nVaibhav Gupta\nvbv@boundaryml.com\n\nExperience:\n- Founder at BoundaryML\n- CV Engineer at Google\n- CV Engineer at Microsoft\n\nSkills:\n- Rust\n- C++\n\nAnswer in JSON using this schema:\n{\n  name: string,\n  email: string or null,\n  experience: string[],\n  skills: string[],\n}"
        }
      ]
    }
  ],
  "stream": true
}'

But this does

curl -X POST 'http://localhost:11434/v1/chat/completions' -H "content-type: application/json" -d '{
  "model": "llama3.1",
  "messages": [
    {
      "role": "system",
      "content": [
        {
          "type": "text",
          "text": "Extract from this content:\nVaibhav Gupta\nvbv@boundaryml.com\n\nExperience:\n- Founder at BoundaryML\n- CV Engineer at Google\n- CV Engineer at Microsoft\n\nSkills:\n- Rust\n- C++\n\nAnswer in JSON using this schema:\n{\n  name: string,\n  email: string or null,\n  experience: string[],\n  skills: string[],\n}"
        }
      ]
    }
  ],
  "stream": true
}'

OS

macOS

GPU

Apple

CPU

Apple

Ollama version

0.3.10

Originally created by @hellovai on GitHub (Sep 17, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/6835 ### What is the issue? This fails ``` curl -X POST 'http://localhost:11434/v1/chat/completions' -H "content-type: application/json" -d '{ "model": "llama3.1:8b-instruct-q4_1", "messages": [ { "role": "system", "content": [ { "type": "text", "text": "Extract from this content:\nVaibhav Gupta\nvbv@boundaryml.com\n\nExperience:\n- Founder at BoundaryML\n- CV Engineer at Google\n- CV Engineer at Microsoft\n\nSkills:\n- Rust\n- C++\n\nAnswer in JSON using this schema:\n{\n name: string,\n email: string or null,\n experience: string[],\n skills: string[],\n}" } ] } ], "stream": true }' ``` But this does ``` curl -X POST 'http://localhost:11434/v1/chat/completions' -H "content-type: application/json" -d '{ "model": "llama3.1", "messages": [ { "role": "system", "content": [ { "type": "text", "text": "Extract from this content:\nVaibhav Gupta\nvbv@boundaryml.com\n\nExperience:\n- Founder at BoundaryML\n- CV Engineer at Google\n- CV Engineer at Microsoft\n\nSkills:\n- Rust\n- C++\n\nAnswer in JSON using this schema:\n{\n name: string,\n email: string or null,\n experience: string[],\n skills: string[],\n}" } ] } ], "stream": true }' ``` ### OS macOS ### GPU Apple ### CPU Apple ### Ollama version 0.3.10
GiteaMirror added the bug label 2026-04-22 09:31:23 -05:00
Author
Owner

@rick-github commented on GitHub (Sep 17, 2024):

When did you pull the models? I pulled the models, tried the prompts and neither gave results.

Note however that the system role is more like how to respond, and models are generally trained to respond to the user role:

$ curl -s -X POST 'http://localhost:11434/v1/chat/completions' -H "content-type: application/json" -d '{
  "model": "llama3.1:8b-instruct-q4_1",
  "messages": [
    { "role": "system",
      "content": "You extract information from resumes.  Answer in JSON using this schema:\n{\n  name: string,\n  email: string or null,\n  experience: string[],\n  skills: string[],\n"
    },
    {
      "role": "user",
      "content": [
        {
          "type": "text",
          "text": "Vaibhav Gupta\nvbv@boundaryml.com\n\nExperience:\n- Founder at BoundaryML\n- CV Engineer at Google\n- CV Engineer at Microsoft\n\nSkills:\n- Rust\n- C++\n\n"
        }
      ]
    }
  ],
  "response_format":{"type":"json_object"},
  "stream": false
}' | jq -r '.choices[].message.content'
{
  "name": "Vaibhav Gupta",
  "email": "vbv@boundaryml.com",
  "experience": [
    "Founder at BoundaryML",
    "CV Engineer at Google",
    "CV Engineer at Microsoft"
  ],
  "skills": [
    "Rust",
    "C++"
  ]
}
<!-- gh-comment-id:2354350761 --> @rick-github commented on GitHub (Sep 17, 2024): When did you pull the models? I pulled the models, tried the prompts and neither gave results. Note however that the `system` role is more like how to respond, and models are generally trained to respond to the `user` role: ```console $ curl -s -X POST 'http://localhost:11434/v1/chat/completions' -H "content-type: application/json" -d '{ "model": "llama3.1:8b-instruct-q4_1", "messages": [ { "role": "system", "content": "You extract information from resumes. Answer in JSON using this schema:\n{\n name: string,\n email: string or null,\n experience: string[],\n skills: string[],\n" }, { "role": "user", "content": [ { "type": "text", "text": "Vaibhav Gupta\nvbv@boundaryml.com\n\nExperience:\n- Founder at BoundaryML\n- CV Engineer at Google\n- CV Engineer at Microsoft\n\nSkills:\n- Rust\n- C++\n\n" } ] } ], "response_format":{"type":"json_object"}, "stream": false }' | jq -r '.choices[].message.content' ``` ```json { "name": "Vaibhav Gupta", "email": "vbv@boundaryml.com", "experience": [ "Founder at BoundaryML", "CV Engineer at Google", "CV Engineer at Microsoft" ], "skills": [ "Rust", "C++" ] } ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#30076