Breaking Free from the Cloud: Exploring the Benefits of Local,Open-Source AI with Ollama

Everywhere you look, someone is talking or writing about artificial intelligence. I have been keenly interested in the topic since my graduate school days in the 1990s. I have used ChatGPT, Microsoft Copilot, Claude, Stable Diffusion, and other AI software to experiment with how this technology works and satisfy my innate curiosity. Recently, I discovered Ollama. Developed by Meta, it is an open-source large language model that can run locally on Linux, MacOS, and Microsoft Windows. There is a great deal of concern that while using LLMs in the cloud, your data is being scraped and reused by one of the major technology companies. Ollama is open-source and has an MIT license. Since Ollama runs locally, there is no danger that your work could end up in someone else’s LLM.

The Ollama website proclaims, “Get up and running with Large Language Models.” That invitation was all I needed to get started. Open a terminal on Linux and enter the following to install Ollama:

curl -fsSL https://ollama.com/install.sh | sh

The project lists all the models that you can use, and I chose the first one in the list, Llama3.1. Installation is easy, and it did not take long to install the Llama3.1 model. I followed the instructions and, in the terminal, entered the following command:

$ ollama run llama3.1

The model began to install, which took a couple of minutes. This could vary depending on your CPU and internet connection. I have an Intel i7 with 64 GB RAM and a robust internet connection. Once the model was downloaded, I was prompted to ‘talk’ with the LLM. I decided to ask a question about the history of my alma mater, St. Bonaventure University. I entered the following commands:

$ ollama run llama3.1
>>>What is the history of St. Bonaventure University?

The results were good but somewhat inaccurate. “St. Bonaventure University is a private Franciscan university located in Olean, New York. The institution was founded by the Diocese of Buffalo and  has a rich history dating back to 1856.” St. Bonaventure is located near Olean, New York, and it is in the Diocese of Buffalo, but it was founded in 1858. I asked the model to name some famous St. Bonaventure alumni; more inaccuracies were comic. Bob Lanier was a famous alumnus but Danny Ainge was not.

The results are rendered in MarkDown, which is a real plus. I also knew that having a GPU would render the results much quicker. I wanted to install Ollama on my M2 MacBook Air which I soon did. I followed the much easier directions: Download the Ollama-darwin.zip, unzip the archive, and double-click the Ollama icon. The program is installed in the MacBook’s Application folder. When the program is launched, it directs me to the Mac Terminal app, where I can enter the same commands I had entered on my Linux computer.

Unsurprisingly, Ollama uses a great deal of processing power, which is lessened if you run it on a computer with a GPU. My Intel NUC 11 is a very powerful desktop computer with quad-core 11th Gen Intel Core i7-1165G7, 64 gigabytes of RAM, and a robust connection to the internet to download additional models. I posed similar questions to the Llama3.1 model first on the Intel running Linux and then on the M2 MacBook Air running MacOS. You can see the CPU utilization below on my Linux desktop. It’s pegged, and the output from the model is slow at an approximate rate of 50 words per minute. Contrast that with the M2 MacBook, which has a GPU with a CPU utilization of approximately 6.9% and words per minute faster than I could read.

Screen picture by Don Watkins CC by SA 4.0

While Ollama Llama3.1 might not excel at history recall, it does very well when asked to create Python code. I entered a prompt to create Python code to create a circle without specifying how to accomplish the task. It rendered the code shown below. I had to install the ‘pygame’ module, which is not on my system.

$  sudo apt install python3-pygame
# Python Game Development

import pygame
from pygame.locals import *

# Initialize the pygame modules
pygame.init()

# Create a 640x480 size screen surface
screen = pygame.display.set_mode((640, 480))

# Define some colors for easy reference
WHITE = (255, 255, 255)
RED = (255, 0, 0)

while True:
    # Handle events
    for event in pygame.event.get():
        if event.type == QUIT or (event.type == KEYDOWN and event.key == 
K_ESCAPE):
            pygame.quit()
            quit()

    screen.fill(WHITE)  # Fill the background with white color

    # Drawing a circle on the screen at position (250, 200), radius 100
    pygame.draw.circle(screen, RED, (250, 200), 100)
    
    # Update the full display Surface to the screen
    pygame.display.flip()

