From 952335c55a8b9ce6295152c22e590f0d8432a306 Mon Sep 17 00:00:00 2001 From: Nitya Narasimhan Date: Sun, 14 Apr 2024 23:27:42 +0000 Subject: [PATCH] refactor/gen-ai-series --- docs/astro.config.mjs | 10 +- docs/package.json | 2 +- docs/src/content/docs/400/00-overview.md | 49 ++++++++++ docs/src/content/docs/400/01-glossary.md | 30 ++++++ docs/src/content/docs/400/02-resources.md | 91 +++++++++++++++++++ docs/src/content/docs/400/toc.md | 68 -------------- .../docs/400/u001-prompt-engineering.md | 48 ++++++++++ docs/src/content/docs/400/u002-fine-tuning.md | 18 ++++ .../src/content/docs/400/u003-hugging-face.md | 15 +++ .../400/400-00-aoia-intro.ipynb | 0 .../400/400-00-llm-setup.ipynb | 0 .../400/400-01-dl-prompt-engineering.ipynb | 0 .../400/400-09-aoai-fine-tuning.ipynb | 0 .../400/400-09-dl-fine-tuning.ipynb | 0 .../400/400-09-hf-fine-tuning.ipynb | 0 .../400/400-09-oai-fine-tuning.ipynb | 0 .../400/400-25-dl-opensource-models.ipynb | 0 17 files changed, 257 insertions(+), 74 deletions(-) create mode 100644 docs/src/content/docs/400/00-overview.md create mode 100644 docs/src/content/docs/400/01-glossary.md create mode 100644 docs/src/content/docs/400/02-resources.md delete mode 100644 docs/src/content/docs/400/toc.md create mode 100644 docs/src/content/docs/400/u001-prompt-engineering.md create mode 100644 docs/src/content/docs/400/u002-fine-tuning.md create mode 100644 docs/src/content/docs/400/u003-hugging-face.md rename {docs/src/content/docs => notebooks}/400/400-00-aoia-intro.ipynb (100%) rename {docs/src/content/docs => notebooks}/400/400-00-llm-setup.ipynb (100%) rename {docs/src/content/docs => notebooks}/400/400-01-dl-prompt-engineering.ipynb (100%) rename {docs/src/content/docs => notebooks}/400/400-09-aoai-fine-tuning.ipynb (100%) rename {docs/src/content/docs => notebooks}/400/400-09-dl-fine-tuning.ipynb (100%) rename {docs/src/content/docs => notebooks}/400/400-09-hf-fine-tuning.ipynb (100%) rename {docs/src/content/docs => notebooks}/400/400-09-oai-fine-tuning.ipynb (100%) rename {docs/src/content/docs => notebooks}/400/400-25-dl-opensource-models.ipynb (100%) diff --git a/docs/astro.config.mjs b/docs/astro.config.mjs index 63a03aa..2f6b8ee 100644 --- a/docs/astro.config.mjs +++ b/docs/astro.config.mjs @@ -14,7 +14,7 @@ export default defineConfig({ description: 'Python3 Cookbook. One Recipe A Day.', tableOfContents: { minHeadingLevel: 2, - maxHeadingLevel: 3 + maxHeadingLevel: 4 }, logo: { light: './src/assets/logo.png', @@ -35,19 +35,19 @@ export default defineConfig({ link: 'introduction', }, { - label: '1 | Python Basics', + label: '100. Python Basics', autogenerate: { directory: '100' }, }, { - label: '2 | Data Analysis', + label: '200. Data Analysis', autogenerate: { directory: '200' }, }, { - label: '3 | Machine Learning', + label: '300. Machine Learning', autogenerate: { directory: '300' }, }, { - label: '4 | Generative AI', + label: '400. Generative AI', autogenerate: { directory: '400' }, }, ], diff --git a/docs/package.json b/docs/package.json index cac86e0..e5ae841 100644 --- a/docs/package.json +++ b/docs/package.json @@ -3,7 +3,7 @@ "type": "module", "version": "0.0.1", "scripts": { - "dev": "astro dev", + "dev": "astro telemetry disable && astro dev", "start": "astro dev", "build": "astro check && astro build", "preview": "astro preview", diff --git a/docs/src/content/docs/400/00-overview.md b/docs/src/content/docs/400/00-overview.md new file mode 100644 index 0000000..8078a67 --- /dev/null +++ b/docs/src/content/docs/400/00-overview.md @@ -0,0 +1,49 @@ +--- +title: "Overview" +description: Explore Python SDKs and tools for building generative AI applications +--- + +:::tip[Learning Objectives] +The 400-level section will cover the growing ecosystem of generative AI tools, technologies and platforms from a developer perspective. + +- Fundamental Terms & Concepts for Generative AI +- Core Developer Tools, Technologies & Platforms +- Popular Models, Model Providers & Applications +- Cookbook: Recipes for frequently-done tasks +- Solution: End-to-End workflow for one signature app +::: + + + +## 01 | Fundamental Concepts + +Generative AI has a number of core concepts we need to know more about - like prompt engineering, model fine-tuning, responsible AI, evaluation, LLM Ops etc. Use this section to provide links to _relevant papers, tools and tutorials_ that teach fundamentals. + + +## 02 | Developer Tools + +Building generative AI applications requires tools for building apps, evaluating models, deploying solutions, and orchestrating end-to-end workflows. Use this section to provides links to relevant _libraries, frameworks and platforms_ that generative AI developers should know. + + +## 03 | Provider Ecosystem + +Generative AI applications are driven by _language models_ - both Large Language Models (pre-trained on massive datasets) and Small Language Models (fine-tuned for specialized domains), and variants based on needs e.g., Large Multi-Modal Models (LMMs). Use this section to track the growing model providers ecosystem (and relevant models) gaining mindshare with developers. Some examples to start with: + +| Provider | Resources | +| --- | --- | +| **[OpenAI](https://platform.openai.com/docs/overview)** | **Models :** [Embeddings](https://platform.openai.com/docs/models/embeddings) · [Moderation](https://platform.openai.com/docs/models/moderation) · [GPT](https://openai.com/gpt-4) · [DALL-E](https://openai.com/dall-e-3) · [Whisper](https://platform.openai.com/docs/models/whisper) · [TTS](https://platform.openai.com/docs/models/tts) · [Sora](https://openai.com/sora) ▫️ **Apps :** [ChatGPT](https://openai.com/chatgpt) ▫️ **Responsible AI :** [Safety](https://openai.com/safety) | +| **[Azure AI](https://www.microsoft.com/en-us/ai)** | **Models :** [Catalog](https://ai.azure.com/explore/models) · [Benchmarks](https://ai.azure.com/explore/benchmarks) · [Prompts](https://ai.azure.com/explore/prompts) ▫️ **Apps :** [Contoso Chat](https://github.com/Azure-Samples/contoso-chat) ▫️ **Responsible AI :** [Tools](https://www.microsoft.com/en-us/ai/responsible-ai) | +| **[Hugging Face](https://huggingface.co/)** | **Models :** [Model Hub](https://huggingface.co/models) · [Hugging Chat](https://huggingface.co/chat/) · [Courses](https://huggingface.co/learn) · [Cookbook](https://huggingface.co/learn/cookbook/index) ▫️ **Apps :** [Society of Ethics](https://huggingface.co/ethics) ▫️ **Responsible AI :** [Principles](https://huggingface.co/ethics) | +| **[Google AI](https://ai.google/)** | **Models :** [Gemini](https://deepmind.google/technologies/gemini/#introduction) · [Palm](https://ai.google/discover/palm2/) · [Imagen](https://ai.google/discover/foundation-models/) · [MedLM](https://ai.google/discover/foundation-models/) · [Codey](https://ai.google/discover/foundation-models/) · [Chirp](https://ai.google/discover/foundation-models/) · [Gemma](https://ai.google.dev/gemma) (open models) ▫️ **Apps :** [Examples](https://ai.google.dev/examples) ▫️ **Responsible AI :** [Principles](https://ai.google/responsibility/principles/) | + +## 04 | Developer Cookbook + +This section and the next are focused specifically on _developers_ and capturing tutorials or "recipes" that cover common tasks or workflows in generative AI applications. These should ideally be code-first (snippets) with documentation (what, why) in notebooks. + + +## 05 | End-to-End Samples + +This section captures _real-world applications samples_ that show end-to-end developer workflows from ideation to operationalization, potentially with different platforms (cloud) and providers (model) to get developers a sense or practical challenges and design patterns for production use. diff --git a/docs/src/content/docs/400/01-glossary.md b/docs/src/content/docs/400/01-glossary.md new file mode 100644 index 0000000..a15c59a --- /dev/null +++ b/docs/src/content/docs/400/01-glossary.md @@ -0,0 +1,30 @@ +--- +title: "Glossary" +description: This section provides a glossary of terms used in the generative AI lessons for reference and consistency of usage. +--- + +_This page provides a glossary of terms used in the generative AI lessons as a quick reference and for ensuring consistent usage._ + +--- + +## F + +1. **Fine-tuning** ▫️ The process of training a pre-trained model on a specific dataset to adapt it to a specific task or domain. + +## G + +1. **Generative AI** ▫️ A class of AI applications that create original content (text, images, audio, code) in response to an input request. + +## I +1. **Inference** ▫️ The process of using a trained model to generate responses to user prompts. This typically involves a deployed endpoint (API). + +## L +1. **LLM** ▫️ Large Language Models that are pre-trained on large amounts of text data and fine-tuned for task-based inference. + +## P +1. **Prompt** ▫️ A user request (using natural language) that is fed to a generative AI model to get a relevant response. +1. **Prompt Engineering** ▫️ The process of designing and refining prompts to get relevant responses from a generative AI model. + +## T +1. **Task** ▫️ The specific job that the model is expected to perform as a response to prompt. Ex: Text Summarization, Translation, Code Generation etc. + diff --git a/docs/src/content/docs/400/02-resources.md b/docs/src/content/docs/400/02-resources.md new file mode 100644 index 0000000..afbb1fd --- /dev/null +++ b/docs/src/content/docs/400/02-resources.md @@ -0,0 +1,91 @@ +--- +title: Resources +description: Suggested structure and learning path for this section +--- + +This page helps capture reusable resources for the various recipes and topics covered in this 400-level series. This can also include _roadmaps_ to help provide more structured navigation of topics by top-level categories. + +## Books To Read + +This is my list of books to read to build depth of understanding in this space. Keep in mind that the field is evolving rapidly, so content may get outdated if not refreshed. + +| Title | Year | Notes | +|---|---|---| +| [Natural Language Processing with Transformers, Revised Edition](https://www.oreilly.com/library/view/natural-language-processing/9781098136789/) | 2022 | ▫️ | +| [Generative AI on AWS](https://www.oreilly.com/library/view/generative-ai-on/9781098159214/) | 2023 | ▫️ | +| [Prompt Engineering For Generative AI](https://www.oreilly.com/library/view/prompt-engineering-for/9781098153427/) | 2024 | ▫️ | +| [AI Powered Search](https://www.manning.com/books/ai-powered-search) | 2024 | ▫️ | +| [Developing Apps with GPT-4 and ChatGPT, 2nd Edition](https://www.oreilly.com/library/view/developing-apps-with/9781098168094/) | 2024 | ▫️ | +| [Hands-On Large Language Models](https://www.oreilly.com/library/view/hands-on-large-language/9781098150952/) | 2024| ▫️ | +| [Hands-On Generative AI with Transformers and Diffusion Models](https://www.oreilly.com/library/view/hands-on-generative-ai/9781098149239/) | 2024 | ▫️ | +| [Prompt Engineering for LLMs](https://www.oreilly.com/library/view/prompt-engineering-for/9781098156145/) | 2025 | ▫️ | +| [Generative AI on Google Cloud](https://www.oreilly.com/library/view/generative-ai-on/9781098159016/) | 2025 | ▫️ | +| [Build a Large Language Model (From Scratch)](https://www.manning.com/books/build-a-large-language-model-from-scratch) | 2025 | ▫️ | +| | | | + +## Videos To Watch + +| Title | Year | Notes | +|---|---|---| +| [Let's Build GPT From Scratch](https://www.youtube.com/watch?v=kCc8FmEb1nY) (2hr) | 2023| ▫️ | +| [Intro to Large Language Models](https://www.youtube.com/watch?v=zjkBMFhNj_g) (1hr) | 2024| ▫️ | +| [Let's Build the GPT Tokenizer](https://www.youtube.com/watch?v=zduSFxRajkE) (2hr+) | 2024 | ▫️ | +| [But what is a GPT? Visual intro to transformers](https://www.youtube.com/watch?v=wjZofJX0v4M&list=PLZHQObOWTQDNU6R1_67000Dx_ZCJB-3pi&index=5&pp=iAQB) (30m) | 2024| ▫️ | +| [Attention in Transformers, visually explained](https://www.youtube.com/watch?v=eMlx5fFNoYc&list=PLZHQObOWTQDNU6R1_67000Dx_ZCJB-3pi&index=6&pp=iAQB) (30m)|2024 | ▫️ | +| | | | + + + +## Courses To Take + +### 1. Deep Learning.AI + +I recommend the [Deep Learning Short Courses](https://www.deeplearning.ai/short-courses/) for fast, actionable learning of core concepts from industry experts. Each course takes 1 hour, ranging from 100-level (beginner) to 300-level (advanced). Most require only basic Python knowledge - some need advanced experience with libraries like PyTorch that you can pick up as you go. Courses are listed from oldest to newest - older courses may have deprecated content. + +:::tip[My Study Notes] +_The Notes link reflects my learnings as recipes for my future reference. If you follow this roadmap, please reference and attribute the original courses directly._ +::: + +| Level | Course | Creator | Notes | +|---|---|---|---| +| 100 | [ChatGPT Prompt Engineering For Developers](https://www.deeplearning.ai/short-courses/chatgpt-prompt-engineering-for-developers/) | OpenAI | ▫️ | +| 100 | [Building Systems with the ChatGPT API](https://www.deeplearning.ai/short-courses/building-systems-with-chatgpt/)| OpenAI | ▫️ | +| 100 | [LangChain for LLM Application Development](https://www.deeplearning.ai/short-courses/langchain-for-llm-application-development/) | LangChain | ▫️ | +| 200 | [How Diffusion Models Work](https://www.deeplearning.ai/short-courses/how-diffusion-models-work/)| Lamini | ▫️ | +| 100 | [LangChain: Chat with Your Data](https://www.deeplearning.ai/short-courses/langchain-chat-with-your-data/) | LangChain| ▫️ | +| 100 | [Building Generative AI Applications with Gradio](https://www.deeplearning.ai/short-courses/building-generative-ai-applications-with-gradio/)| HuggingFace| ▫️ | +| | [Evaluating and Debugging Generative AI Models Using Weights and Biases](https://www.deeplearning.ai/short-courses/evaluating-debugging-generative-ai/) | Weights & Biases | ▫️ | +| 100 | [Large Language Models with Semantic Search](https://www.deeplearning.ai/short-courses/large-language-models-semantic-search/) |Cohere| ▫️ | +| 200 | [Finetuning Large Language Models](https://www.deeplearning.ai/short-courses/finetuning-large-language-models/) | Lamini | ▫️ | +| 100 | [How Business Thinkers Can Start Building AI Plugins With Semantic Kernel](https://www.deeplearning.ai/short-courses/microsoft-semantic-kernel/) | Microsoft | ▫️ | +| 100 | [Understanding and Applying Text Embeddings](https://www.deeplearning.ai/short-courses/google-cloud-vertex-ai/) | Google Cloud | ▫️ | +| 100 | [Pair Programming with a Large Language Model](https://www.deeplearning.ai/short-courses/pair-programming-llm/) | Google | ▫️ | +| 200 | [Functions, Tools and Agents with LangChain](https://www.deeplearning.ai/short-courses/functions-tools-agents-langchain/) | LangChain | ▫️ | +| 200 | [Vector Databases: from Embeddings to Applications](https://www.deeplearning.ai/short-courses/vector-databases-embeddings-applications/) | Weaviate| ▫️ | +| 100 | [Quality and Safety for LLM Applications](https://www.deeplearning.ai/short-courses/quality-safety-llm-applications/) | whylabs | ▫️ | +| 100 | [Building and Evaluating Advanced RAG Applications](https://www.deeplearning.ai/short-courses/building-evaluating-advanced-rag/) | Truera | ▫️ | +| 200 | [Reinforcement Learning from Human Feedback](https://www.deeplearning.ai/short-courses/reinforcement-learning-from-human-feedback/) |Google Cloud | ▫️ | +| 200 | [Advanced Retrieval for AI with Chroma](https://www.deeplearning.ai/short-courses/advanced-retrieval-for-ai/) | chroma | ▫️ | +| 200 | [Build LLM Apps with LangChain.js](https://www.deeplearning.ai/short-courses/build-llm-apps-with-langchain-js/) | LangChain| ▫️ | +| 100 | [LLMOps](https://www.deeplearning.ai/short-courses/llmops/) | Google Cloud | ▫️ | +|200 | [Automated Testing for LLMOps](https://www.deeplearning.ai/short-courses/automated-testing-llmops/) | circleci | ▫️ | +| 100 | [Building Applications with Vector Databases](https://www.deeplearning.ai/short-courses/building-applications-vector-databases/) | Pinecone | ▫️ | +| 200 | [Serverless LLM apps with Amazon Bedrock](https://www.deeplearning.ai/short-courses/serverless-llm-apps-amazon-bedrock/) | AWS | ▫️ | +| 100 | [Prompt Engineering with LLama 2](https://www.deeplearning.ai/short-courses/prompt-engineering-with-llama-2/) | Meta | ▫️ | +| 100 | [Open Source Models with Hugging Face](https://www.deeplearning.ai/short-courses/open-source-models-hugging-face/) | HuggingFace | ▫️ | +| 200 | [Knowledge Graphs for RAG](https://www.deeplearning.ai/short-courses/knowledge-graphs-rag/) | neo4j | ▫️ | +| 200 | [Efficiently Serving LLMs](https://www.deeplearning.ai/short-courses/efficiently-serving-llms/) | Predibase | ▫️ | +| 100 | [JavaScript RAG Web Apps with LlamaIndex](https://www.deeplearning.ai/short-courses/javascript-rag-web-apps-with-llamaindex/) | LlamaIndex | ▫️ | +| 100 | [Red Teaming LLM Applications](https://www.deeplearning.ai/short-courses/red-teaming-llm-applications/) | Giskard | ▫️ | +| 100 | [Preprocessing Unstructured Data for LLM Apps](https://www.deeplearning.ai/short-courses/preprocessing-unstructured-data-for-llm-applications/) 🆕 | Unstructured | ▫️ | +| --- | [-]() | - | ▫️ | + + +## Roadmaps To Learn + +This is a list of roadmaps that I find useful to track, to understand the landscape of generative AI and curated paths to follow for structured self-paced learning. + +| Roadmap | Description | Notes | +|---|---|---| +| [Prompt Engineering Roadmap](https://roadmap.sh/prompt-engineering) | Last visited 04/24 | ▫️ | +| | | | diff --git a/docs/src/content/docs/400/toc.md b/docs/src/content/docs/400/toc.md deleted file mode 100644 index 57136d2..0000000 --- a/docs/src/content/docs/400/toc.md +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: 1. Introduction -description: Explore Python SDKs and tools for building generative AI applications ---- - -:::tip About Lessons - -Each Lesson has a Lab and an HTML link. -- The first is an executable Jupyter notebook for interactive learning. You must open this in Visual Studio Code with a suitable runtime (e.g., GitHub Codespaces). It cannot be viewed in a browser. -- The second is a static HTML version of the notebook suitable for viewing in a browser. To view it within Visual Studio Code use `Ctrl+K, V`. - -For LLM providers, I will focus on three deployment options: OpenAI, Azure OpenAI, and Hugging Face. -Check the `.env.sample` for updated LLM providers and relevant environment variables needed in context. - -::: - - - -## Prompt Engineering - -The [Prompt Engineering Roadmap](https://roadmap.sh/prompt-engineering) shown below (captured Apr 2024). Please refer to the linekd source for updates. Each box has a list of relevant resources. - -![](./../../../assets/prompt-engineering-roadmap.png) - -## Deep Learning.AI - -The [Deep Learning Short Courses](https://www.deeplearning.ai/short-courses/) series created in conjunction with key industry partners. The table lists courses in chronological order (older courses may have deprecated concepts or APIs). Levels are 100 (beginner) to 300 (advanced) - and most should have a Python SDK or sample. **All courses are 1 hour in length unless specified otherwise.** Most require basic Python knowledge. Some require familiarity with advanced frameworks like PyTorch or TensorFlow. - -| Course | Collaborator | Level | Description | Lab | -|---|---|---|---|---| -| 1. [ChatGPT Prompt Engineering For Developers](https://www.deeplearning.ai/short-courses/chatgpt-prompt-engineering-for-developers/) | Isa Fulford, Open AI| 100-300 | Go beyond the chat box. Use API access to leverage LLMs into your own applications, and learn to build a custom chatbot.| ✅ | -| 2. [Building Systems with the ChatGPT API](https://www.deeplearning.ai/short-courses/building-systems-with-chatgpt/) | Isa Fulford, Open AI| 100-300 |Level up your use of LLMs. Learn to break down complex tasks, automate workflows, chain LLM calls, and get better outputs.| -| 3. [LangChain for LLM Application Development](https://www.deeplearning.ai/short-courses/langchain-for-llm-application-development/) | Harrison Chase, LangChain| 100 | The framework to take LLMs out of the box. Learn to use LangChain to call LLMs into new environments, and use memories, chains, and agents to take on new and complex tasks.| -| 4. [How Diffusion Models Work](https://www.deeplearning.ai/short-courses/how-diffusion-models-work/) | Sharon Zhou, Lamini | 200 | Learn and build diffusion models from the ground up. Start with an image of pure noise, and arrive at a final image, learning and building intuition at each step along the way.| -| 5. [LangChain: Chat with Your Data](https://www.deeplearning.ai/short-courses/langchain-chat-with-your-data/) | Harrison Chase, LangChain | 100 | Create a chatbot to interface with your private data and documents using LangChain.| | -| 6. [Building Generative AI Applications with Gradio](https://www.deeplearning.ai/short-courses/building-generative-ai-applications-with-gradio/) |Apolinário Passos, Hugging Face | 100 | Create and demo machine learning applications quickly. Share your app with the world on Hugging Face Spaces.| | -| 7. [Learn MLOps tools for managing, versioning, debugging and experimenting in your ML workflow.](https://www.deeplearning.ai/short-courses/evaluating-debugging-generative-ai/) | Carey Phelps, Weights & Biases | 200 |Learn MLOps tools for managing, versioning, debugging and experimenting in your ML workflow. | | -| 8. [Large Language Models with Semantic Search](https://www.deeplearning.ai/short-courses/large-language-models-semantic-search/) | Jay Alammar, Luis Serrano, Cohere | 100 | Learn to use LLMs to enhance search and summarize results.| | -| 9. [Finetuning Large Language Models](https://www.deeplearning.ai/short-courses/finetuning-large-language-models/) | Sharon Zhou, Lamini | 200 |Learn to finetune an LLM in minutes and specialize it to use your own data | | -| 10. [How Business Thinkers Can Start Building AI Plugins With Semantic Kernel](https://www.deeplearning.ai/short-courses/microsoft-semantic-kernel/) | John Maeda, Microsoft | 100 |Learn Microsoft’s open source orchestrator, Semantic Kernel, and develop business applications using LLMs. | | -| 11. [Understanding and Applying Text Embeddings](https://www.deeplearning.ai/short-courses/google-cloud-vertex-ai/) | Nikita Namjoshi, Google Cloud | 100 | Learn how to accelerate the application development process with text embeddings| | -| 12. [Pair Programming with a Large Language Model]() | Laurence Moroney, Google | 100 | Learn how to effectively prompt an LLM to help you improve, debug, understand, and document your code | | -| 13. [Functions, Tools and Agents with LangChain](https://www.deeplearning.ai/short-courses/functions-tools-agents-langchain/) | Harrison Chase, LangChain | 200 | Learn and apply the new capabilities of LLMs as a developer tool.| | -| 14. [Vector Databases: from Embeddings to Applications](https://www.deeplearning.ai/short-courses/vector-databases-embeddings-applications/) | Sebastian Witalec, Weaviate | 200 | Design and execute real-world applications of vector databases. | | -| 15. [Quality and Safety for LLM Applications](https://www.deeplearning.ai/short-courses/quality-safety-llm-applications/) |Bernease Herman, WhyLabs | 100 | Learn how to evaluate the safety and security of your LLM applications and protect against potential risks.| | -| 16. [Building and Evaluating Advanced RAG Applications](https://www.deeplearning.ai/short-courses/building-evaluating-advanced-rag/) | Jerry Liu, Anupam Datta, truera | 100 | Learn how to efficiently bring Retrieval Augmented Generation (RAG) into production by enhancing retrieval techniques and mastering evaluation metrics.| | -| 17. [Reinforcement Learning from Human Feedback](https://www.deeplearning.ai/short-courses/reinforcement-learning-from-human-feedback/) | Nikita Namjoshi, Google Cloud | 200 | A conceptual and hands-on introduction to tuning and evaluating large language models (LLMs) using Reinforcement Learning from Human Feedback.| | -| 18. [Advanced Retrieval for AI with Chroma](https://www.deeplearning.ai/short-courses/advanced-retrieval-for-ai/) |Anton Troynikov, Chroma| 200 |Learn advanced retrieval techniques to improve the relevancy of retrieved results. | | -| 19. [Build LLM Apps with LangChain.js](https://www.deeplearning.ai/short-courses/build-llm-apps-with-langchain-js/) |Jacob Lee, LangChain | 200 | Expand your toolkits with LangChain.js, a popular JavaScript framework for building with LLMs, and get useful concepts for creating powerful, context-aware applications.| | -| 20. [LLMOps](https://www.deeplearning.ai/short-courses/llmops/) |Erwin Huizenga, Google Cloud | 100 | Learn LLMOps best practices as you design and automate the steps to tune an LLM for a specific task and deploy it as a callable API. In the course, you'll tune an LLM to act as a question-answering coding expert. You can apply the methods learned here to tune your own LLM for other use cases.| | -| 21. [Automated Testing for LLMOps](https://www.deeplearning.ai/short-courses/automated-testing-llmops/) | Rob Zuber, CircleCI | 200 |Learn how to create an automated continuous integration (CI) pipeline to evaluate your LLM applications on every change, for faster, safer, and more efficient application development. | | -| 22. [Building Applications with Vector Databases](https://www.deeplearning.ai/short-courses/building-applications-vector-databases/) | Tim Tully, Pinecone | 100 | Learn to build six applications powered by vector databases: semantic search, retrieval augmented generation (RAG), anomaly detection, hybrid search, image similarity search, and recommender systems, each using a different dataset.| | -| 23. [Serverless LLM apps with Amazon Bedrock](https://www.deeplearning.ai/short-courses/serverless-llm-apps-amazon-bedrock/) | Mike Chambers, AWS |200 | Learn how to deploy a large language model-based application into production using serverless technology.| | -| 24. [Prompt Engineering with Llama 2](https://www.deeplearning.ai/short-courses/prompt-engineering-with-llama-2/) | Amit Sangani, Meta | 100 | Learn best practices for prompting and selecting among Meta Llama 2 models.| | -| 25. [Open Source Models with Hugging Face](https://www.deeplearning.ai/short-courses/open-source-models-hugging-face/) | Maria K, Marc S, Younes B, HuggingFace | 100 | Learn how to easily build AI applications using open source models and Hugging Face tools.| | -| 26. [Knowledge Graphs for RAG](https://www.deeplearning.ai/short-courses/knowledge-graphs-rag/) | Anreas Kollegger, neo4j | 200 |Learn how to build and use knowledge graph systems to improve your retrieval augmented generation applications. | | -| 27. [Efficiently Serving LLMs](https://www.deeplearning.ai/short-courses/efficiently-serving-llms/) | Travis Addair, Predibase | 200 | Gain a ground-up understanding of how to serve LLM applications in production.| | -| 28. [JavaScript RAG Web Apps with LlamaIndex](https://www.deeplearning.ai/short-courses/javascript-rag-web-apps-with-llamaindex/) |Laurie Voss, LlamaIndex | 100 | JavaScript RAG Web Apps with LlamaIndex| | -| 29. [Red Teaming LLM Applications](https://www.deeplearning.ai/short-courses/red-teaming-llm-applications/) |Matteo Dora, Luca Martial, Giskard | 100 |Learn how to make safer LLM apps through red teaming | | -| | | | | - - ---- - -## Resources \ No newline at end of file diff --git a/docs/src/content/docs/400/u001-prompt-engineering.md b/docs/src/content/docs/400/u001-prompt-engineering.md new file mode 100644 index 0000000..28e6dd2 --- /dev/null +++ b/docs/src/content/docs/400/u001-prompt-engineering.md @@ -0,0 +1,48 @@ +--- +title: "01 | Prompt Engineering" +description: What is Prompt Engineering? · Why does it matter? · How do you get started? · What are the best practices? +--- + + +:::tip[LEARNING RESOURCES] +1. [ChatGPT Prompt Engineering For Developers](https://www.deeplearning.ai/short-courses/chatgpt-prompt-engineering-for-developers/) - _DeepLearning.AI_, 2024 +1. [Prompt engineering](https://platform.openai.com/docs/guides/prompt-engineering/prompt-engineering) - _Open AI_, 2024 +1. [Introduction to prompt engineering](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/prompt-engineering) - _Azure AI_, 2024 +1. [Prompt engineering techniques](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/advanced-prompt-engineering?pivots=programming-language-chat-completions) - _Azure AI_, 2024 +1. [Prompt engineering with GPT-4 Turbo with Vision](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/gpt-4-v-prompt-engineering) - _Azure AI_, 2024 +1. [LLM Prompting Guide](https://huggingface.co/docs/transformers/main/en/tasks/prompting) - _Hugging Face_, 2024 +1. [Intro to Prompt Design](https://ai.google.dev/docs/prompt_intro) - _Google Gemini_, 2024 +1. [Prompt Engineerting for Generative AI](https://developers.google.com/machine-learning/resources/prompt-eng) - _Google ML_, 2024 +1. [What is Prompt Engineering?](https://www.deeplearning.ai/short-courses/prompt-engineering/) - _AWS Generative AI_, 2024 +::: + +--- + +## 1. Introduction + +Prompt Engineering is the process of **designing and refining prompts** to get a relevant response with a desired quality from a generative AI model. It is a trial-and-error process, with iteration and evaluation to get an acceptable response. + +Prompt engineering can feel more like art than science, requiring us to understand the model's capabilities (& quirks), the application domain (task context), and the user's intent - to get responses right. For clarity, we'll qualify the term further: +- **User Prompt** - refers to the original natural language request from the user. +- **Model Prompt** - refers to the refined version fed to the model for response. + +In the simplest case, both refer to the same thing with the **user prompt** simply being fed directly to the model. In real-world apps, we will typically _refine_ the prompt post-input to improve the quality of the response. For example: we might use a technique like _retrieval augmented generation_ to ground the prompt in our knowledge base before feeding it to the model. In this case, the **model prompt** will be an enhanced version of the original user prompt. If no qualifier is used, assumed we are talking about the _model_ prompt. + +Prompt engineering now has two facets for us to consider: + +1. **Educating Users** so that the initial user prompt is itself as effective as possible. This can involve providing users with guidelines, templates, and tools to streamline their prompt generation. + - **Engineering Workflows** so that the user prompt is or _refined_ to be more effective given context like model capabilities, application requirements, or operationalization constraints. This can involve mechanisms like prompt chaining and evaluation to refine the prompt iteratively. + +In this specific lesson, we'll focus more on design patterns and best practices for the former. We'll cover the latter in more detail when exploring end-to-end development workflows and LLM Ops. + + +## 2. Motivation + +_Why is prompt engineering critical for generative AI?_ + + +## 3. Core Concepts + +## 4. Best Practices + +## 5. Lab Exercises \ No newline at end of file diff --git a/docs/src/content/docs/400/u002-fine-tuning.md b/docs/src/content/docs/400/u002-fine-tuning.md new file mode 100644 index 0000000..bbbb761 --- /dev/null +++ b/docs/src/content/docs/400/u002-fine-tuning.md @@ -0,0 +1,18 @@ +--- +title: "02 | Fine Tuning" +description: What is Fine Tuning? · Why is it useful or necessary? · How do you get started? · What are the best practices? · What are the challenges? +--- + + +:::tip[LEARNING RESOURCES] +1. [Fine Tuning Large Language Models](https://www.deeplearning.ai/short-courses/finetuning-large-language-models/) - _DeepLearning.AI_, 2024 +1. [Fine tuning](https://platform.openai.com/docs/guides/fine-tuning) - _Open AI_, 2024 +1. [When to use Azure OpenAI fine-tuning](https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/fine-tuning-considerations) - _Azure Open AI_, 2024 +1. [Azure OpenAI GPT-3.5 Turbo fine-tuning tutorial](https://learn.microsoft.com/en-us/azure/ai-services/openai/tutorials/fine-tune?tabs=python-new%2Ccommand-line) - _Azure Open AI_, 2024 +1. [Fine-tune a foundation model with Azure ML](https://learn.microsoft.com/training/modules/finetune-foundation-model-with-azure-machine-learning/) - _Azure Open AI_, 2024 +1. [Fine-tune a Llama 2 model in Azure AI Studio](https://learn.microsoft.com/en-us/azure/ai-studio/how-to/fine-tune-model-llama) - _Azure Open AI_, 2024 +1. [Fine-tune a pretrained model](https://huggingface.co/docs/transformers/main/en/training) - _Hugging Face_, 2024 +1. [Parameter-Efficient Fine Tuning (PEFT)](https://huggingface.co/docs/peft/index) - _Hugging Face_, 2024 +1. [Tuning PaLM Models](https://cloud.google.com/vertex-ai/generative-ai/docs/models/tune-models) - _Google AI_, 2024 +1. [Tuning Gemini Models](https://developers.googleblog.com/2024/03/tune-gemini-pro-in-google-ai-studio-or-gemini-api.html) - _Google AI_, 2024 +::: \ No newline at end of file diff --git a/docs/src/content/docs/400/u003-hugging-face.md b/docs/src/content/docs/400/u003-hugging-face.md new file mode 100644 index 0000000..727ed27 --- /dev/null +++ b/docs/src/content/docs/400/u003-hugging-face.md @@ -0,0 +1,15 @@ +--- +title: "03 | Hugging Face" +description: What is Hugging Face? · Why is it useful or necessary? · How do you get started? · What are the best practices? · What are the challenges? +--- + + +:::tip[LEARNING RESOURCES] +Explore these resources for a deeper dive on this topic: +1. [Open Source Models with Hugging Face](https://www.deeplearning.ai/short-courses/open-source-models-hugging-face/) - DeepLearning.AI, 2024 +1. [Fine-tune a pretrained model](https://huggingface.co/docs/transformers/main/en/training) - Hugging Face Docs +1. [Amazon Sagemaker](https://huggingface.co/docs/sagemaker/index) - Hugging Face Docs +1. [Google TPUs](https://huggingface.co/docs/optimum-tpu/index) - Hugging Face Docs +1. []() - Hugging Face Docs +1. []() - Hugging Face Docs +::: \ No newline at end of file diff --git a/docs/src/content/docs/400/400-00-aoia-intro.ipynb b/notebooks/400/400-00-aoia-intro.ipynb similarity index 100% rename from docs/src/content/docs/400/400-00-aoia-intro.ipynb rename to notebooks/400/400-00-aoia-intro.ipynb diff --git a/docs/src/content/docs/400/400-00-llm-setup.ipynb b/notebooks/400/400-00-llm-setup.ipynb similarity index 100% rename from docs/src/content/docs/400/400-00-llm-setup.ipynb rename to notebooks/400/400-00-llm-setup.ipynb diff --git a/docs/src/content/docs/400/400-01-dl-prompt-engineering.ipynb b/notebooks/400/400-01-dl-prompt-engineering.ipynb similarity index 100% rename from docs/src/content/docs/400/400-01-dl-prompt-engineering.ipynb rename to notebooks/400/400-01-dl-prompt-engineering.ipynb diff --git a/docs/src/content/docs/400/400-09-aoai-fine-tuning.ipynb b/notebooks/400/400-09-aoai-fine-tuning.ipynb similarity index 100% rename from docs/src/content/docs/400/400-09-aoai-fine-tuning.ipynb rename to notebooks/400/400-09-aoai-fine-tuning.ipynb diff --git a/docs/src/content/docs/400/400-09-dl-fine-tuning.ipynb b/notebooks/400/400-09-dl-fine-tuning.ipynb similarity index 100% rename from docs/src/content/docs/400/400-09-dl-fine-tuning.ipynb rename to notebooks/400/400-09-dl-fine-tuning.ipynb diff --git a/docs/src/content/docs/400/400-09-hf-fine-tuning.ipynb b/notebooks/400/400-09-hf-fine-tuning.ipynb similarity index 100% rename from docs/src/content/docs/400/400-09-hf-fine-tuning.ipynb rename to notebooks/400/400-09-hf-fine-tuning.ipynb diff --git a/docs/src/content/docs/400/400-09-oai-fine-tuning.ipynb b/notebooks/400/400-09-oai-fine-tuning.ipynb similarity index 100% rename from docs/src/content/docs/400/400-09-oai-fine-tuning.ipynb rename to notebooks/400/400-09-oai-fine-tuning.ipynb diff --git a/docs/src/content/docs/400/400-25-dl-opensource-models.ipynb b/notebooks/400/400-25-dl-opensource-models.ipynb similarity index 100% rename from docs/src/content/docs/400/400-25-dl-opensource-models.ipynb rename to notebooks/400/400-25-dl-opensource-models.ipynb