Model or dataset
NirDiamant/Prompt_Engineering avatar
NirDiamant/Prompt_Engineering

NirDiamant/Prompt_Engineering: 22 Jupyter Notebook Tutorials for LLM Prompting Techniques

22 prompt engineering techniques with hands-on Jupyter Notebook tutorials, from fundamental concepts to advanced strategies for leveraging LLMs.

7,870 stars1,029 forksJupyter NotebookNOASSERTION

At a glance

What is it?
NirDiamant/Prompt_Engineering is a GitHub repository of 22 hands-on Jupyter Notebook tutorials covering prompt engineering from basic prompt templates through advanced techniques like chain-of-thought, self-consistency, and tree-of-thought. It is a study resource for engineers learning how to work with large language models, not a library to import into a project.
Who is it for?
NirDiamant/Prompt_Engineering is appropriate for engineers and researchers who want structured, code-first exposure to prompt engineering techniques with real LLM API calls. It is not a library, a CLI, or a framework.
Can I use it commercially?
Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
Is it still maintained?
Yes. The repository last received commits 8 days ago.
What is it written in?
Mainly Jupyter Notebook, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 28, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

What the Repository Teaches and Who It Is For

Prompt engineering is the practice of designing input text for large language models to improve the quality, reliability, or specificity of their outputs. As LLMs have become practical tools for software development, the techniques for doing this well have accumulated enough complexity to warrant systematic study.

NirDiamant/Prompt_Engineering addresses that gap with a hands-on collection of 22 Jupyter Notebook tutorials. Each notebook covers one technique from basic level (simple prompt templates and zero-shot instructions) through intermediate level (few-shot prompting, chain-of-thought) to advanced level (self-consistency, tree-of-thought, and automatic prompt optimization).

The target user is an engineer who is already working with LLM APIs and wants structured practice with specific techniques, with runnable code to experiment against. The README describes the repository as a comprehensive resource for learning, building, and sharing prompt engineering techniques. It is aimed at individual learners and small research teams, not at production engineering organizations looking for deployment infrastructure.

How the 22 Notebooks Are Organized

All notebooks are stored in the all_prompt_engineering_techniques/ directory. The README describes the content as ranging from basic prompt templates to advanced strategies for leveraging large language models, with chain-of-thought, self-consistency, and tree-of-thought explicitly listed as covered topics.

Each notebook is designed to be self-contained: it imports its dependencies, defines the technique being demonstrated, and shows example LLM interactions that illustrate the technique's effect. This means you can read them in any order rather than following a strict sequence, which is practical when reviewing a specific technique without working through all the preceding material.

The top-level directory also contains a CITATION.cff file for academic citation, a CONTRIBUTING.md for pull request guidelines, an AGENTS.md file, and a llms.txt file. These indicate the repository is designed for a community contribution model: the citation file suggests some users treat it as a reference for academic work.

The requirements.txt pins specific versions for all dependencies, which is a useful starting point for environment reproducibility but means the pinned versions will fall behind the latest releases over time.

Setting Up the Environment to Run the Notebooks

The repository provides a requirements.txt that covers all dependencies. Install everything with:

bash
pip install -r requirements.txt

The requirements.txt includes langchain, langchain-openai, openai, jupyter-related packages (ipykernel, ipython, jupyter_client, jupyter_core), transformers, torch, sentence-transformers, and a set of utility libraries. The full list in the file pins specific versions.

After installing dependencies, open the notebooks with a Jupyter environment. The ipykernel package is included so the notebooks can run in VS Code's notebook interface as well as in a standard Jupyter server.

The requirements.txt also includes python-dotenv, which suggests the notebooks use a .env file for API keys rather than hardcoding them. This is standard practice for notebooks that make LLM API calls, but the README does not document the exact environment variable names each notebook expects.

LLM API Dependencies and Model Providers

The requirements.txt includes langchain-openai and the openai package as explicit dependencies. This points to OpenAI as the primary LLM provider for the tutorials. The langchain package itself is provider-agnostic, so adapting notebooks to use other providers would require changing the LLM constructor calls within each notebook.

The sentence-transformers and transformers packages are also included, which suggests some notebooks use locally-run embedding or model inference rather than always requiring an API call. The torch package at version 2.4.1 supports this local inference path.

The requirements.txt pins openai at version 1.51.1 and langchain at 0.3.2. These are not the latest versions as of the date of this review. The pinned versions ensure reproducible environments for the notebooks as written, but anyone following the tutorials with newer API versions may encounter changed interfaces, particularly for the openai package, which introduced a significant API change between versions 0.x and 1.x.

