I feel that this should be enough to get you started with Ollama, it’s not rocket science. My advice? Just fiddle around with it. ollama run llava:7b "Describe the content of this image." < cat.jpg
Table of Contents
Code generation and assistance
Running Ollama for image processing, document analysis, or code generation without a GPU can be excruciatingly slow.
Checking available commands
Some useful tricks while interacting with a running model:Happy experimenting! 🤖ollama run phi:2.7b
There is no ollama command for updating existing LLMs. You can run the pull command periodically to update an installed model:
Command | Description |
---|---|
ollama create |
Creates a custom model from a Modelfile, allowing you to fine-tune or modify existing models. |
ollama run <model> |
Runs a specified model to process input text, generate responses, or perform various AI tasks. |
ollama pull <model> |
Downloads a model from Ollama’s library to use it locally. |
ollama list |
Displays all installed models on your system. |
ollama rm <model> |
Removes a specific model from your system to free up space. |
ollama serve |
Runs an Ollama model as a local API endpoint, useful for integrating with other applications. |
ollama ps |
Shows currently running Ollama processes, useful for debugging and monitoring active sessions. |
ollama stop <model> |
Stops a running Ollama process using its process ID or name. |
ollama show <model> |
Displays metadata and details about a specific model, including its parameters. |
ollama run <model> "with input" |
Executes a model with specific text input, such as generating content or extracting information. |
ollama run <model> < "with file input" |
Processes a file (text, code, or image) using an AI model to extract insights or perform analysis. |
1. Downloading an LLM
💡Instead of spending hours deciphering it, let Ollama have a look at it. 😉You can configure the server with environment variables, such as:

ollama run <model_name>
For example, let’s say you want to tweak smollm2
to have a longer context window.Here’s a glimpse of essential Ollama commands, which we’ve covered in more detail further in the article.If you’ve downloaded multiple models, you might want to see which ones are available locally. You can do this with:One of the coolest features of Ollama is the ability to create custom model configurations.
- Type
/set parameter num_ctx 8192
to adjust the context window. - Use
/show info
to display model details. - Exit by typing
/bye
.
3. Listing installed LLMs
ollama run phi "Explain this algorithm step-by-step." < algorithm.py
Additional resources
ollama pull phi:2.7b
Here’s how the command works (if you don’t want to ask your local AI).
4. Checking running LLMs
ollama pull <model_name>
ollama list | tail -n +2 | awk '{print }' | xargs -I {} ollama pull {}
If you’re running multiple models and want to see which ones are active, use:
5. Starting the ollama server
If you have any tips, lesser-known commands, or cool use cases up your sleeve, feel free to share them in the comments. Ollama lists all the models and you take the ouput starting at line 2 as line 1 doesn’t have model names. And then AWK command gives the first column that has the model name. Now this is passed to xargs command that puts the model name in {} placeholder and thus ollama pull {}
runs as ollama pull model_name
for each installed model.If you’re dealing with structured text files, though, it works fairly well.

ollama --help
Ollama isn’t just a tool for running language models locally, it can be a powerful AI assistant inside a terminal for a variety of tasks.Try different commands, tweak the parameters, and experiment with its capabilities. That’s how I learned, and honestly, that’s the best way to get comfortable with any new tool. It’s like Docker. You download publicly available models from Hugging Face using its command line interface. Connect Ollama with a graphical interface and you have a chatGPT alternative local AI tool.ollama ps
To begin chatting with a model, use:
7. Custom model configuration
Before we dive into specific commands, let’s start with the basics. To see all available Ollama commands, run:ollama run phi "Summarize this document in 100 words." < french_revolution.txt
Image analysis
📋That said, I might not have covered every single command or trick in this guide, I’m still learning myself! Ollama is one of the easiest ways for running large language models (LLMs) locally on your own machine.ollama run js-web-dev "Write a well-optimized JavaScript function to fetch data from an API and handle errors properly."
Ollama can quickly extract key points from long documents, research papers, and reports, saving you from hours of manual reading.Like, I personally use Ollama to extract info from a document, analyze images and even help with coding without leaving the terminal.
Summarizing documents
That said, I personally don’t use it much for PDFs. The results can be janky, especially if the document has complex formatting or scanned text. The ollama serve
command starts a local server to manage and run LLMs. This command is great for checking which models are installed before running them.ollama serve
In this guide, I’ll walk you through some essential Ollama commands, explaining what they do and share some tricks at the end to enhance your experience.If you want to manually download a model from the Ollama library without running it immediately, use:ollama list
Ollama makes it possible to harness AI on your own hardware. While it may seem overwhelming at first, once you get the hang of the basic commands and parameters, it becomes an incredibly useful addition to any developer’s toolkit.It provides a clear, hands-on introduction to working with Ollama and its API.
Conclusion
First, create a file named Modelfile
in your working directory with the following content:ollama <command> --help
This is particularly useful in fields like computer vision, accessibility, and content moderation.FROM llama3.2:3b
PARAMETER temperature 0.5
PARAMETER top_p 0.9
SYSTEM You are a senior web developer specializing in JavaScript, front-end frameworks (React, Vue), and back-end technologies (Node.js, Express). Provide well-structured, optimized code with clear explanations and best practices.
ollama create js-web-dev -f Modelfile
ollama pull <model_name>
For instance, to download Llama 3.2 (300M parameters):