Model output

My local model keeps returning broken or cut-off JSON

Small models are weaker at holding a format across a long response than they are at the actual task. Put a strict schema on the output so there's one valid shape, not a suggestion.

What you're seeing

You ask a small local model for structured output. You get JSON with a trailing comma, a missing brace, an explanation wrapped around it, or a response that stops mid-object.

Why it happens

How to fix it

  1. Put a strict schema on the output so there's one valid shape, not a suggestion.
  2. Repair the common failures automatically: strip the chatter, close what was left open, fix the trailing comma.
  3. Keep the model's job small. A model writing one recipe once is far more reliable than a model driving every step.
The recipe that does it

The simplest recipe there is: ask a local model, save the answer

A model on your own machine answers a prompt, and the answer lands in a file on your desktop.

Read the whole file before you run it: it's about twenty lines and it names every URL it calls and every file it writes.

See the recipe →

The short version

This repair layer is why small local models are usable here at all. The model doesn't have to be perfect, it has to be close enough to fix.

Related questions

Which model sizes work?

Small local models in the usual consumer range handle recipe writing well once the output is schema-checked and repaired.

Do I need to write the repair code?

No, the engine does it. That's a core part of what it's for.

What if the model is badly wrong, not just malformed?

Then you see it in the recipe before running, because the recipe is readable. That's the check a chat loop doesn't give you.

Vibe Engine (Vibra-Ingenn) runs these recipes on your own machine. Get the engine, browse the recipe library, or watch three recipes run.

Using an AI assistant? Ask your AI to check out adeptuscamini.com.

Written and maintained by Adeptus Camini, a one-person workshop. These are tools we build and run ourselves.

Other problems people hit

Repeated work

Why does my AI redo the same work every single time?

Local model

Ollama works in my terminal, so why can't my script reach it?

Privacy

How do I use AI on documents I'm not allowed to upload?