feat(threads): record and display model provenance in threads#174
Open
cashcon57 wants to merge 1 commit into
Open
feat(threads): record and display model provenance in threads#174cashcon57 wants to merge 1 commit into
cashcon57 wants to merge 1 commit into
Conversation
cashcon57
force-pushed
the
feat/thread-model-provenance
branch
2 times, most recently
from
July 13, 2026 21:03
f3ccd7e to
527b7ae
Compare
cashcon57
marked this pull request as ready for review
July 14, 2026 14:36
Stamp metadata.modelProvenance = { modelId, providerId, backend? } onto
assistant messages as they are generated, riding the same metadata
pipeline that already persists finishReason/tokenSpeed/usage. The stamp
is emitted at stream start (so an aborted response stays attributed for
the rest of the session) and repeated on finish.
At render time, derive divider positions from the stamps: the first
stamped response yields a 'Served by <model>' line above its prompt,
and any later change of model, provider, or backend build yields a
'Switched to <model>' line at that point. A regenerate with a different
model anchors to the regenerated response. Threads that predate the
stamp pick up provenance from their next response onward.
The divider is a quiet hairline rule with the model id in small muted
text; provider and backend build (differentiating llama.cpp TurboQuant
builds from upstream) are shown in a tooltip. All display comes from
the persisted stamp, never live settings, so later backend upgrades
cannot rewrite history.
cashcon57
force-pushed
the
feat/thread-model-provenance
branch
from
July 17, 2026 15:06
527b7ae to
9e7fa99
Compare
Contributor
Author
|
Apologies for the edits, I forgot to push the final edit that is represented in the image above. All good now! |
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.
Visual
Describe Your Changes
Adds model provenance to threads: a quiet divider line showing which model
(and backend) serves the responses that follow, as discussed on Discord.
Recording. Each assistant message gets
metadata.modelProvenance = { modelId, providerId, backend? }stamped as it isgenerated, riding the same metadata pipeline that already persists
finishReason/tokenSpeed/usage. The stamp is emitted at stream start(so it survives an aborted generation) and repeated on finish.
backendis theversion_backendsetting of the serving provider (e.g. the llama.cppTurboQuant build tag), read at send time so a later backend upgrade cannot
rewrite the history of already-generated messages. No storage schema change.
Display. Divider positions are derived from the stamps at render time
(memoized walk in the thread view):
Served by <model id>above the prompt that led to it.Switched to <model id>above the prompt following the switch. The backend build being part of the
identity is deliberate: the same model on a different TurboQuant build is a
provenance change worth surfacing.
response itself (the original response above it was served by the old model).
this feature pick up provenance from their next response onward.
UI. Hairline rule with the model id in small muted text, bookended by the
app's asterisk mark (
transparent-logo.png, faded, theme-inverted), deliberatelyquiet so it does not compete with the conversation. Hovering shows a tooltip
with the model id, the standard provider display name (via
getProviderTitle,so TurboQuant and upstream llama.cpp are distinguished), and the backend build
when recorded. Strings are localized (
enonly; other locales fall back toEnglish per the i18n setup).
Tests. Unit tests for the derivation walk: first response, no-change,
model switch, provider-only change, backend-build-only change, regenerate
anchoring, pre-feature history, malformed stamps.
Fixes Issues
Self Checklist