diff --git a/.gitignore b/.gitignore index 8694857..06cfabe 100644 --- a/.gitignore +++ b/.gitignore @@ -175,3 +175,6 @@ products_vectorstore/ # ignore gradio private files .gradio /.gradio + +# ignore diagnostics reports +**/report.txt diff --git a/README.md b/README.md index 7af4e91..8e3b597 100644 --- a/README.md +++ b/README.md @@ -76,3 +76,18 @@ The charges for the exercsies in this course should always be quite low, but if 3. During week 7, look out for my instructions for using the cheaper dataset Please do message me or email me at ed@edwarddonner.com if this doesn't work or if I can help with anything. I can't wait to hear how you get on. + +
+ ![]() |
+
+ Other resources+ I've put together this webpage with useful resources for the course. This includes links to all the slides.+ https://edwarddonner.com/2024/11/13/llm-engineering-resources/ + Please keep this bookmarked, and I'll continue to add more useful links there over time. + + |
+
\n",
+ " ![]() | \n",
+ " \n",
+ " This project is provided as an extra resource\n", + " It will make most sense after completing Week 7, and might trigger some ideas for your own projects.\n", + " This is provided without a detailed walk-through; the output from the colab has been saved (see last cell) so you can review the results if you have any problems running yourself.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Do not use for actual trading decisions!!\n", + " It hopefully goes without saying: this project will generate toy trading code that is over-simplified and untrusted.Please do not make actual trading decisions based on this!\n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Please read - important note\n", + " The way I collaborate with you may be different to other courses you've taken. I prefer not to type code while you watch. Rather, I execute Jupyter Labs, like this, and give you an intuition for what's going on. My suggestion is that you do this with me, either at the same time, or (perhaps better) right afterwards. Add print statements to understand what's going on, and then come up with your own variations. If you have a Github account, use this to showcase your variations. Not only is this essential practice, but it demonstrates your skills to others, including perhaps future clients or employers...\n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Business value of these exercises\n", + " A final thought. While I've designed these notebooks to be educational, I've also tried to make them enjoyable. We'll do fun things like have LLMs tell jokes and argue with each other. But fundamentally, my goal is to teach skills you can apply in business. I'll explain business implications as we go, and it's worth keeping this in mind: as you build experience with models and techniques, think of ways you could put this into action at work today. Please do contact me if you'd like to discuss more or if you have ideas to bounce off me.\n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Business applications\n", + " In this exercise, you experienced calling the Cloud API of a Frontier Model (a leading model at the frontier of AI) for the first time. We will be using APIs like OpenAI at many stages in the course, in addition to building our own LLMs.\n", + "\n", + "More specifically, we've applied this to Summarization - a classic Gen AI use case to make a summary. This can be applied to any business vertical - summarizing the news, summarizing financial performance, summarizing a resume in a cover letter - the applications are limitless. Consider how you could apply Summarization in your business, and try prototyping a solution.\n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Before you continue - now try yourself\n", + " Use the cell below to make your own simple commercial example. Stick with the summarization use case for now. Here's an idea: write something that will take the contents of an email, and will suggest an appropriate short subject line for the email. That's the kind of feature that might be built into a commercial email tool.\n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Just before we get to the assignment --\n", + " I thought I'd take a second to point you at this page of useful resources for the course. This includes links to all the slides.\n", + " https://edwarddonner.com/2024/11/13/llm-engineering-resources/ \n", + " Please keep this bookmarked, and I'll continue to add more useful links there over time.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Business applications\n", + " In this exercise we extended the Day 1 code to make multiple LLM calls, and generate a document.\n", "\n", - "In terms of techniques, this is perhaps the first example of Agentic AI design patterns, as we combined multiple calls to LLMs. This will feature more in Week 2, and then we will return to Agentic AI in a big way in Week 8 when we build a fully autonomous Agent solution.\n", + "This is perhaps the first example of Agentic AI design patterns, as we combined multiple calls to LLMs. This will feature more in Week 2, and then we will return to Agentic AI in a big way in Week 8 when we build a fully autonomous Agent solution.\n", "\n", - "In terms of business applications - generating content in this way is one of the very most common Use Cases. As with summarization, this can be applied to any business vertical. Write marketing content, generate a product tutorial from a spec, create personalized email content, and so much more. Explore how you can apply content generation to your business, and try making yourself a proof-of-concept prototype." + "Generating content in this way is one of the very most common Use Cases. As with summarization, this can be applied to any business vertical. Write marketing content, generate a product tutorial from a spec, create personalized email content, and so much more. Explore how you can apply content generation to your business, and try making yourself a proof-of-concept prototype.\n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Before you move to Week 2 (which is tons of fun)\n", + " Please see the week1 EXERCISE notebook for your challenge for the end of week 1. This will give you some essential practice working with Frontier APIs, and prepare you well for Week 2.\n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " A reminder on 2 useful resources\n", + " 1. The resources for the course are available here.\n", + " 2. I'm on LinkedIn here and I love connecting with people taking the course!\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Important Note - Please read me\n", + " I'm continually improving these labs, adding more examples and exercises.\n", + " At the start of each week, it's worth checking you have the latest code.\n", + " First do a git pull and merge your changes as needed. Any problems? Try asking ChatGPT to clarify how to merge - or contact me! \n", + " After you've pulled the code, from the llm_engineering directory, in an Anaconda prompt (PC) or Terminal (Mac), run: \n", + " conda env update --f environment.yml --prune \n", + " Or if you used virtualenv rather than Anaconda, then run this from your activated environment in a Powershell (PC) or Terminal (Mac): \n", + " pip install -r requirements.txt \n",
+ " Then restart the kernel (Kernel menu >> Restart Kernel and Clear Outputs Of All Cells) to pick up the changes.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Reminder about the resources page\n", + " Here's a link to resources for the course. This includes links to all the slides.\n", + " https://edwarddonner.com/2024/11/13/llm-engineering-resources/ \n", + " Please keep this bookmarked, and I'll continue to add more useful links there over time.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Before you continue\n", + " \n", + " Be sure you understand how the conversation above is working, and in particular how themessages list is being populated. Add print statements as needed. Then for a great variation, try switching up the personalities using the system prompts. Perhaps one can be pessimistic, and one optimistic?\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Business relevance\n", + " This structure of a conversation, as a list of messages, is fundamental to the way we build conversational AI assistants and how they are able to keep the context during a conversation. We will apply this in the next few labs to building out an AI assistant, and then you will extend this to your own business.\n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Important Note - Please read me\n", + " I'm continually improving these labs, adding more examples and exercises.\n", + " At the start of each week, it's worth checking you have the latest code.\n", + " First do a git pull and merge your changes as needed. Any problems? Try asking ChatGPT to clarify how to merge - or contact me! \n", + " After you've pulled the code, from the llm_engineering directory, in an Anaconda prompt (PC) or Terminal (Mac), run: \n", + " conda env update --f environment.yml --prune \n", + " Or if you used virtualenv rather than Anaconda, then run this from your activated environment in a Powershell (PC) or Terminal (Mac): \n", + " pip install -r requirements.txt \n",
+ " Then restart the kernel (Kernel menu >> Restart Kernel and Clear Outputs Of All Cells) to pick up the changes.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Reminder about the resources page\n", + " Here's a link to resources for the course. This includes links to all the slides.\n", + " https://edwarddonner.com/2024/11/13/llm-engineering-resources/ \n", + " Please keep this bookmarked, and I'll continue to add more useful links there over time.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Before you continue\n", + " \n", + " Be sure you understand how the conversation above is working, and in particular how themessages list is being populated. Add print statements as needed. Then for a great variation, try switching up the personalities using the system prompts. Perhaps one can be pessimistic, and one optimistic?\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Business relevance\n", + " This structure of a conversation, as a list of messages, is fundamental to the way we build conversational AI assistants and how they are able to keep the context during a conversation. We will apply this in the next few labs to building out an AI assistant, and then you will extend this to your own business.\n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Before you read the next few cells\n", + " \n", + " Try to do this yourself - go back to the company brochure in week1, day5 and add a Gradio UI to the end. Then come and look at the solution.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Business Applications\n", + " Conversational Assistants are of course a hugely common use case for Gen AI, and the latest frontier models are remarkably good at nuanced conversation. And Gradio makes it easy to have a user interface. Another crucial skill we covered is how to use prompting to provide context, information and examples.\n", + "\n", + "Consider how you could apply an AI Assistant to your business, and make yourself a prototype. Use the system prompt to give context on your business, and set the tone for the LLM.\n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Reminder: fetch latest code\n", + " I'm continually improving these labs, adding more examples and exercises.\n", + " At the start of each week, it's worth checking you have the latest code.\n", + " First do a git pull and merge your changes as needed. Any problems? Try asking ChatGPT to clarify how to merge - or contact me! \n", + " After you've pulled the code, from the llm_engineering directory, in an Anaconda prompt (PC) or Terminal (Mac), run: \n", + " conda env update --f environment.yml --prune \n", + " Or if you used virtualenv rather than Anaconda, then run this from your activated environment in a Powershell (PC) or Terminal (Mac): \n", + " pip install -r requirements.txt \n",
+ " Then restart the kernel (Kernel menu >> Restart Kernel and Clear Outputs Of All Cells) to pick up the changes.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Important Note\n", + " \n", + " In this lab, I use GPT-4o and Claude-3.5-Sonnet, which are the slightly higher priced models. The costs are still low, but if you'd prefer to keep costs ultra low, please make the suggested switches to the models (3 cells down from here).\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Important - Pause Endpoints when not in use\n", + " \n", + " If you do decide to use HuggingFace endpoints for this project, you should stop or pause the endpoints when you are done to avoid accruing unnecessary running cost. The costs are very low as long as you only run the endpoint when you're using it. Navigate to the HuggingFace endpoint UI here, open your endpoint, and click Pause to put it on pause so you no longer pay for it. \n", "Many thanks to student John L. for raising this.\n", - "\n", - "In week 8 we will use Modal instead of HuggingFace endpoints; with Modal you only pay for the time that you use it." + "\n", + "In week 8 we will use Modal instead of HuggingFace endpoints; with Modal you only pay for the time that you use it and you should get free credits.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Especially important this week: pull the latest\n", + " I'm continually improving these labs, adding more examples and exercises.\n", + " At the start of each week, it's worth checking you have the latest code.\n", + " First do a git pull and merge your changes as needed. Any problems? Try asking ChatGPT to clarify how to merge - or contact me! \n", + " After you've pulled the code, from the llm_engineering directory, in an Anaconda prompt (PC) or Terminal (Mac), run: \n", + " conda env update --f environment.yml --prune \n", + " Or if you used virtualenv rather than Anaconda, then run this from your activated environment in a Powershell (PC) or Terminal (Mac): \n", + " pip install -r requirements.txt \n",
+ " Then restart the kernel (Kernel menu >> Restart Kernel and Clear Outputs Of All Cells) to pick up the changes.\n", + " \n", + " | \n",
+ "