-
Book Overview & Buying
-
Table Of Contents
Python Automation Cookbook - Third Edition
By :
Calling a commercial AI model is not the only option when using GenAI. In this recipe, we will see how to use a local model installed on our computer, instead of calling an external API.
Unless you have specialized hardware, local models are much smaller and less capable than commercial ones. But you can use them without paying extra, and they can provide good results for your use case.
For that, we will use Ollama, which will allow us to download and run open-weight sources on our computer.
You need to install Ollama locally (https://ollama.com/). Go to its page and follow the instructions at https://ollama.com/download.
Once installed, you should be able to run it locally and pull models. For this example, we will use a small model that should run on any modern machine with enough RAM, qwen‑3:8b.
Download and install this model with this command.
$ ollama pull qwen3:8b
pulling manifest
pulling a3de86cd1c13: 100% ▕███...