[GH-ISSUE #297] Provide a way to override the entire prompt template at runtime #46643

Closed
opened 2026-04-27 23:18:02 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @jmorganca on GitHub (Aug 6, 2023).
Original GitHub issue: https://github.com/ollama/ollama/issues/297

Originally assigned to: @jmorganca on GitHub.

This would be for (perhaps more advanced) use cases where a prompt is built outside of Ollama

curl -X POST http://localhost:11434/api/generate -d '{
    "model": "llama2",
    "template": "<<SYS>>..."
}

On prompt vs prompt template:

Prompt: The direct input given to a language model to start generating text. It's the first "nudge" that sets the direction for the model's output. For example, if you're using a chat model, the user's initial question or statement can be considered the prompt. If you're generating a story, the first sentence or paragraph could be the prompt.

Prompt Template: This is a more structured form of a prompt that is used to consistently structure prompts for specific use cases. It can contain placeholders or variables that get filled in with specific content depending on the context. This can be especially useful for maintaining consistency when working with large volumes of data or for certain applications that require a uniform input structure.

Originally created by @jmorganca on GitHub (Aug 6, 2023). Original GitHub issue: https://github.com/ollama/ollama/issues/297 Originally assigned to: @jmorganca on GitHub. This would be for (perhaps more advanced) use cases where a prompt is built outside of Ollama ```bash curl -X POST http://localhost:11434/api/generate -d '{ "model": "llama2", "template": "<<SYS>>..." } ``` On prompt vs prompt template: **Prompt:** The direct input given to a language model to start generating text. It's the first "nudge" that sets the direction for the model's output. For example, if you're using a chat model, the user's initial question or statement can be considered the prompt. If you're generating a story, the first sentence or paragraph could be the prompt. **Prompt Template:** This is a more structured form of a prompt that is used to consistently structure prompts for specific use cases. It can contain placeholders or variables that get filled in with specific content depending on the context. This can be especially useful for maintaining consistency when working with large volumes of data or for certain applications that require a uniform input structure.
GiteaMirror added the feature request label 2026-04-27 23:18:02 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#46643