I copied the code into VSCodium and ran it. You can see the results below.

Screen picture by Don Watkins CC by SA 4.0

As I continue experimenting with Ollama and other open-source LLMs, I’m struck by the significance of this shift toward local, user-controlled AI. No longer are we forced to rely on cloud-based services that may collect our data without our knowledge or consent. With Ollama and similar projects, individuals can harness the power of language models while maintaining complete ownership over their work and personal information. This newfound autonomy is a crucial step forward for AI development and I’m eager to see where it takes us.

Getting a hand from Handbrake

I have dozens of VHS tapes recorded, in some cases nearly 30 years ago, of our children when they were young. About ten years ago, I used a Linux computer and dvgrab to capture the video using a Firewire port on the computer and an aging digital video camera. The setup worked quite well. Using this process I could convert many of the analog tape videos to MP4s.

I was eager to share some video clips with our grandson recently. I wanted him to see what his Mom looked and acted like when she was his age. The videos, converted to digital format and reside in a folder on my Linux computer, were ready to be transferred to my iPhone for sharing.

My usual file transfer method, QRCP, has been reliable for moving files between my Linux desktop and iOS devices. However, I was left disheartened this time when the video transferred seamlessly, but the audio track was mysteriously absent. This disappointment led me to consider using Handbrake as a potential solution. I have used Handbrake in the past to convert video files to a format compatible with iOS and other modern digital playback devices

I installed Handbrake as a flatpack on my Linux desktop, but you can install it as easily as a system package.

Debian-based systems:

$ sudo apt install handbrake

RPM-based systems:

$ sudo dnf install handbrake

Once installed, I launched the program

Screenshot by Don Watkins CC by SA 4.0

At the ‘File’ menu, I selected ‘Open Source’, which opens a dialog box where I can select the video file that I want to convert. I select the one-hundred-twenty-eight megabyte MP4 and then click ‘Open’ at the bottom of the program window.

Screenshot by Don Watkins CC by SA 4.0

Looking again at the Handbrake program display I have some choices to make to ensure that the converted video is in the format that will display properly on an iPhone or other iOS device.

Screenshot by Don Watkins CC by SA 4.0

Referring to the screenshot above, it is important to choose the particular format in which you want to save the video. There are three choices: MPEG-4, Matroska, and WebM. I chose MPEG-4, and within that, I also chose ‘Web Optimized’, which will ensure that the converted video will be a smaller file and more easily shared on the web or from a mobile device. At the bottom of the program window, you can choose what you will name the completed file. The default is the original name, but I would suggest a different name so that you don’t overwrite the original, which would be important for archival purposes. The default ‘Save’ location is your ‘Video’ folder but you can easily choose some other folder on your system.

Once you are sure you have made all the proper menu selections, you will use your mouse pointer to click the ‘Start’ button at the top of the program window.

Screenshot by Don Watkins CC by SA 4.0

This begins with converting and transcoding the larger MP4 file to a smaller compatible file for iOS devices. The process takes a brief period of time and will depend in part on your processor’s speed. The new video is 42 megabytes, a reduction from its original size, and can be replayed and reshared on a mobile device. Handbrake has excellent documentation. It is open source and is available for Linux, Mac, and Windows, licensed under the GNU General Public License (GPL) Version 2.

New MacBook Air M2

It’s been a few years since I purchased a MacBook. My last Mac was a MacBook Pro I bought in the spring of 2020. Since then, I’ve been using Linux exclusively. My desktop is an Intel NUC 11 that’s running Linux Mint Cinnamon, and I’ve no plans to change that anytime soon. However, I’ve heard lots of good reviews of Apple Silicon. I experimented with a MacMini with the M1 chip a bit over a year ago but sent it back and purchased an HP DevOne, which I had docked for just about a year.

When I upgraded to the NUC 11, the DevOne became an extra laptop. I’ve been using it since August in that capacity. Last month I took it to All Things Open and used it for note-taking, writing, and tooting. I was disappointed in its battery life and the 14-inch display was not enough for a guy who’s used to more desktop real estate.

