Skip to content

Conversation

@williamw
Copy link
Collaborator

Enhances the image captioning recipe with progressive NDJSON streaming, parallel processing, and performance tracking.

Key Changes

Image Captioning Recipe

  • NDJSON streaming: Custom useNDJSON hook for progressive caption results without external dependencies
  • Parallel processing: Multiple images processed simultaneously with individual progress tracking
  • Performance metrics: TTFT (time to first token) and generation duration tracking
  • Time formatting: pretty-ms library for human-readable time display (e.g., "2m 5s", "245ms")
  • API improvements: Uses streamText to capture timing, streams results as newline-delimited JSON

Multi-turn Chat Recipe

  • Updated documentation to highlight Streamdown for markdown/syntax highlighting
  • Polished inline comments for clarity

Infrastructure

  • Added workspace-level dependency catalog (pnpm-workspace.yaml)
  • Added pretty-ms for time formatting
  • Updated package.json files across workspace

Documentation

  • Enhanced README with feature descriptions for both recipes
  • Updated recipe metadata descriptions to be more concise
  • Improved inline code comments throughout

Other Improvements

  • Fixed theme toggle hydration warning
  • Updated button styles for consistency

@williamw williamw changed the title Add NDJSON streaming and performance metrics to image captioning recipe [cookbook image-captioning] Add caption streaming and perf metrics Oct 14, 2025
@williamw williamw merged commit 21a3965 into main Oct 14, 2025
1 check passed
@williamw williamw deleted the billw/image-threading branch October 14, 2025 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants