Skip to content

feat(local-inference): stream IMAGE_DESCRIPTION token-by-token through the chat pipe (#9105) - #9289

Merged
lalalune merged 1 commit into
developfrom
feat/local-vision-streaming-pipe
Jun 24, 2026
Merged

feat(local-inference): stream IMAGE_DESCRIPTION token-by-token through the chat pipe (#9105)#9289
lalalune merged 1 commit into
developfrom
feat/local-vision-streaming-pipe

Conversation

@lalalune

Copy link
Copy Markdown
Member

What

Routes the local vision describe (IMAGE_DESCRIPTION) onto the same streaming pipe as chat textonTextChunk → onStreamChunk → SSE → frontend — so a vision description renders token-by-token in the dashboard instead of arriving as one blob.

Gated on a new fused ABI-v13 streaming-describe entrypoint, with graceful fallback to the buffered one-shot describe_image on ≤v12 libs (the JS cascade probes visionStreamSupported()), so this change is safe to land before the native side ships.

Changes

  • core (types/model.ts): additive stream? / onStreamChunk? on ImageDescriptionParams + TranscriptionParams. The runtime already injects onStreamChunk into local model params when a chat streaming context is active (runtime.ts).
  • ffi-bindings: ABI-v13 cascade attempt + visionStreamSupported() + describeImageStreamOpen(); degrades to describeImage on ≤v12.
  • desktop-fused-ffi-backend-runtime: describeImage() decodes token-by-token via describeImageStreamOpen + the existing llmStreamNext loop when onTextChunk is set (no event-loop blocking — yields between steps); else the buffered path.
  • thread onTextChunk + maxTokensPerStep through backend → engine → service (arbiter vision capability) → the IMAGE_DESCRIPTION provider handler.

Validation

Validated live on Windows CPU with SmolVLM-500M (mtmd): token-by-token describe with real OCR — read "ELIZA OCR" / "Total: $42.00" off a rendered image, streaming 256 chunks at ~21 tok/s. Evidence (video + stills) attached to #9105.

The native eliza_inference_describe_image_stream_open (ABI v13, reuses llm_stream_next) lands separately to the elizaOS/llama.cpp fork + a gitlink bump; this JS change degrades gracefully until then.

Part of the "every model — including vision — through the same streaming pipe" effort (#9105).

🤖 Generated with Claude Code

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cc645ae5-50ee-4968-b1e6-094cd98f8e8a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/local-vision-streaming-pipe

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

…h the chat pipe (#9105)

Route the local vision describe (IMAGE_DESCRIPTION) onto the SAME
onTextChunk -> onStreamChunk -> SSE -> frontend streaming pipe as chat text,
so a vision description renders token-by-token in the dashboard. Gated on a new
fused ABI-v13 streaming-describe entrypoint with graceful fallback to the
buffered one-shot describe on <=v12 libs (the cascade probes
visionStreamSupported()).

- core: additive stream?/onStreamChunk? on ImageDescriptionParams + TranscriptionParams
  (the runtime already injects onStreamChunk into local model params when a chat
  streaming context is active).
- ffi-bindings: ABI v13 cascade attempt + visionStreamSupported() +
  describeImageStreamOpen(); degrades to the buffered describeImage on <=v12 libs.
- desktop-fused-ffi-backend-runtime: describeImage() decodes token-by-token via
  describeImageStreamOpen + the EXISTING llmStreamNext loop when onTextChunk is set.
- thread onTextChunk + maxTokensPerStep through backend -> engine -> service
  (arbiter vision capability) -> the IMAGE_DESCRIPTION provider handler.

Validated live on Windows CPU with SmolVLM-500M: token-by-token describe with OCR
(read "ELIZA OCR" / "Total: $42.00" off a rendered image). The native ABI-v13
describe_image_stream_open lands separately to the elizaOS/llama.cpp fork; this JS
change is safe before it (graceful degradation).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@lalalune
lalalune force-pushed the feat/local-vision-streaming-pipe branch from 0785f13 to 0b836b7 Compare June 24, 2026 07:55

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@lalalune
lalalune merged commit 97794af into develop Jun 24, 2026
52 of 53 checks passed
@lalalune
lalalune deleted the feat/local-vision-streaming-pipe branch June 24, 2026 07:55
@claude

claude Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Claude encountered an error —— View job


I'll analyze this and get back to you.

lalalune added a commit that referenced this pull request Jun 24, 2026
…oken vision describe) (#9507)

Points the fused-lib submodule at the fork commit that adds eliza_inference_describe_image_stream_open (ABI 12->13), on top of develop's current pinned base (keeps the iOS fused-slice + diarizer fixes). Activates the JS vision streaming landed in #9289 (it gracefully fell back to one-shot describe until now). Validated on Windows CPU: real eliza-1-0_8b bundle + published mmproj streams token-by-token with OCR.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant