# Llama Models Prompt Guide

**Table of Contents**

1. [Be Explicit and Direct](#id-1.-be-explicit-and-direct)
2. [Assign a Role](#id-2.-assign-a-role)
3. [Ask for Step-by-Step Reasoning](#id-3.-ask-for-step-by-step-reasoning)
4. [Use Few-Shot Examples](#id-4.-use-few-shot-examples)
5. [Constrain Outputs](#id-5.-constrain-outputs)
6. [Maintain Multi-Turn Consistency](#id-6.-maintain-multi-turn-consistency)
7. [Improve Reliability with Sampling](#id-7.-improve-reliability-with-sampling)
8. [Practical Prompt Templates by Use Cases](#id-8.-practical-prompt-templates-by-use-case)

***

### 1. Be Explicit and Direct

Say exactly what you want: **length, format, tone**. Avoid vague instructions.

**Less effective:**

```
Summarize this report
```

**More effective:**

```
Summarize this report into 3 bullet points, under 15 words each, highlighting decisions and deadlines.
```

***

### 2. Assign a Role

Set Llama’s perspective by giving it a role. This shapes style and tone.

**Example:**

```
You are a financial analyst. Provide concise, professional reports in plain English.
```

***

### 3. Ask for Step-by-Step Reasoning

Encourage Llama to **show its work** when reasoning matters.

**Example:**

```
Solve this math problem. Show your reasoning step by step before giving the final answer.
```

***

### 4. Use Few-Shot Examples

Demonstrate the format you want by showing Llama short examples.

```
User: Translate English to French.
English: "Good morning"
French: "Bonjour"

Output:
English: "How are you?"
French: "Comment ça va?"
```

***

### 5. Constrain Outputs

If you need structured data, specify the format (JSON, CSV, table, bullets).

**Example:**

```
Summarize this meeting into JSON with fields: decisions, next_steps, owners
```

**Output:**

```json
{
  "decisions": "Budget approved",
  "next_steps": "Launch campaign",
  "owners": "Marketing team"
}
```

***

### 6. Maintain Multi-Turn Consistency

If conversations run long, remind Llama of prior rules.

**Example:**

```
Remember to always answer in JSON format
```

***

### 7. Improve Reliability with Sampling

For tasks requiring correctness, run multiple outputs and compare.

**Example:**

```
Run Llama 5 times on this reasoning task. Choose the most common answer.
```

***

### 8. Prompt Templates by Use Case

**General Task Template**

```
You are a project manager.
Summarize this meeting transcript into 5 bullet points, under 15 words each.
Context: This will be shared with the executive team.
Constraints: Only include decisions and deadlines.
Output:
• Budget increase approved
• Deadline extended to Q4
• Hiring 3 new engineers
• Product beta launch in June
• Next review set for July 15
```

**Few-Shot Template -** Best for translation or classification tasks.

```
User: Translate English to French. Follow the examples below and keep answers short and accurate.

English: "Good morning"
French: "Bonjour"

English: "How are you?"
French: "Comment ça va ?"

English: "See you tomorrow"
French:
Output: "À demain"
```

**Analyze a Dataset**

```
Role: You are a data analyst.
Task: Summarize this dataset into concise business insights.
Context: Results will be presented in a leadership sync; clarity and brevity are key.
Constraints:
• Max 100 words
• Use 3 bullet points only
• Avoid numbers with decimals or complex terms

Output Example:
• Sales rose in Q3 due to strong repeat customers  
• Costs stabilized after Q2 vendor negotiations  
• Recommend focusing on B2B accounts for sustained growth

Tip: For numeric output, specify “Round all figures to whole numbers.”
```

**Summarize Emails and Next Steps**

```
Role: You are an executive assistant.
Task: Summarize this email thread and list next steps.
Context: Output will be pasted into a meeting note document.
Constraints:
• Limit summary to 3 sentences
• Use bullet format for next steps
• No filler language (“hope this helps,” etc.)

Output Example:
Summary:
The team confirmed the project scope and timeline changes.  
Next Steps:
• Update the client on final delivery date  
• Prepare revised timeline by Monday  
• Confirm approval from finance


Tip: Add “Use plain English, avoid internal jargon.”
```

***

### Final Tip

With Llama, **clarity plus examples = reliability**. Spell out roles, steps, and formats, and you’ll get consistent, structured outputs.

{% hint style="info" %}
*Learn more about Llama Prompt Engineering in the official* [*Prompting Guide*](https://www.llama.com/docs/how-to-guides/prompting/) *and the* [*Llama 4 Prompt Format reference*](https://www.llama.com/docs/model-cards-and-prompt-formats/llama4/)
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.en.theblockbrain.ai/for-users/prompt-writing-guide/llama-models-prompt-guide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
