Loading video player…

How to Get Started With Ollama (Overview)

Integrating local large language models (LLMs) into your Python projects with Ollama is a great way to improve privacy, reduce costs, and build offline-capable AI-powered apps.

Ollama is an open-source platform that makes it straightforward to run modern LLMs locally on your machine. Once you’ve set up Ollama and pulled the models you want to use, you can connect to them from Python using the ollama library.

In this video course, you’ll integrate local LLMs into your Python projects using the Ollama platform and its Python SDK.

First, you’ll set up Ollama and pull a couple of LLMs. Then, you’ll learn how to use chat and text generation from your Python code. These skills will enable you to build AI-powered apps that run locally, ensuring better privacy and reducing costs.

Resource mentioned in this lesson: Ollama Documentation

Download

Course Slides (.pdf)

5.3 MB
Download

Sample Code (.zip)

1.7 KB

00:00 Hello, friends, and welcome to “How to Get Started With Ollama.” My name is Arianne Dee, and I’ll be your instructor for this course.

00:08 Ollama is an open-source platform that allows you to run large language models, or LLMs, directly on your computer. Once you have Ollama installed, you can download open-source AI models, then run them locally through a desktop application, terminal, or Python script.

00:25 In this course, you’ll learn how to install and run Ollama on your machine, then pull or download the required large language models, and then connect it to Python using the ollama library. You’ll then use it to create a basic chat application and generate some Python code from a prompt. So, why would you use local models with Ollama? Because you’re hosting the models yourself, there’s improved privacy, and you’re not sending any data out to a third party, and you can build offline-capable apps since you don’t need to make requests to external APIs.

00:58 Also, the models are free, so you only need to worry about the hardware and energy to run your machine, which likely means cost savings and reduced environmental impact.

01:10 For this course, you’re going to need Python 3.8 or higher in order to use the ollama Python library. And you’re going to need decent hardware capabilities, so enough memory, disk space, and CPU power to run the models.

01:25 If you have a GPU, it will help run the models faster. In general, the better hardware you have, the larger and more advanced models you can run. You should see the docs for specific requirements pertaining to your operating system.

01:40 Now let’s take a look at the lessons in this course. After the overview, you’re going to work on setting up your environment. First, you’ll get and run Ollama on your machine and download or pull the models required for this course. Then, after installing Python’s ollama library, your environment will be set up to start coding.

02:00 Next, you’ll look at generating text and code from Python. First, you’ll see what functions are available in the ollama library. Then you’ll see how to call Ollama’s chat interface and turn it into a basic chat application.

02:14 After, you’ll see how to call Ollama’s text-generation interface and use it to generate some Python code from a prompt.

02:22 Lastly, we’ll summarize everything you’ve learned, discuss additional capabilities, and get some follow-up resources to keep learning. Now let’s get started installing and running Ollama.

Become a Member to join the conversation.