The README does not document which API key environment variables are required. Testing a notebook before investing time reading through it is the practical way to identify any missing configuration.

Repository Maintenance and Link to External Course

The last push was on 2026-09-15, and the repository continues to receive contributions. The README links extensively to an external paid course called Prompt to Production at diamant-ai.com, which is a separate commercial product from the repository author.

The README's structure mixes open-source content (the notebooks) with promotion for the course, newsletter, and YouTube channel. This is worth noting when evaluating the repository as a learning resource: the core value is in the all_prompt_engineering_techniques/ directory, not in the README's promotional sections.

The CITATION.cff file provides a structured citation for academic work. The CONTRIBUTING.md documents how to submit pull requests. Both indicate the repository is designed to grow through community contributions, which is consistent with the count of 22 techniques: there is no obvious ceiling on adding more.

The license file is listed as NOASSERTION in the repository metadata, meaning GitHub's automated license detection did not identify a recognized license. Before reusing notebook code in another project or publication, verify the actual license terms in the LICENSE file in the repository.

Limitations: Format Constraints and What Is Not Covered

Jupyter Notebooks are a reasonable format for tutorial content, but they carry inherent limitations for serious engineering use. Output cells accumulate as notebooks are run, meaning a downloaded notebook may contain someone else's outputs rather than a clean starting state. The format makes diffs in version control difficult to read, which is why the CONTRIBUTING.md guidelines matter more here than they would for plain Python files.

The repository covers prompting techniques for using LLMs, not the adjacent topics of fine-tuning, retrieval-augmented generation, or model evaluation. Engineers looking for RAG patterns or agent frameworks will need to look at other repositories; the scope here is specifically input prompting strategies.

The pinned dependency versions are a double-edged constraint. They ensure the notebooks run as written, but the openai 1.51.1 and langchain 0.3.2 pins may produce deprecation warnings or require adjustment with newer package versions. There is no automated test suite for the notebooks, so compatibility with newer versions depends on manual testing by contributors.

Prompt_Engineering Notebooks vs Interactive Courses and Dedicated Prompt Libraries

The most direct comparison is with interactive platforms like DeepLearning.AI's short courses on prompt engineering, which are also free, also use Jupyter-style environments, and cover overlapping ground. The difference is that NirDiamant/Prompt_Engineering runs entirely on the reader's machine with their own API keys, giving full access to the code and full control over the LLM calls. DeepLearning.AI's environment is hosted, which is more accessible but less transparent.

For prompt management in production, tools like LangSmith, PromptLayer, or Langfuse provide prompt versioning, evaluation, and tracing infrastructure. NirDiamant/Prompt_Engineering does not address that use case: it is education material, not tooling.

The repository is closer in spirit to a textbook with exercises than to a software library. Each notebook is a chapter demonstrating one technique; the reader runs the cells, adjusts the prompts, and observes the results. This is a fundamentally different value proposition from a production-ready prompt library.

Editorial conclusion

NirDiamant/Prompt_Engineering is appropriate for engineers and researchers who want structured, code-first exposure to prompt engineering techniques with real LLM API calls. It is not a library, a CLI, or a framework. Teams looking for a reusable prompt management system will not find one here. The first practical step before opening any notebook is running pip install -r requirements.txt and confirming that an OpenAI API key is configured in the environment, since the dependencies include langchain-openai and the openai package.

Frequently asked questions

What techniques does the NirDiamant/Prompt_Engineering repository teach?

The repository covers 22 techniques according to the README, including chain-of-thought, self-consistency, and tree-of-thought prompting, progressing from basic prompt templates to advanced strategies. Each technique has a dedicated Jupyter Notebook in the all_prompt_engineering_techniques/ directory.

How do I set up the NirDiamant/Prompt_Engineering environment to run the notebooks?

Run pip install -r requirements.txt to install all dependencies, which include langchain, langchain-openai, openai, and the Jupyter packages needed to open notebooks. The requirements.txt pins specific versions for reproducibility.

Does the NirDiamant/Prompt_Engineering repository require an OpenAI API key?

The requirements.txt includes the openai package and langchain-openai, which indicates the tutorials make OpenAI API calls. The requirements.txt also includes python-dotenv, suggesting API keys are loaded from a .env file, though the README does not document the exact variable names.

Official sources

  1. Issues
  2. NirDiamant/Prompt_Engineering on GitHub
  3. Project website
  4. README
For maintainers

Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/nirdiamant-prompt-engineering.svg)](https://hysenlabs.com/projects/nirdiamant-prompt-engineering)
Community notes

Community notes