Christopher Zenzel

Contents

Table of Contents

Share

Using Generative AI with Llama to Build Sarcastic Weather: Part 1

white robot near brown wall

Welcome to this tutorial of building a weather bot to present Sarcastic Weather with Generative AI and Llama. In this multi-part tutorial we will cover everything from compiling and installing Llama to your local computer with an uncensored chat model, to the prompts to generate sarcastic weather information, to using a library call to generate the sarcastic weather and publishing it to your web site.

Let’s start this tutorial by learning how to clone and build the Llama.cpp open source repository from GitHub.

Requirements

Please ensure you have a Linux based computer for this tutorial with a PC that supports AVX CPU Instructions. Most modern desktops and servers support the latest instructions required for Generative AI. You can also use Generative AI with a modern GPU such as NVIDIA cards that provide CUDA computing technologies.

Cloning the Repository

Start by cloning the GitHub repository for Llama.cpp to your Linux home folder:

git clone https://github.com/ggerganov/llama.cpp.git

When the repository is cloned to your local computer please proceed to the next step.

Compiling the Repository

Here is the quickest way to compile the repository. It is one build command, but I want to make sure you also have ccache installed properly to make the compile faster in the future, should you need to recompile Llama.cpp.

If you have a Debian or Ubuntu Server or Desktop please ensure you have the ccache package installed:

apt-get -y install ccache

When you have ensured that you have ccache installed then issue the following command in the Terminal under the directory for the Llama.cpp repository:

make -j5

This will build the project with 5 threads. Of course you don’t need to specify the -j argument or can adjust it as needed.

Completed

Job well done! In this tutorial you have learned how to build the basic Llama.cpp library and software needed for the future tutorials. You should be able to see program executables such as server inside the directory that will be used as part of building a Sarcastic Weather bot.