Skip to content

[cookbook image-captioning] Add caption streaming and perf metrics - #94

Merged
williamw merged 10 commits into
mainfrom
billw/image-threading
Oct 14, 2025
Merged

[cookbook image-captioning] Add caption streaming and perf metrics#94
williamw merged 10 commits into
mainfrom
billw/image-threading

Conversation

@williamw

Copy link
Copy Markdown
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 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

1 participant