Skip to content

feat(android-llmservice): unload-model button (❌) next to the model name#323

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

feat(android-llmservice): unload-model button (❌) next to the model name#323
bernardladenthin merged 1 commit into
mainfrom
claude/android-llmservice-unload-model

Conversation

@bernardladenthin

Copy link
Copy Markdown
Owner

Summary

Adds a way to unload the model / free it from memory while staying in the chat — a ❌ button to the right of the model name (row 1 of the app bar), shown only when a model is loaded.

ChatViewModel.unloadModel():

  • cancels any in-flight generation,
  • closes the native model (frees RAM) off the main thread,
  • deletes the copied working model file (current-model.gguf — frees storage, nothing lingers),
  • returns the UI to the "no model loaded" state (the model-not-loaded banner → pick a new model).

The chat history is kept (still saveable / copyable), so nothing is lost — you can load another model to continue, or Clear (🗑) to start fresh. A model loaded by absolute path (test / session restore) has no working copy, so the delete is a no-op there.

Docs synced per the requirements.md rule: R3.8 (unload) + R10.1 (top-bar row now includes the ❌), CLAUDE.md android bullet.

Test plan

Related issues / PRs

Follow-up to the android-llmservice app. Best merged after #322 (the build/test split) so the APK artifact is produced regardless of the emulator test.

Checklist

  • Conventional Commits
  • No security-sensitive changes

🤖 Generated with Claude Code

https://claude.ai/code/session_01HTS5FpMtBLJENTGoRUrp5m


Generated by Claude Code

Adds a way to free the model from memory without leaving the chat: a ❌
button to the right of the model name (shown only when a model is loaded).
ChatViewModel.unloadModel() cancels any generation, closes the native
model (frees RAM, off the main thread), deletes the copied working model
file (storage + privacy), and returns to the 'no model loaded' state. The
chat history is kept (still saveable/copyable) so nothing is lost; a new
model can be picked to continue.

Docs synced: requirements.md R3.8 + R10.1, CLAUDE.md android bullet.

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 df20604 into main Jul 10, 2026
13 of 17 checks passed
@bernardladenthin bernardladenthin deleted the claude/android-llmservice-unload-model branch July 10, 2026 20:13
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