I was attracted to the MacBook Air M2’s 15.3-inch display. My eyes aren’t what they used to be, and I need bigger fonts on a bigger display. I read many reviews and visited the Apple Store nearby to inspect this new Mac. I was impressed and almost purchased a unit that day. I decided to walk around the mall and left without purchasing the MacBook. More positive reviews and commentary from some of the open-source podcasts I listen to.  That led me to purchase this unit on a ‘Black Friday’ deal from Amazon. The MacBook Air arrived today and got it configured the way I wanted to. I installed the latest Python from Python.org and Visual Studio Code .

I wanted to ensure that I could use this new laptop to continue to hone my Python skills.

I used HomeBrew to install some of my other favorite open-source apps which included GnuCash, MacDown, and Joplin. I’m not doing any heavy lifting with this laptop but I was attracted by its reported long battery life. This MacBook Air M2 came with 256 GB SSD and 8 GB RAM. I like the feel of the keyboard and the overall performance and build quality. There are no readily apparent downsides to this new purchase.

 

 

 

A Day Filled With Inspiration and Gratitude

Today has been a day to cherish at the All Things Open 2023 conference. Lunch at the speakers’ lounge with Jen, Lauren P., Lauren M., David, Bryan, and Jason B. was an invigorating reunion. One of the day’s highlights was the delightful conversation with Rikki Endsley. Our discussion on the first day at the conference was a perfect kick-off; I got to meet the members of the Open Source Initiative, with whom we will be working closely as we transition to writing at Opensource.net.

I met Aaron Prisk in person, though our love of all things open source began nearly eight years ago. Today, I saw my friend Jason Hibbets, who invited me to my first All Things Open in 2014. There have been lots of changes in the past nine years.

The warmth of this community filled my heart with joy, reminding me of the beauty of enduring connections. Moments like these are the essence of life’s blessings, leaving me immensely grateful.

This experience at All Things Open has been a transformative part of my journey, and being part of this remarkable conference in the heart of Raleigh is a testament to the positive direction my life has taken. The ambiance of the beautiful hotel where I’m staying amplifies the experience, adding to the overall sense of gratitude and contentment.

The mentorship of the Opensource.com team has been instrumental in my growth as a writer and individual, and their presence continues to inspire me.

While exploring the conference, the Apereo booth caught my attention. Gathering information about their open-source program for higher education ignited a spark within me. The prospect of sharing this knowledge with professionals in higher education inspires me to continue to work towards an open source future in education.

The day’s sessions were equally enriching. Emily Freeman’s opening keynote on the human touch in a GenAI world resonated deeply, reminding us of the significance of humanity in a rapidly evolving technological landscape. Gwyneth Peña-Siguenza’s insights on leveraging AI and GitHub Copilot opened new avenues for exploration, reflecting technology’s limitless possibilities.

James Quick’s talk on navigating career challenges was a guiding light for those who were stagnant professionally. His practical wisdom provided a reassuring perspective on overcoming obstacles and pursuing growth. Similarly, Barton George’s presentation on Project Sputnik and the valuable lessons learned emphasized the power of community-driven innovation within large corporations. Bryan Behrenhausen’s presentation on the Open Organization was impressive and reminded me of conversations we’ve had along those lines in the past. The last session of the day where we met to discuss what licensing should govern the use of open-source artificial intelligence, was very engaging and left me in awe.

As the day ends, I find myself brimming with inspiration and gratitude. All Things Open 2023 has been an event and a catalyst for personal and professional growth, reminding me of the significance of genuine connections, learning, and the continuous pursuit of knowledge and self-improvement.

The Freedom of Linux: A World Beyond Hardware Restrictions

In the ever-evolving world of technology, software updates often bring excitement and anticipation as they promise new features and improvements. However, with operating system updates for proprietary operating systems, the excitement can be tempered by stringent hardware requirements that leave many users facing the inevitable need for a new computer. Fortunately, an alternative,  the Linux kernel which powers the many Linux distributions and open source, allows users to embrace the latest software without hardware limitations.

A Diverse Landscape of Compatibility

