Add persistent multi-turn chat and Gemma 4 image support - #51
Open
AbhinavPanwarDev wants to merge 19 commits into
Open
Add persistent multi-turn chat and Gemma 4 image support#51AbhinavPanwarDev wants to merge 19 commits into
AbhinavPanwarDev wants to merge 19 commits into
Conversation
AbhinavPanwarDev
force-pushed
the
AbhinavPanwarDev/chat-enhancements
branch
from
August 3, 2026 14:06
891cd64 to
069aedc
Compare
This was referenced Aug 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR evolves the Mac app from a single-prompt interface into a persistent multi-turn chat workspace and adds local image input support for Gemma 4.
Chat experience
Transcript and streaming
Image support
Issues addressed
Closes #12 — Multi-turn chat
Closes #65 — Clear the composer after a prompt is submitted
Closes #9 — Visual Tower support
Partially addresses #61 — Support multimodal input. This PR implements image input in the Mac app and decode-service path. Audio input and multimodal requests through the OpenAI-compatible server are not included.
The
TurboFieldfarecore target built successfully.Focused tests were added or extended for:
A complete reference-quality comparison of image output against the upstream Gemma 4 implementation has not yet been performed.
Memory and performance
The optional vision payload is stored in a separate sidecar of approximately 1.09 GiB. The complete sidecar is not loaded into memory.
Vision encoding uses bounded memory:
The chat changes intentionally retain conversation text so saved chats can be restored. Active streaming uses a bounded temporary response buffer that is reset between runs.
No controlled before/after performance or peak-memory measurements were collected. Vision encoding adds temporary Metal memory and preprocessing latency only when an image is submitted.
Remaining limitations
Audio input is not implemented.
The OpenAI-compatible server does not yet accept image or audio content.
Only the latest user prompt can be edited.
Editing an image prompt regenerates the latest answer; it does not create alternate conversation branches.
Image inference requires the optional vision sidecar to be installed.
Image output quality still needs comparison against the upstream Gemma 4 processor and vision implementation.
Peak memory and vision preprocessing latency still need measurement on supported Apple Silicon hardware.
Full package-test execution requires a Swift/Xcode environment containing the necessary testing and SwiftUI preview plugins.
The change does not load a complete checkpoint, shard, or large model tensor into Swift heap memory.
Logs and artifacts contain no credentials, private paths, or model weights.
Validation
The following checks were used: