Sefism is free for learners. We are here to help you grow, one step at a time.Join for free
Sefism.
Guide · AI & Machine LearningFree

Prompt Engineering Guide

DAIR.AI's free, open-source guide to prompting and building with LLMs. It surveys techniques from few-shot and chain-of-thought prompting to retrieval augmented generation and agents, with links to the research papers behind each one, plus sections on models, applications and risks such as prompt injection. It is for developers and students who want a provider-neutral map of the field and the evidence behind common advice.

Topics
GitHub stars

78.6k

GitHub · Sept 2026

Forks

8.6k

GitHub · Sept 2026

Last repo update

March 2026

GitHub · Sept 2026

Licence

MIT

GitHub · Sept 2026

Format

Guide

Topic

AI & Machine Learning

Provider

DAIR.AI

Time needed

A few hours

Level

All

Access

Free

What is inside

The guide is organised into sections you can dip into:

  • Introduction: LLM settings (temperature, top-p and so on), prompt elements and general tips.
  • Prompting techniques: zero-shot and few-shot, chain-of-thought, self-consistency, generated knowledge, prompt chaining, tree of thoughts, retrieval augmented generation, ReAct and more, each with a short explanation, an example and the source paper.
  • AI agents: components of an agent and function calling.
  • Applications: fine-tuning, code generation, generating synthetic data.
  • Prompt Hub: example prompts grouped by task.
  • Models: notes on widely used LLMs.
  • Risks and misuses: adversarial prompting, prompt injection, factuality and bias.
  • Research findings and a papers list for further reading.

The GitHub repository behind it had about 78,600 stars and 8,600 forks as of September 2026, making it one of the most widely used open prompting references. It is MIT-licensed; the last repository update was in March 2026.

Why the citations matter

A lot of prompting advice circulates as folklore, and some of it was never true or stopped being true as models improved. Because each technique links to its paper, you can check when it was published, which models it was tested on, and how large the effect was. Techniques that gave big gains on 2022 models sometimes add little on current ones.

How to use it

  • Read the introduction and the core techniques (few-shot, chain-of-thought, prompt chaining) in one sitting of an hour or two.
  • Treat the rest as a reference to look up when you meet a term or a problem.
  • Try each technique on a task of your own and compare results with a plain prompt. Keep what measurably helps.
  • For the specific model you are building on, follow the provider's own prompting documentation, which reflects how that model was trained and changes with new versions.

Where it is thin

It is a survey, so explanations are short. Some model pages and examples lag behind the newest releases, and it does not teach systematic evaluation in depth. Pair it with a practical course on evaluation, or Anthropic's and OpenAI's prompting guides, when you are shipping a feature.

DAIR.AI also runs paid courses through its academy (for example on prompt engineering and building AI agents). The guide itself is free.

Common questions

Is it free? Yes. The guide is free to read and the source is open.

Is it tied to one provider? No. Examples mostly use common APIs, but the techniques are general.

Is it suitable for beginners? Yes for the introduction and basic techniques. Later sections assume some familiarity with LLM APIs.

Best for: developers and students who want a free, evidence-linked overview of prompting techniques and LLM concepts.

aillmfree courseopen source

Ready to start?

Opens on DAIR.AI in a new tab.

Open resource
Link broken or out of date?

Report a problem

With "Prompt Engineering Guide". Only Tauseef reads this.

Work with me

Stuck on something specific?

Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.