ollama / ollama

Get up and running with Llama 3.2, Mistral, Gemma 2, and other large language models.
https://ollama.com
MIT License
100.2k stars 7.99k forks source link

Feature request: Add CLI argument to specify a system prompt #7405

Open Kerrick opened 1 month ago

Kerrick commented 1 month ago

I'd like to be able to set the system prompt from the call to ollama in my shell, rather than in the conversation. For example:

ollama run llama3.1 --system="Your nickname is 'Grass' now"

...or...

ollama run llama3.1 -s "system" "Your nickname is 'Grass' now"

With this ability, I could set up aliases in my shell profile so that I can run system-prompt-customized versions of a model with a single command.

alias grass="ollama run llama3.1 --system=\"Your nickname is 'Grass' now\""

It'd be even better if I could also specify a path to a text file with a system prompt (e.g. ollama run llama3.1 --system-file="~/system_prompts/grass.txt", but that wouldn't be necessary.

This is unique from #807, whose fix only works in the conversation.

captaincurrie commented 1 month ago

There was a pull request for this many months ago, #3134