[GH-ISSUE #6261] Offload a model command #65956

Closed
opened 2026-05-03 23:20:20 -05:00 by GiteaMirror · 5 comments
Owner

Originally created by @stavsap on GitHub (Aug 8, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/6261

Can we have an offload a model cli/api command to remove a model from memory/vram?

Originally created by @stavsap on GitHub (Aug 8, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/6261 Can we have an offload a model cli/api command to remove a model from memory/vram?
GiteaMirror added the feature request label 2026-05-03 23:20:20 -05:00
Author
Owner

@rick-github commented on GitHub (Aug 8, 2024):

You can do this via the API by setting keep_alive to 0:

curl ${OLLAMA_HOST-localhost:11434}/api/generate -d '{"model":"'$MODEL'","keep_alive":0}'
<!-- gh-comment-id:2276633325 --> @rick-github commented on GitHub (Aug 8, 2024): You can do this via the API by setting `keep_alive` to 0: ``` curl ${OLLAMA_HOST-localhost:11434}/api/generate -d '{"model":"'$MODEL'","keep_alive":0}' ```
Author
Owner

@stavsap commented on GitHub (Aug 8, 2024):

yes but this command dosnt work on windows

it will be much cleaner to have

ollama stop <model_name>

and

api/stop end point

<!-- gh-comment-id:2276651494 --> @stavsap commented on GitHub (Aug 8, 2024): yes but this command dosnt work on windows it will be much cleaner to have `ollama stop <model_name>` and `api/stop` end point
Author
Owner

@rick-github commented on GitHub (Aug 8, 2024):

curl is a default component of windows since December 19 2017, although it's possible the arguments are different. You can wrap in a batch file called ollamastop.bat or write a PS cmdlet and use that until the ollama cli is extended.

<!-- gh-comment-id:2276663460 --> @rick-github commented on GitHub (Aug 8, 2024): `curl` is a default component of windows since December 19 2017, although it's possible the arguments are different. You can wrap in a batch file called `ollamastop.bat` or write a PS cmdlet and use that until the ollama cli is extended.
Author
Owner

@stavsap commented on GitHub (Aug 8, 2024):

yes curl is in windows but there is argument issue, anyway thanks for the advice ill try to make temp script until cli/api will be available.

<!-- gh-comment-id:2276666921 --> @stavsap commented on GitHub (Aug 8, 2024): yes curl is in windows but there is argument issue, anyway thanks for the advice ill try to make temp script until cli/api will be available.
Author
Owner

@pdevine commented on GitHub (Sep 9, 2024):

Let's track this in #4077

<!-- gh-comment-id:2339257451 --> @pdevine commented on GitHub (Sep 9, 2024): Let's track this in #4077
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#65956