Hacker News new | past | comments | ask | show | jobs | submit
One thing that might help you.

I heard in a youtube video of a conference talk that many of the more modern models have been designed to output correct JSON. Like the model creators have done something with the next token prediction. When you are asking for JSON, they do some special stuff to basically force the model to output correctly escaped JSON. In the past, getting all output as JSON could lead to malformed JSON and parsing problems. With modern models that basically does not happen any more.

If you are doing a single HTML file harness, you have access to javascript. You might consider getting all model output as JSON. Should be pretty easy for you to parse and then use the output with javascript.

Dealing with JSON in posix sh would have been too many loc for my harness. So I used other techniques. But you don't have to do that.