Running Models and Understanding How They Work inside Ollama
31%
One-Shot Mode
Instead of running the model interactively, you can also run it once to get a single answer. This can be done using the CLI too.
Let's try it out:
# Create a file with some text
cat > $HOME/article.txt <
The Linux kernel was created by Linus Torvalds in 2005 after he graduated from the University of Helsinki with a BSc in Computer Science. He started working on the project in 2006 and released the first version of the kernel in 2007. The kernel quickly gained popularity and was adopted by many Linux distributions, including Ubuntu, Fedora, and Debian.
In 2011, Torvalds released the first version of the Linux kernel with support for x86-64 architecture, which made it the first 64-bit kernel. He also released the first version of the Linux kernel with support for the ARM architecture, which made it the first kernel to support ARM-based devices.
EOF
# Run Ollama once to summarize the article
# 1st example
ollama run granite3.3:2b \
"Summarize this in one sentence: $(cat $HOME Local AI Engineering with Ollama
Run, understand, customize, fine-tune, and build agentic apps on your own hardwareEnroll now to unlock all content and receive all future updates for free.
