PackageTrack
Sign in Get early access

llm_json_stream

A streaming JSON parser optimized for LLM responses. Parse JSON reactively as it streams in, with path-based subscriptions and type-safe property access.

1.0.0 35K downloads/mo #1749 most downloaded on pub.dev ComsIndeed/llm-json-stream-dart

What this package is like to depend on

Last release 3 months ago

21 May 2026

Ships unpredictably

gaps range from 9 days to 5 months

Nearly every release is documented

notes for 20 of 20 stable releases

Nothing withdrawn

no release was ever pulled

9 months old

20 releases · first in 2025

20 releases in the last 12 months

see the full history below

Release timeline

20 releases · Nov 2025 to May 2026
2026
Release Pre-release

Releases

latest 20
  1. 1.0.0 21 May 2026
    Release notes

    Added

    • Root Convenience Getters: Added .asMap, .stream, .future, and .asList() directly to JsonStreamParser for much simpler root-level interactions.
      final parser = JsonStreamParser(stream);
      // Easy root object operations:
      parser.stream.listen((mapSnapshot) => print(mapSnapshot));
      final completeMap = await parser.future;
      

    Fixed

    • Native Idempotency (Flicker Fix): Wrapped StringPropertyStream, MapPropertyStream, and ListPropertyStream replayable streams in ReplayableBroadcastStream caching wrappers. This provides perfect reference identity stability for Flutter's StreamBuilder and animations during widget rebuilds, while perfectly preserving multiple subscriptions and late-subscriber buffer replay.
    Open source →
  2. 0.4.7 17 Dec 2025
    Release notes

    Refactored

    • Removed unused variables in JsonStreamParser
    Open source →
  3. 0.4.6 17 Dec 2025
    Release notes

    Documentation

    • Added thinking tag skipper functionality to JsonStreamParser
      • New skipThoughts parameter to ignore <thinking>...</thinking> tags in the input stream
      • Set custom thinking tags with thinkingTags parameter
      final parser = JsonStreamParser(
        stream, 
        skipThoughts: true, // Enable thinking tag skipping
        thinkingTags: ('<reasoning>', '</reasoning>') // Custom tags
      );
      
    Open source →
  4. 0.4.5 13 Dec 2025
    Release notes

    Documentation

    • Renamed repository URLs in README and docs to use llm-json-stream-dart
    Open source →
  5. 0.4.4 07 Dec 2025
    Release notes

    Documentation

    • Minor edits to README and API docs
    Open source →
  6. 0.4.3 07 Dec 2025
    Release notes

    Documentation

    • Fixed broken docs: Removed dartdoc categories that caused broken topic links on pub.dev
    Open source →
  7. 0.4.2 07 Dec 2025
    Release notes

    Documentation

    • Enhanced API documentation: Improved documentation comments for all public classes
    • Simplified docs structure: Removed experimental dartdoc categories for cleaner pub.dev integration
    Open source →
  8. 0.4.1 07 Dec 2025
    Release notes

    Performance

    • StringBuffer optimization: Replaced String concatenation with StringBuffer in delegates and controllers for better memory efficiency
    • Type check optimization: Replaced runtimeType.toString() comparisons with is type checks for faster delegate detection
    • Set for O(1) lookups: Changed _valueFirstCharacters from List to Set in ListPropertyDelegate

    Documentation

    • Contributor documentation: Added comprehensive internal architecture docs with Mermaid diagrams
      • Architecture overview and system design
      • Detailed delegate documentation with state machines
      • Property stream and controller architecture
      • Data flow examples with sequence diagrams
      • Path system, streaming mechanism, and nesting handler explanations
    • README links: Added contributor documentation links to the README
    Open source →
  9. 0.4.0 30 Nov 2025
    Release notes

    Added

    • Buffered streams for Maps and Lists: Both MapPropertyStream and ListPropertyStream now support buffered (replayable) streams, matching StringPropertyStream behavior

      • .stream (default, recommended): Replays the latest value to new subscribers (BehaviorSubject-style), preventing race conditions when subscribing late
      • .unbufferedStream: Direct access to the live stream without replay, for cases where you need live-only behavior
      • Memory efficient: Only stores the latest state (O(1) memory), not the full history of emissions
    • onProperty callback for Maps: Similar to onElement for lists, maps now support an onProperty callback that fires when each property starts parsing

      parser.getMapProperty('user').onProperty((property, key) {
        print('Property "$key" started parsing');
        // Subscribe to property value as it streams
      });
      
    • Yap Filter (closeOnRootComplete): New parser option to stop parsing after the root JSON object/array completes, ignoring any trailing text from the LLM

      final parser = JsonStreamParser(stream, closeOnRootComplete: true);
      // Stops after root JSON, ignores: "Hope this helps!"
      
    • Observability with ParseEvent: Monitor parsing events in real-time with the onLog callback

      final parser = JsonStreamParser(stream, onLog: (event) {
        print('[${event.type}] ${event.message}');
      });
      
      • Event types: rootStart, mapKeyDiscovered, listElementStart, propertyStart, propertyComplete, stringChunk, yapFiltered
      • Property-specific logging via .onLog() method on any PropertyStream

    Changed

    • MapPropertyStream.stream now returns a replayable stream that emits the latest state to new subscribers
    • ListPropertyStream.stream now returns a replayable stream that emits the latest state to new subscribers
    • Breaking: Buffered streams now emit only the latest value (BehaviorSubject-style) instead of full history replay. This prevents O(N²) memory usage on large streams.

    Fixed

    • Fixed timing issue where dispose() was called before async completers finished, causing "Parser was disposed before property completed" errors
    • Fixed memory leak where Map and List buffers stored every intermediate state (now stores only latest)

    Migration

    If you were relying on the previous behavior where .stream didn't replay values:

    // Before (0.3.x): .stream was unbuffered
    mapStream.stream.listen(...);
    
    // After (0.4.0): Use .unbufferedStream for the same behavior
    mapStream.unbufferedStream.listen(...);
    
    // Or use .stream (recommended) for buffered/replayable behavior
    mapStream.stream.listen(...);  // Will receive latest state immediately
    
    Open source →
  10. 0.3.1 27 Nov 2025
    Release notes

    Documentation

    • Updated README import statements to use llm_json_stream package name
    Open source →
  11. 0.3.0 27 Nov 2025
    Release notes

    Fixes:

    • Fixed return types for getter methods
    • Fixed exports
    • Moved all files into src/ folder for better package structure
    Open source →
  12. 0.2.3 25 Nov 2025
    Release notes

    Changes

    • Removed JsonStreamParserController as an export
    • Add type casting getters for PropertyStream objects:
      • asString()
      • asNum()
      • asBool()
      • asMap()
      • asList()

    Documentation

    • Updated README
    Open source →
  13. 0.2.2 23 Nov 2025
    Release notes

    Added

    • Added shorthands
    • Added streams for lists and maps

    Documentation

    • Updated README with new demos
    Open source →
  14. 0.2.1 17 Nov 2025
    Release notes

    Documentation

    • Updated README with new demos showcasing functionality
    Open source →
  15. 0.2.0 17 Nov 2025
    Release notes

    Fixed

    • Fixed getMapProperty() returning empty maps instead of populated content
    • Fixed nested lists and maps within parent maps returning null values
    • Fixed map property delegates not creating controllers for nested structures before child delegates
    • Fixed array element maps (e.g., items[0]) not containing their full content

    Changed

    • Map property delegates now collect all child values (primitives, maps, lists) before completing
    • Improved property controller initialization order for complex nested structures

    Tests

    • Added 166 comprehensive tests for map and list value retrieval across different nesting levels
    • Tests cover various chunk sizes (1-50), timing intervals (0-200ms), and nesting depths (1-5 levels)
    Open source →
  16. 0.1.4 15 Nov 2025
    Release notes
    • Updated demo to use Github raw content URL
    Open source →
  17. 0.1.3 15 Nov 2025
    Release notes
    • Fixed demo not showing in Pub.dev
    Open source →
  18. 0.1.2 15 Nov 2025
    Release notes
    • Changelog fixes
    • Added main example
    Open source →
  19. 0.1.1 15 Nov 2025
    Release notes
    • Minor documentation updates
    Open source →
  20. 0.1.0 15 Nov 2025
    Release notes

    Added

    • Initial release of streaming JSON parser optimized for LLM responses
    • Path-based property subscriptions with chainable API
    • Support for all JSON types: String, Number, Boolean, Null, Map, List
    • Array index access and dynamic element callbacks
    • Handles leading whitespace before root JSON elements

    Features

    • Reactive property access: Subscribe to JSON properties as they complete in the stream
    • Nested structures: Full support for deeply nested objects and arrays
    • Chainable API: Access nested properties with fluent syntax
    • Type safety: Typed property streams for all JSON types
    • Memory safe: Proper stream lifecycle management and closed stream guards

    Fixed

    • Root maps completing properly
    • Nested maps completing correctly
    • List chainable property access working
    • "Cannot add event after closing" errors
    • Proper delimiter handling between primitives and containers
    • Child delegate completion detection
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive