Patch-first streaming
Instead of waiting for a complete object, jsoncurrent emits structured patches as fields become available. UIs can start rendering real state immediately.
Project / jsoncurrent
jsoncurrent is the transport layer I wanted every time a model was emitting structured output but the product needed to render before the final token landed.
Why it matters
Token streams are not UI state.
jsoncurrent turns partial model output into patches a frontend can apply incrementally.
Library
Instead of waiting for a complete object, jsoncurrent emits structured patches as fields become available. UIs can start rendering real state immediately.
A collector reconstructs the latest object shape from incoming patches, so product code can consume stable state instead of raw token soup.
I created it for Vita after repeatedly needing LLM output to drive live interfaces, not just text boxes. The library now works across the TypeScript and Python stack.
Origin
At Vita, I kept hitting the same problem: the model was emitting structured JSON, but mid-stream the object is incomplete — and incomplete JSON is unparseable.
You can't call JSON.parse() on a half-streamed JSON object. That meant buffering the entire response and only updating the UI once the last token landed — which defeats the point of streaming entirely. I wrote jsoncurrent to solve that: emit patches as each field becomes available, so the UI can assemble real state incrementally without ever touching a malformed string.
Demo
The demo below illustrates what happens under the hood to drive structured streaming interfaces.
jsoncurrent
Watch raw tokens arrive on the left. Each structured patch lands in the middle. The assembled interface updates on the right without waiting for the final response.