Unlike proprietary operating systems with strict hardware prerequisites, Linux distributions offer fresh air. Whether you choose Pop!_OS, Fedora, or Linux Mint, Linux’s open nature ensures compatibility with a wide range of hardware, even aging systems. This remarkable flexibility is a testament to the power of open-source software.

Take, for instance, the case of the Darter Pro laptop from System76, acquired in early 2019 with Pop!_OS 18.10 pre-installed. Despite the years that have passed, this hardware continues to support the latest versions of not just Pop!_OS but also Ubuntu, Fedora, and Arch without breaking a sweat. Such an upgrade would be an unattainable dream if one attempted to install Windows 11 on the same machine. Likewise, the closed ecosystem of MacOS locks users into a world where they can only experience the latest software if they invest in Apple’s proprietary hardware.

The Hidden Treasure of Open Source

Regrettably, many people remain oblivious to the hidden treasure trove that is open-source software. Beyond the Linux kernel that forms the foundation of countless distributions, a vast ecosystem of applications thrives, often outperforming their proprietary counterparts. This abundance of high-quality, open-source software is built on principles prioritizing user freedom and choice.

For instance, consider the MarkText application, a tool I use to craft this article. It’s an exemplary testament to the capabilities of open-source software. With abundant features, a user-friendly interface, and an active community of developers and users, MarkText competes toe-to-toe with proprietary alternatives without any vendor lock-in or hardware mandates that plague proprietary systems. This is the essence of open source—a realm in which the user controls.

Breaking the Chains of Vendor Lock-In

Vendor lock-in is a pervasive challenge in the technology world. Proprietary software and hardware vendors often design their products to ensure consumers remain captive to their offerings. This strategy serves the interests of these companies. Still, it can be detrimental to the user, who may be in a never-ending cycle of purchasing new hardware to stay current.

In contrast, Linux and open-source software operate under a different ethos. They empower users to take control of their technology. With the freedom to choose software and customize their experience, users are no longer chained to a specific vendor’s roadmap. This approach breaks the cycle of forced obsolescence and keeps hardware relevant for years, ultimately saving users money and reducing electronic waste.

A Sustainable Approach

In an era of increasing environmental consciousness, the longevity of hardware takes on added importance. The “throwaway culture” of rapid hardware turnover is financially wasteful and environmentally unsustainable. By embracing Linux and open-source software, users can extend the lifespan of their hardware, contributing to a more sustainable future.

Additionally, the open-source community fosters collaboration and innovation without the limitations of proprietary systems. Developers worldwide work together to create secure, stable, and feature-rich software, often outpacing the development cycles of their proprietary counterparts. This collaborative spirit ensures that Linux users can access cutting-edge technology without the need for frequent hardware upgrades.

Conclusion

In the world of technology, where operating system updates often come with stringent hardware requirements, Linux stands as a beacon of freedom and sustainability. Its compatibility with a wide range of hardware, commitment to open-source principles, and freedom from vendor lock-in make it a compelling choice for those who wish to break free from the shackles of constantly upgrading their hardware.

As we navigate an ever-changing technological landscape, let us remember that there is a world beyond hardware restrictions, a world where Linux and open-source software offer an oasis of choice and longevity. In this realm, the user is king, and technology serves their needs, not vice versa. So, next time you hear the siren call of a new operating system update, consider the boundless possibilities of Linux and liberate yourself from the cycle of forced obsolescence.

Five Open Source Writing Apps

AbiWord: AbiWord is a free and open-source word processor software. It is written in C++, and since version 3, it is based on GTK+ 3. The name “AbiWord” is derived from the root of the Spanish word “abierto,” meaning “open.” AbiWord is openly licensed. It is available on Windows and Linux.

Joplin: Joplin is an open-source note-taking and to-do app that allows you to organize your thoughts and ideas efficiently. It supports markdown and syncing across devices and offers various features like tagging, searching, and encryption. Joplin is available on Windows, MacOS, Linux, iOS, and Android. You can take notes on your mobile platform and edit them when you get home on your laptop or desktop using Joplin Cloud or OneDrive. Joplin has a AGPL license.

Calligra Words: Calligra Words is a free and open-source word processor part of the Calligra Suite of office productivity software. It is available for Linux and Windows. Calligra Words uses the Open Document Format (ODF) as its default file format. Many different office suites support ODF, a vendor-neutral format. Calligra Words has a GPL v2 license.

