
Ollama is an open-source platform for running large language models (LLMs) locally. Ollama supports most open-source Large Language models (LLMs) including Llama 3, DeepSeek R1, Mistral, Phi-4, and Gemma 2 models, you can run locally without an internet connection. It enhances security, privacy, and provides greater control over a model's performance, allowing you to customize it on your workstation.
Ollama includes a default models repository which lets you search and download LLMs to run on your workstation. It also supports OpenWebUI as a graphical web interface for running models without using the command line interface (CLI). It works on Linux, Windows, and macOS without any cloud-based APIs requirements to run models.
This article explains how to install Ollama and run large language models (LLMs) with all required dependencies on your workstation.
Ollama is compatible with Linux, macOS, and Windows. You can download and install Ollama using the official release package or script from the official website. Follow the steps below to download and install the latest Ollama version on your Linux, macOS, or Windows workstation.
Open a new terminal session.
Run the following command to download the install.sh Ollama script and install it on your instance.
Verify the installed Ollama version.
Your output should be similar to the one below.
List all available models.
Ollama creates an ollama.service system service by default when installed, to manage the application. Follow the steps below to test the Ollama system service and enable it to automatically start at boot.
Test the Ollama service status and verify that it's available.
Output:
Enable Ollama to automatically start at boot.
Restart the Ollama service.
Download the latest Ollama archive with rocm support from the official website.
Extract all files from the archive to the /usr/ directory.
Ollama downloads models using the ollama pull command that fetches the model to run on your system. You can download models from the Ollama models repository. Follow the steps below to download LLMs using Ollama to run on your workstation.
Run the Ollama with the pull option to download a model from the official repository.
For example, download Mistral using Ollama.
Download the Deepseek-R1-Distrill-Qwen model with 1.5B parameters using Ollama.
Download Llama 3.3 using Ollama.
The Llama 3.3 model is 40GB in size. Verify that you have enough storage space to run this model before downloading it.
List all locally available models using Ollama.
Your output should be similar to the one below.
You can run, pull and initialize large language models directly from the Ollama repository or locally from the available models using the ollama run command. Check the required system resources for each AI model before running it using Ollama. Follow the steps below to run models using Ollama and test the performance of each model on your workstation.
List all locally available models.
Run a model directly using Ollama. For example, run the qwen 2.5 instruct model with 1.5B parameters.
Enter a new prompt such as Give me two lines of text about Vultr.
Monitor the model output and results in your terminal.
Enter /bye to exit Ollama.
Run a model that's available on your workstation. For example, run the Deepseek R1 model you downloaded earlier.
Enter a prompt such as Generate a recursive fractal pattern description using only mathematical notations and symbolic logic.
Monitor the model output and results in your terminal.
Enter /bye to exit Ollama.
Different models excel at specific tasks and running them using Ollama allows you to test the performance and model capabilities. Use the ollama run command to run locally available models, or pull the latest version from the Ollama models repository to run on your system.
Downloading multiple LLMs on your system is a complex task that requires continuous management using Ollama. Use the ollama list command to view all available and delete any versions you no longer need on your workstation. Follow the steps below to view and manage all available models using Ollama.
List all locally available models.
Show information about a specific model. For example, display the Llama 3.3 model information.
Output:
Stop a model that's actively running using Ollama.
For example, stop the Deepseek R1 model.
Remove a model from your workstation. For example, remove the mistral model you pulled earlier.
Output:
List all locally available models and verify that the model is unavailable.
Ollama variables modify the application behavior and allow you to effectively run models on your workstation. The following are the most used Ollama variables.
OLLAMA_HOST: Specifies the Ollama server address.OLLAMA_GPU_OVERHEAD: Reserve a part of VRAM per GPU in bytes.OLLAMA_MODELS: Specifies a custom directory to store the model files on your system.OLLAMA_KEEP_ALIVE: Controls how long models can stay in memory.OLLAMA_DEBUG: Enables additional debug information while running LLMs.OLLAMA_FLASH_ATTENTION: Activates experimental optimizations for attention mechanismsOLLAMA_NOHISTORY: Disables readline history while running LLMs.OLLAMA_NOPRUNE: Disables pruning of model blobs at system boot or startup.OLLAMA_ORIGINS: Configures origin URLs with access to the Ollama server.Follow the steps below to set Ollama environment variables based on your operating system.
Open the Ollama system service file.
Add the Environment command after the [service] declaration and include an Ollama variable. For example, enter Environment="OLLAMA_DEBUG=1" to enable debugging.
Add another Ollama environment variable such as OLLAMA_HOST=0.0.0.0:11434 to allow other hosts to connect to the Ollama server.
Save and close the file.
Setting the Ollama host address to 0.0.0.0 allows other hosts to connect and access Ollama using the specified port.
Reload systemd to apply the service configuration changes.
Restart Ollama to apply the environment variables.
Quit Ollama if it's running in your terminal session.
Use the launchctl command to set environment variables on Mac. For example, set the OLLAMA_HOST variable.
Start Ollama to apply the variable changes.
Quit Ollama if it's running.
Open the Windows search menu, search for Environment Variables, and select Edit the System Variables from the search results.
Click Environment Variables in the open System Properties window.
Click New to create a new variable.
Enter your Ollama variable in Variable name.
Enter a value in the Variable value.
Click OK to save the environment variable.
Click OK to close the Environment Variables prompt.
Click Apply to apply the variable changes and close the System Properties dialog.
You have installed Ollama and run large language models (LLMs) on your workstation. Ollama is an efficient platform for running LLMs locally or on a remote server. Use Ollama variables to create a dedicated workstation to run and access your models remotely from any device, including mobile devices. For more information and model examples, visit the Ollama GitHub repository.
0 Comments
Be the first to comment and share your perspective with the community.