[GH-ISSUE #7589] Adding option to default /clear after each query #51349

Closed
opened 2026-04-28 19:37:52 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @soulrrrrr on GitHub (Nov 9, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/7589

As there is /clear command to clear the session context, it would be great if there is an option to set to automatically run /clear for every query. I am using LLM as translator so this feature might be helpful. Since when the prompt gets longer and longer, the inference time increases.

Originally created by @soulrrrrr on GitHub (Nov 9, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/7589 As there is `/clear` command to clear the session context, it would be great if there is an option to set to automatically run `/clear` for every query. I am using LLM as translator so this feature might be helpful. Since when the prompt gets longer and longer, the inference time increases.
GiteaMirror added the feature request label 2026-04-28 19:37:52 -05:00
Author
Owner

@pdevine commented on GitHub (Nov 13, 2024):

You can call ollama from the CLI with:

ollama run <model> "translate foo" which should do what you're looking for. You can also create a Modelfile with a default system prompt which includes something like "Translate the following message from Spanish to English" and then use ollama create to create the new model and then use that w/ the ollama run command.

I'm going to go ahead and close the issue, but hopefully that makes sense.

<!-- gh-comment-id:2474654992 --> @pdevine commented on GitHub (Nov 13, 2024): You can call ollama from the CLI with: `ollama run <model> "translate foo"` which should do what you're looking for. You can also create a Modelfile with a default system prompt which includes something like "Translate the following message from Spanish to English" and then use `ollama create` to create the new model and then use that w/ the `ollama run` command. I'm going to go ahead and close the issue, but hopefully that makes sense.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#51349