Etherpad: Etherpad is a real-time collaborative document editor that runs in your browser. With Etherpad, you can write articles, press releases, to-do lists, and more with your friends, fellow students, or colleagues. Everyone can work on the same document simultaneously, and your changes will be reflected instantly. Learn more about Etherpad. Etherpad is open source with an Apache 2.0 license.

LibreOffice Writer: is a full-featured open-source word processor that offers a wide range of tools and features for writing documents. It supports various file formats, provides a familiar interface, and includes features like spell-checking, formatting, and document collaboration. LibreOffice has a Mozilla License.

When considering a writing application, it’s essential to think about how you will use it. Joplin, a Markdown editor designed for note-taking, is available on multiple platforms and has many features that make it well-suited. Joplin also has a built-in web clipper and a sync feature that allows you to sync your notes between multiple devices.

No matter what your decision, all of these applications are open source, and all support open document formats that ensure that your created work is in a format accessible to you and those you share with.

qrcp: A Command Line Tool to Transfer Files over Wi-Fi using QR Codes

 

I am an iPhone user, and my daily driver is Linux. I am always taking pictures with my phone but how do I get them easily transferred to my computer? I found the answer a few years ago when I discovered ‘qrcp’.

Qrcp is a command-line tool that allows you to transfer files over Wi-Fi using QR codes. It is a simple and efficient way to transfer files between devices, without the need for any third-party apps or services.

Claudio d’Angelis, the developer, has introduced the qrcp software under the MIT license. The application can be accessed on GitHub and boasts simplicity in both installation and usage. Compatible with Linux, Windows, and macOS, it offers download options in RPM, DEB, and tarball. Remarkably, there are builds tailored for a wide array of platforms, encompassing even the Raspberry Pi

The project maintains a downloads page where you can choose the appropriate package for your platform. Once that is accomplished, you can easily install the software with your package manager.

$ sudo dnf install ./qrcp*rpm

or

sudo apt install ./qrcp.*deb

Once the software is installed you need to configure it for your computer. If you are running a firewall you can configure ‘qrcp’ to use a particular port and make an exception rule on youir firewall.

$ qrcp config

To begin, initiate the configuration file creation process. Employ the qrcp config command for guidance, though it involves a few intricate inquiries. The first is what interface your computer is going to use, whether wireless, wired, etc. One of the queries is an option to choose a port. I chose port ‘8080’ but you can choose whatever makes sense to you. There is an option to choose a fully qualified domain name. In my case, I left it blank. You can specify a ‘url path’ or leave it blank. You can choose a default directory where the file will be received. Leave it blank, and the file will be placed in your ‘home’ directory.

Once the configuration is complete, you can use ‘qrcp’ to receive or send files from your mobile phone.

$ qrcp receive

The software generates a QR code similar to what is pictured above. Point your iPhone camera at the QR code, and your phone will recognize the QR code and initiate the transfer.

Successful transfers provide feedback on your phone specifying the file name and location where it has been transferred.

You can choose the picture from your photo library and easily send the file or text from your iPhone to your computer using your wireless network.

Get Publii – static site generator

Are you looking for a static website generator that’s easy to install and use? Then you need to check out Publii. It’s a GPL v3.0 static site generator that is the best I’ve seen. I have installed and used Jekyll and Hugo and while they are interesting they cannot hold a candle to Publii. Download and install Publii for your operating system and get started having some fun designing your own static CMS. Publii was easy to install on Linux Mint. I downloaded the ‘.deb’ file and easily installed it on my laptop.It also comes in ‘.rpm’ for Fedora users and as an app image if neither of those packages works for you. Download files for Windows and MacOS users are also available.

Publii is menu-driven and you can easily create a rich site on your computer and use it there or upload it to Gitlab, Github, Amazon, Netlify or any other hosting site you would like to use. The menu interface is very intuitive. Entering text is easy and users can choose a WYSIWYG, Block or Markdown editor.

