April 2026
Intermediate
399 pages
11h 38m
English
For automated code processing, you can also use a local LLM instead of a commercial language model. This requires a reasonably powerful computer. Depending on which software you use to execute the language model, there are various modules and APIs for executing prompts in Python scripts. Here we’re focusing on the Ollama Python library. The module requires Ollama to be running on the local computer or on a server accessible on the network.
It’s best to set up a Python environment directory for initial experiments. The following commands apply to Linux and macOS:
python3 -m venv ollama-testcd ollama-testssource bin/activatepip3 install ollama
The following Hello World example assumes that Ollama is running on your computer ...
Read now
Unlock full access