Skip to content

feat(android-llmservice): sampling settings (fix repeat loop), in-app log viewer, draggable model name#314

Merged
bernardladenthin merged 1 commit into
mainfrom
claude/android-llmservice-settings-log
Jul 10, 2026
Merged

feat(android-llmservice): sampling settings (fix repeat loop), in-app log viewer, draggable model name#314
bernardladenthin merged 1 commit into
mainfrom
claude/android-llmservice-settings-log

Conversation

@bernardladenthin

Copy link
Copy Markdown
Owner

Summary

On-device feedback: SmolVLM-500M returned a degenerate …spezifischen spezifischen… repetition loop, and the model name was cut off in the top bar. Root cause of the loop: ChatViewModel.send() set no sampling parameters at all (no repeat penalty, no temperature) — a bare decode on a small model collapses into repetition.

  • Generation settings sheet (⚙️ in the top bar): live sliders for temperature, Top‑K, Top‑P, Min‑P, repeat penalty, repeat range and max tokens, plus Reset defaults. send() now forwards these to InferenceParameters (withTemperature/withTopK/withTopP/withMinP/withRepeatPenalty/withRepeatLastN/withNPredict). The default repeat penalty 1.1 + repeat range 64 is what breaks the repetition loop.
  • In-app log: an always-visible one-line strip at the bottom (🧾, wraps to 2 display lines) that opens a full-screen viewer with copy-all, save-as-.txt (SAF CreateDocument) and clear; ✕ closes it. ChatViewModel keeps a capped rolling log (model load/ready, generation start/finish, errors, session save/load, settings reset).
  • Draggable model name: the top-bar title is now horizontally scrollable, so a long name can be dragged fully into view — single line, no auto-marquee wobble.
  • i18n: new UI strings added to the default resources and translated across all 13 shipped languages.
  • Docs: android-llmservice/TODO.md + README.md updated to reflect what shipped; remaining items (dedicated Tools destination, RAM/switch top-bar chips, CPU-threads / context-length settings) stay tracked.

No new files, no new dependencies (SAF + clipboard + java.time only). The instrumented UI test's tags (promptInput/sendButton) and uiState contract are unchanged.

Test plan

  • Affected unit / integration tests pass locally
  • CI is green on this branch — the build-android-llmservice job compiles the app + runs the on-device Compose test on the emulator (validates the new settings/log UI compiles and inference still streams)
  • Docs / CHANGELOG updated where applicable — TODO.md + README.md

Related issues / PRs

Follow-up to the android-llmservice app (PRs #310#313). No related issue number.

Checklist

  • My commits follow Conventional Commits
  • No security-sensitive changes

🤖 Generated with Claude Code

https://claude.ai/code/session_01HTS5FpMtBLJENTGoRUrp5m


Generated by Claude Code

…pp log viewer, draggable model name

Addresses on-device feedback (SmolVLM-500M produced a degenerate
'…spezifischen spezifischen…' repetition loop):

- Generation settings sheet (⚙️ in the top bar): live sliders for
  temperature, Top-K, Top-P, Min-P, repeat penalty, repeat range and
  max tokens, plus 'Reset defaults'. The send() path now forwards these
  to InferenceParameters — the repeat-penalty default (1.1) + non-zero
  repeat range is what breaks the repetition loop a bare no-penalty
  decode falls into on small models. Previously send() set no sampling
  params at all.

- In-app log: an always-visible one-line strip at the bottom (🧾, wraps
  to 2 display lines) that opens a full-screen viewer with copy-all,
  save-as-.txt via SAF, and clear; ✕ closes it. ChatViewModel keeps a
  capped rolling log (model load/ready, generation start/finish, errors,
  session save/load, settings reset).

- Model-name title in the top bar is now horizontally scrollable
  (draggable) so a long name can be read in full — no auto-marquee
  wobble.

- New UI strings added to the default resources and translated across
  all 13 shipped languages.

- TODO.md / README.md updated to reflect what shipped; remaining items
  (dedicated Tools destination, RAM/switch top-bar chips, CPU-threads /
  context-length settings) stay tracked.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HTS5FpMtBLJENTGoRUrp5m
@sonarqubecloud

Copy link
Copy Markdown

@bernardladenthin bernardladenthin merged commit fd48ac4 into main Jul 10, 2026
12 of 16 checks passed
@bernardladenthin bernardladenthin deleted the claude/android-llmservice-settings-log branch July 10, 2026 06:03
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