You can see from the graphic that it’s easy to add posts, add tags, add menus, and authors. You can easily change the theme, some of which are provided or choose your own iteration. The settings menu lets a user select the name of the site and choose the language of the site, with many language choices represented. The server menu selection allows users to choose where the site will be hosted and the protocols used.

Publii introduces a novel approach to web development with its innovative concept—a desktop static website CMS, a first of its kind. Engineered with user-friendliness at its core, Publii caters to beginners while offering many advanced options and functionalities, empowering seasoned web developers to implement intricate customizations. By utilizing Publii, crafting secure and high-speed static websites becomes remarkably streamlined, eliminating unnecessary complexities.

Publii serves as a desktop application that empowers you to develop, revise, and enhance your website offline. Subsequently, you can effortlessly synchronize the alterations you’ve made to your site with your server by simply clicking a button. The versatility of Publii extends to accommodating various upload methods, encompassing traditional HTTP/HTTPS servers, Netlify, Amazon S3, GitHub Pages, Google Cloud, and SFTP, among others. Publii also includes software to backup your site, view log files, and import ‘wxr’ files.

You can easily examine Publii source code You can support the project easily too. Documentation is readily available and is menu driven too. If you are a developer Publli has help for you too.

Mastering Markdown with MarkText

A few years back, I learned about Markdown. I had never heard of it until I started exploring Jupyter Notebooks. Markdown was a familiar skill to many of my writing colleagues. It remained an uncharted territory for me.

Markdown is a universal method for composing text, employing concise notation to apply to style. For instance, rather than relying on a button click to emphasize a word, you envelop the word with two asterisks **word**.

Markdown holds a significant edge in its reliance on intuitive notations, often drawing from our ingrained habits. Employing asterisks for emphasis, and utilizing characters to distinguish headlines – these practices align seamlessly with our natural inclinations.

While its merits were extolled by many, I remained uncertain about the necessity of acquiring markdown skills. My inherent curiosity, however, drove me to delve into the realm of markdown, investigating how it could integrate into my writing endeavors.

As I underwent the learning process, I found an excellent Markdown cheat sheet online and discovered that I could write Markdown in any simple text editor like ‘nano’, ‘vim’, or ‘gedit’. While it is technically possible to use almost any text editor to write Markdown, it is much more powerful to use an editor specifically designed to output Markdown formatted documents.

I stumbled upon MarkText, a platform equipped with features that streamline markdown writing while presenting an unobtrusive interface. This tool boasts six themes, comprising three light and three dark options. I find the dark themes more comfortable to work with. Notably, the user documentation is comprehensive, and a dedicated resource for markdown syntax assistance is also available.

MarkText presents a clean, minimalistic interface with a real-time preview feature. It accommodates several markdown specifications, including Commonmark, Github Flavored Markdown, and Pandoc Markdown. Its official website shows MarkText supports markdown enhancements like KaTex, front matter, and emoji usage. The application is capable of generating both HTML and PDF output files.

Within Mark Text, you’ll find diverse editing modes such as typewriter mode, source code mode, and focus mode. Incorporating images is effortlessly achieved by copying and pasting them directly from the clipboard.

For added convenience, a pop-up situated in the upper-left corner of the Mark Text interface provides a continuous tally of the characters and paragraphs that have been entered. This proves particularly advantageous for writers.

Saving files is a straightforward task accessible via the upper-left menu of the MarkText window or by employing the Ctrl+S shortcut. Remarkably, the menus within Mark Text bear a friendly and recognizable resemblance to those found in fundamental text editors or word processors, creating a sense of familiarity for users.

The versatility of Mark Text truly impresses me, as it effortlessly accommodates many formats through simple keystroke shortcuts. These include table blocks, diagrams, inline formats, math formula blocks, and other code blocks.

You can acquire Mark Text for your respective operating system through the following links:

Mark Text is an open-source project governed by the MIT license. The latest version can always be obtained via download.

Alternatively, on macOS, you can install Mark Text using

brew install --cask mark-text

On Windows, installation can be accomplished through Chocolatey by running

choco install marktext.

Mark Text continually seeks the support of sponsors and developers. The project provides a guide for those interested in contributing. Furthermore, you can back the project on Patreon and Open Collective.

This article is adapted from Why MarkText is my favorite markdown editor