AI / A CONCEPT NOTE

System Prompt

setting the model's behavior and constraints

~65 sec read

Overview · mechanism
pitfall · examples

01 / THE SHORT VERSION

The idea in a few sentences.

The foundational instruction injected at the start of a conversation that defines the model's persona, tone, safety limits, and execution rules.

02 / FOLLOW THE MECHANISM

How system instructions guide runs

  1. System setup

    developer sets instructions: 'You are a senior DevOps assistant. Speak in short sentences.'

  2. Injection

    API appends the system message prefix to prompt.

  3. LLM generation

    model reads prefix, applying constraints across response paths.

04 / COMMAND NOTES

Read the command, then the result.

Inspect the flags and arguments before trying an example. Snippets can need local setup, replacement values, or resources in your own environment.

EXAMPLE 01 · REFERENCE

set system prompt locally in Ollama

curl -X POST -d '{"model":"llama3","system":"You are a code compiler","prompt":"2+2"}' http://localhost:11434/api/generate

Explore command anatomy in the CLI lab