[GH-ISSUE #14580] structured output addon #9453

Open
opened 2026-04-12 22:22:53 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @Abdulrahman392011 on GitHub (Mar 3, 2026).
Original GitHub issue: https://github.com/ollama/ollama/issues/14580

i noticed that when using structured output, the model generate the name of the class which takes a lot of time. for example:

if you say the object in the class is called (( 'confidence percentage that the user will like this' : int )) the model will reply with manually generating each single token in 'confidence percentage that the user will like this' and then generate the actual token that matter which the confidence percentage itself.

you try to play around prompt engineering to reduce the amount of word used in the object name but ....

why not just copy and paste the object name and then carry the generation only for the value of the class.
sure there's a way to do that from low level prospective. it will help speed up the generation significantly.
keep in mind that structured output is usually used repeatedly and having a small change like this can make the workflow a lot faster, not to mention the energy consumption.

Originally created by @Abdulrahman392011 on GitHub (Mar 3, 2026). Original GitHub issue: https://github.com/ollama/ollama/issues/14580 i noticed that when using structured output, the model generate the name of the class which takes a lot of time. for example: if you say the object in the class is called (( 'confidence percentage that the user will like this' : int )) the model will reply with manually generating each single token in 'confidence percentage that the user will like this' and then generate the actual token that matter which the confidence percentage itself. you try to play around prompt engineering to reduce the amount of word used in the object name but ....<sad> why not just copy and paste the object name and then carry the generation only for the value of the class. sure there's a way to do that from low level prospective. it will help speed up the generation significantly. keep in mind that structured output is usually used repeatedly and having a small change like this can make the workflow a lot faster, not to mention the energy consumption.
GiteaMirror added the feature request label 2026-04-12 22:22:53 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#9453