A practical introduction to large language models in Python
It seems like large language models are everywhere today. I found it difficult to get started in using them in my software projects, and wrote this book to help others get started with the basic ideas. It is a very practical guide to using Python with LLM libraries to do things. We start by describing how text can be represented as vectors. This is eventually important for looking up documents. Then, we introduce text generation with ollama. After introducing that, we introduce the idea of retrieval augmented generation where we use the text vectors to find documents that are similar to your prompt. We briefly describe what LLMs can do with images. We conclude with an outlook on agents and frameworks in LLMS.
This book focuses exclusively on using ollama and local LLM models.
I periodically update the content. You can tell if you have the latest version by looking at the date in the zip file.
Here is the table of contents from the notebook that comes with this purchase.
A zip file containing an HTML file, Jupyter notebook with worked examples, requirements.txt, a script to setup an optional uv environment, and bonus materials on advanced applications of LLMs and using LLMs to automate science!