Skip to content

Model-agnostic · OpenAI · Anthropic · Ollama

Prompt engineering, treated like software — not a listicle of tips.#

A production-grade curriculum for engineers building reliable LLM systems: design patterns, failure modes, security threats, testing strategies, and evaluation pipelines — each backed by a runnable notebook and a mini-project with real model output.

# clone & enter
$ git clone https://github.com/himanshu231204/prompt-engineering-mastery.git
$ cd prompt-engineering-mastery

# set up environment
$ python -m venv venv && source venv/bin/activate
$ pip install -r requirements.txt

# configure a provider
$ cp .env.example .env
# edit .env → OPENAI_API_KEY | ANTHROPIC_API_KEY | (Ollama needs none)

# launch module 01
$ jupyter notebook 01-foundations/notebook.ipynb
[NotebookApp] Serving notebooks from 01-foundations/
[NotebookApp] Kernel started — ready.
7
Modules, foundations → security & eval
7
Mini-projects with visible artifacts
3
Supported providers — OpenAI, Anthropic, Ollama
MIT
License — free to use, fork, extend

Why this repo#

Every claim below is a design decision made in this repo, not marketing copy.

  • Model-agnostic by construction

    Every example runs through the shared utils/llm_client.py abstraction. Switch OpenAI → Anthropic → Ollama by changing one parameter, never rewriting a prompt.

  • Proof, not theory

    Every technique ships a runnable notebook demonstrating real before/after model output, plus a mini-project that produces a visible artifact you can inspect.

  • Security is a full module

    Module 06 covers adversarial prompting, injection, jailbreaking, and OWASP Top 10 for LLM Applications — treated as an architectural requirement, not an afterthought.

  • Evaluation is automated

    Module 07 introduces DeepEval — pytest-native, CI-compatible evaluation — so prompt regressions are caught the same way code regressions are.

  • Diagrams matched to concept

    Mermaid diagrams are chosen by what they depict — flowcharts for logic, sequence diagrams for calls, architecture diagrams for systems — not dropped in decoratively.

  • Lifecycle, not one-off strings

    Prompts move through plan → draft → version → test → store → deploy → monitor, with Promptmetheus for drafting and versioning.

Curriculum#

Start at Module 01 and work forward. Already shipping LLM systems? Jump straight to 06 and 07 — the parts most prompt content skips.

# Module What you learn Mini-project Difficulty
01 Foundations LLM mechanics, temperature, top-p, top-k, tokens Parameter Playground Beginner
02 Essential Strategies Zero/one/few-shot, system instructions, delimiters Few-Shot Classifier Builder Beginner
03 Reasoning & Logic Chain of Thought, Self-Consistency, Plan-and-Solve Math Word Problem Solver Intermediate
04 Complex Workflows Chain of Draft, System 2 Attention, chaining, meta prompting Auto Prompt Optimizer Advanced
05 Multimodal & Applied RAG prompting, image/video generation, multimodal inputs Mini RAG Prompting Kit Intermediate
06 Security & Robustness Adversarial prompting, injection, jailbreaking, OWASP Top 10 Prompt Injection Test Harness Advanced
07 Prompt Management Lifecycle, versioning, Promptmetheus, DeepEval evaluation Prompt Eval Pipeline Advanced