RUNLOCALAIv38
->Will it run?Best GPUCompareTroubleshootStartLearnPulseModelsHardwareToolsBench
Run check
RUNLOCALAI

Independently operated catalog for local-AI hardware and software. Hand-written verdicts. Source-cited claims. Reproducible commands when we have them.

OP·Eruo Fredoline
DIR
  • Models
  • Hardware
  • Tools
  • Benchmarks
TOOLS
  • Will it run?
  • Compare hardware
  • Cost vs cloud
  • Choose my GPU
  • Prompting kits
  • Quick answers
REF
  • All buyer guides
  • Learn local AI
  • Methodology
  • Glossary
  • Errors KB
  • Trust
EDITOR
  • About
  • Author
  • How we make money
  • Editorial policy
  • Contact
LEGAL
  • Privacy
  • Terms
  • Sitemap
MAIL · MONTHLY DIGEST
Get monthly local AI changes
Monthly recap. No spam.
DISCLOSURE

Some links on this site are affiliate links (Amazon Associates and other first-class retailers). When you buy through them, we earn a small commission at no extra cost to you. Affiliate links do not influence our verdicts — there are cards we rate highly that we don't have affiliate relationships with, and cards that sell well that we refuse to recommend. Read more →

© 2026 runlocalai.coIndependently operated
RUNLOCALAI · v38
  1. >
  2. Home
  3. /Learn
  4. /Courses
  5. /What is Local AI — And Why It Matters
  6. /Ch. 12
What is Local AI — And Why It Matters

12. System Prompts

Chapter 12 of 20 · 18 min
KEY INSIGHT

System prompts let you define the model's persona, rules, and behavior before any conversation happens—and Modelfiles let you save these configurations as reusable custom models.

What is a System Prompt?

When you interact with a model, there are different "layers" to the conversation:

  1. System prompt: Your instructions about how the model should behave
  2. User prompt: The actual question or request
  3. Response: The model's output

The system prompt sets the context. Without it, the model responds as a generic assistant. With it, you can shape behavior.

How System Prompts Work

When you start a conversation, you can send a system prompt:

System: You are a helpful coding assistant. You write clean, well-documented 
Python code with type hints and docstrings.

User: Write a function to calculate compound interest

The system prompt is like giving the model a persona or set of instructions that persists throughout the conversation.

Practical System Prompt Examples

Formal writing assistant:

You are a professional technical writer. Your responses are clear, concise, 
and well-structured. You use active voice, short paragraphs, and avoid 
unnecessary jargon.

Code reviewer:

You are a senior software engineer conducting code review. You focus on:
1. Correctness and edge cases
2. Performance implications
3. Security vulnerabilities
4. Code readability
Be specific in your feedback, citing actual code snippets when suggesting changes.

Explainer:

You explain technical concepts as if to a smart non-expert. You use analogies, 
concrete examples, and avoid jargon. When a concept requires technical terms, 
you define them immediately.

Socratic tutor:

You teach through questions, not answers. When asked a question, respond with 
a clarifying question that helps the student discover the answer themselves. 
Only provide direct answers when the student is truly stuck.

Ollama System Prompts

With Ollama, you can set system prompts in several ways:

In the run command:

ollama run llama3.2:7b --verbose "Your system prompt here"

Creating a custom model:

# Create a Modelfile
cat > Modelfile << 'EOF'
FROM llama3.2:7b
SYSTEM """
You are a pirate assistant. Ye always speaks in pirate dialect, 
uses "arr" and "ye", and gives maritime-themed responses.
"""
EOF

# Create the model
ollama create pirate-assistant -f Modelfile

# Run it
ollama run pirate-assistant

Modelfile example for coding assistant:

cat > coding-assistant << 'EOF'
FROM llama3.2:7b
SYSTEM """
You are an expert Python developer. You write:
- Clean, readable code with meaningful variable names
- Type hints on all functions
- Docstrings using Google style
- Error handling for expected failure cases
- No comments explaining obvious code
- PEP 8 compliant formatting
"""
PARAMETER temperature 0.3
EOF

ollama create python-dev -f coding-assistant

Parameters in Modelfile

You can set generation parameters in the Modelfile:

PARAMETER temperature 0.7
PARAMETER top_p 0.9
PARAMETER num_ctx 4096

More on these in Chapter 13.

EXERCISE

Create three different system prompts for the same task (summarizing documents). Make one formal (executive summary style), one technical (detailed with terminology), and one accessible (for a non-expert). Run the same document through each and compare outputs. Notice how the system prompt changes not just the content but the style and focus.

← Chapter 11
Understanding Model Responses
Chapter 13 →
Temperature and Sampling