[GH-ISSUE #4837] Stop model without removing #3059

Closed
opened 2026-04-12 13:29:38 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @alemian95 on GitHub (Jun 5, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/4837

Is it possible to have a command to clear the model from the memory without removing it?

Originally created by @alemian95 on GitHub (Jun 5, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/4837 Is it possible to have a command to clear the model from the memory without removing it?
GiteaMirror added the question label 2026-04-12 13:29:38 -05:00
Author
Owner

@mili-tan commented on GitHub (Jun 5, 2024):

Although there may not be a way to stop the model directly inside the Ollama CLI yet, but maybe you can try this:
curl http://localhost:11434/api/generate -d '{"model": "llama3", "keep_alive": 0}'

<!-- gh-comment-id:2150668240 --> @mili-tan commented on GitHub (Jun 5, 2024): Although there may not be a way to stop the model directly inside the Ollama CLI yet, but maybe you can try this: `curl http://localhost:11434/api/generate -d '{"model": "llama3", "keep_alive": 0}'`
Author
Owner

@pdevine commented on GitHub (Jun 5, 2024):

@alemian95 I'm not 100% sure I understand the question, however, if you want to clear you conversation in the CLI, you can use the /clear command. If you want the model to unload from memory (but still be present on the disk), you can use the curl command that @mili-tan mention, or use ollama run --keep-alive 0 <model> "".

LMK if that answers it.

<!-- gh-comment-id:2150908013 --> @pdevine commented on GitHub (Jun 5, 2024): @alemian95 I'm not 100% sure I understand the question, however, if you want to clear you conversation in the CLI, you can use the `/clear` command. If you want the model to unload from memory (but still be present on the disk), you can use the `curl` command that @mili-tan mention, or use `ollama run --keep-alive 0 <model> ""`. LMK if that answers it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#3059