• How to Reset Cisco Catalyst WS-C4500X to Factory Defaults

    How to Reset Cisco Catalyst WS-C4500X to Factory Defaults

    Need to reset your Cisco Catalyst 4500X  back to the factory default settings? Have you forgotten your password? Follow the steps below.

    Note: that I am assuming that you have already established a console connection to the switch using a Cisco serial cable (rollover cable).

    Interrupt the boot sequence with Ctrl-C within the first 5 seconds after power on. This will allow you to enter the “ROM” aka ROM Monitor.

    Configure the switch to boot-up without reading the configuration memory (NVRAM).

    You will then see the following options below. Select as shown.

    Clear the config as shown below

    Now boot the switch with the boot command

    Reference

    1. https://www.cisco.com/c/en/us/support/docs/switches/catalyst-4500-series-switches/116436-technote-product-00.html
    2. https://www.cisco.com/c/en/us/support/docs/switches/catalyst-4000-series-switches/21229-pswdrec-cat4000-supiii-21229.html
  • How to Install and Configure Dnsmasq with Web Frontend on RHEL 9

    How to Install and Configure Dnsmasq with Web Frontend on RHEL 9

    In this post we are going to install and configure dnsmasq with a simple webUI acting as a front end for our less technical users. Our goal is to simplify dns in our lab sandboxes, and keep users from directly modifying our dnsmasq config files.

    Installation

    First we need to install dnsmasq.

    # dnf -y install dnsmasq

    Now lets enable and start the service. We will also check the status of the service to ensure that we do not have any issues with the default config.

    # systemctl start dnsmasq
    # systemctl enable dnsmasq
    # systemctl status dnsmasq

    Configuration

    Next let’s make a backup of the default configuration file before we start making modification.

    cp /etc/dnsmasq.conf /etc/dnsmasq.conf.orig

    I made the following modifications.

    1. listen-address is the loopback and our routable ip address
    2. expand-hosts, we uncomment this in order to allow dnsmasq to automatically expand the hostnames to fully qualified domain names
    3. domain – this is the local domain that we will serve via dnsmasq
    4. dhcp-range – this is the range of IP addresses that dnsmasq is allowed to hand out
    interface=enp1s0
    listen-address=127.0.0.1,192.168.65.7
    expand-hosts
    domain=sandbox3.localdomain
    dhcp-range=192.168.65.20,192.168.65.40,255.255.255.128,12h
    

    Next we check our config file for any errors

    # dnsmasq --test
    dnsmasq: syntax check OK.

    Now lets restart dnsmasq

    # systemctl restart dnsmasq

    Firewall Config

    Now we need to modify firewalld

    [root@dns ~]#  firewall-cmd --add-service=dns --permanent
    success
    [root@dns ~]# firewall-cmd --add-service=dhcp --permanent
    success
    [root@dns ~]# firewall-cmd --reload
    success

    Testing

    I prefer to use nslookup for testing, so lets install it

    # dnf -y install bind-utils

    Now let’s make sure we are able to resolve addresses, using our local instance of dnsmasq.

    # nslookup
    > server localhost
    Default server: localhost
    Address: ::1#53
    Default server: localhost
    Address: 127.0.0.1#53
    > google.com
    Server:		localhost
    Address:	::1#53
    
    Non-authoritative answer:
    Name:	google.com
    Address: 142.251.40.174
    Name:	google.com
    Address: 2607:f8b0:4006:821::200e
    

    Install and Configure the Webui

    For the webui – we are going to use a simple one that I found via the link below. https://github.com/akivajp/dnsmasq-webconf

    First, we need to install git and pip

    # dnf -y install git
    # dnf -y install pip

    Then we follow the directions which I will repeat here.

    # mkdir -p ~/git && cd ~/git
    # git clone https://github.com/akivajp/dnsmasq-webconf.git

    Then we use pip to install jinja2

    # pip install --user bottle jinja2

    Now change directory

    # cd dnsmasq-webconf/

    We now need to poke a hole for http traffic in our local firewall

    # firewall-cmd --add-service=http --permanent
    # firewall-cmd --reload

    Now start the front end

    #  python ~/git/dnsmasq-webconf/app/index.py 80 --leases /var/lib/dnsmasq/dnsmasq.leases --hosts /etc/hosts --config /etc/dnsmasq.conf

    Creating a Service

    So far we have dnsmasq configured and running, and we have installed a web front end and have been able to start it on the command line. Now we need to configure the front end to start as a service when the OS boots. So we now need to turn the webUI into a systemd service.

    First we create the following service file

    # vi /etc/systemd/system/dnsmasq-webconf.service

    The contents of which are below. Note that we have modified relative paths to be absolute paths.

    [Unit]
    Description=DNSMasq WebConf
    After=network.target
    
    [Service]
    ExecStart=/usr/bin/python3 /root/git/dnsmasq-webconf/app/index.py 80 --leases /var/lib/dnsmasq/dnsmasq.leases --hosts /etc/hosts --config /etc/dnsmasq.conf
    Restart=always
    User=root
    WorkingDirectory=/root/git/dnsmasq-webconf/app
    StandardOutput=journal
    StandardError=journal
    
    [Install]
    WantedBy=multi-user.target

    Now we need to reload systemd

    # systemctl daemon-reload

    Now we can start the service

    # systemctl start dnsmasq-webconf.service

  • Resetting a Lost BMC Password with ipmitool

    Resetting a Lost BMC Password with ipmitool

    I recently got my hands on a couple of gigabyte servers. These machines came preinstalled with Ubuntu 20.04. Credentials for a OS local user account were on a sticker on the machines. However there was no indication of what the BMC credentials were. According to this document, there should be default credentials that we can use on the motherboard, however, they were not working.

    These machines came with Ubuntu 20.04 on them, and did not have ipmitool installed.

    $ sudo apt install ipmitool --fix-missing

    Once installed we need to determine what BMC users exist.

    $ sudo ipmitool user list 1

    In the output below you can see that there is one user – “admin” – identified as ID #2

    Now lets reset the password for “admin”.

    $ sudo ipmitool user set password 2

    We are then prompted to create a new password.

    We should now be able to load the BMC web interface and login with our new credentials

  • How to Connect to a Cisco Serial Port via Minicom

    How to Connect to a Cisco Serial Port via Minicom

    Prerequisites

    You will need the following. A RJ45 to RS232 (serial) roll-over cable. Shown below

      And a USB to RS232(DB9) adapter (below)

        Connect the RJ45 to the serial port on your Cisco switch. Connect the two Db9s and plug the usb port into your workstation.

        Your should see the adapter recognized as ttyUSB0. You can check this with the command below

        $ sudo dmesg | grep tty
        [692949.868426] usb 3-12: FTDI USB Serial Device converter now attached to ttyUSB0
        

        Install and Configure Minicom

        Next you will need need to install minicom. Since I am running Ubuntu, I will use apt. If using Centos/Fedora you will use dnf.

        $ sudo apt install minicom -y

        Then we need to configure minicom. Start by running the command below.

        $ sudo minicom -s

        Select “Serial Port Setup”

        Change the Following

        1. Serial Device : /dev/ttyUSB0
        2. Bps/Par/Bits : 9600 8N1
        Correct minicom config for Cisco

        Save your config and relaunch minicom.

      1. Simple RAG with Ollama, OpenWebUI, and VectorDB on Ubuntu 22.04

        Simple RAG with Ollama, OpenWebUI, and VectorDB on Ubuntu 22.04

        Prerequisites

        I have already installed Nvidia proprietary drivers and the Nvidia Cuda Toolkit. I documented the install of the Cuda toolkit in an older post which can be found here.

        Since I have Nvidia GPUs in my host system, and I intend to run some services in containers, I want to make sure that I install the nvidia-container-toolkit. Instructions on how to setup the repo on Ubuntu 22.04 can be found here. Once you have setup the repo, you can follow the steps below, or just follow the instructions found in the link above.

        $ sudo apt-get install -y nvidia-container-toolkit

        I will be using Docker as my container runtime. So I need to configure the container runtime to use docker.

        $ sudo nvidia-ctk runtime configure --runtime=docker

        Now restart Docker.

        $ sudo systemctl restart docker

        Install Ollama

        Run the command below to install ollama as a service. You can also choose to run containerized ollama, however those steps are not documented here.

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

        Once complete, run the command below to confirm installation, and check version.

        $ ollama --version
        ollama version is 0.5.12

        Add the environment variable below to the ollama service file in order to listen on all interfaces. This way we can access remotely if needed.

        Environment=”OLLAMA_HOST=0.0.0.0″

        Edit the ollama service files and add the line above to the bottom of the file.

        $ sudo vi /etc/systemd/system/ollama.service

        The file should appear as shown below.

        [Unit]
        Description=Ollama Service
        After=network-online.target
        
        [Service]
        ExecStart=/usr/local/bin/ollama serve
        User=ollama
        Group=ollama
        Restart=always
        RestartSec=3
        Environment="PATH=/usr/local/cuda/bin:/home/cpaquin/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
        Environment="OLLAMA_HOST=0.0.0.0"
        
        [Install]
        WantedBy=default.target
        

        Now restart ollama and reload systemd

        $ sudo systemctl restart ollama.service
        $ sudo systemctl daemon-reload

        Confirm ollama is listening on all interfaces.

        $ netstat -a | grep 11434
        tcp6 0 0 [::]:11434 [::]:* LISTEN

        Test Connectivity from a remote host. If you are unable to reach the ip/port you may need to modify firewall on the remote system.

        $ telnet 10.1.10.14 11434
        Trying 10.1.10.14…
        Connected to 10.1.10.14.
        Escape character is '^]'.

        Install OpenWeb UI

        I am using the open-webui:cuda container as I am running dual Nvidia GPUs. I want OpenWeb-UI to bind to the primary interface on the host so that I can access it from my workstation.

        # docker run -d -p 10.1.10.14:3000:8080 --gpus all --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:cuda

        The -v option in the command below will create a volume for OpenWeb-UI. You can verify with the command below

        $ docker volume ls
        DRIVER    VOLUME NAME
        local     open-webui
        

        Confirm that the container has started.

        $ docker ps

        If it has failed to start use “docker logs <container-id>” to troubleshoot.

        Now, in a web browser, navigate to the ip/port combo you entered in the docker run command shown above. You should be greeted with the OpenWeb-UI getting started page.


        Install ChromaDB

        Use the command below to instanciate the ChromaDB container. 10.1.10.14 is the ip of my host, adjust as needed to fit your needs

        $ docker run -d \
          --name chromadb \
          -p 10.1.10.14:8000:8000 \
          -v chroma_data:/chroma_db \
          --restart unless-stopped \
          chromadb/chroma

        Confirm you can curl api.

        curl http://10.1.10.14:8000/api/v1
        

        Reinstantiate OpenWebUI with ChromaDB Connectivity

        Stop current OpenWebUI container.

        $ docker stop open-webui

        Delete the container

        $ docker remove open-webui

        Recreate the container but add the following

        1. -e VECTORDB_PROVIDER=chroma
        2. -e CHROMADB_SERVER_HOST=”http://10.1.10.14:8000&#8243; (modify IP to fit your env)
        $ docker run -d -p 10.1.10.14:3000:8080 --gpus all \
        --add-host=host.docker.internal:host-gateway \
        -v open-webui:/app/backend/data \
        -e VECTORDB_PROVIDER=chroma \
        -e CHROMADB_SERVER_HOST="http://10.1.10.14:8000" \
        --name open-webui --restart always ghcr.io/open-webui/open-webui:cuda

        Check to ensure that env variables were set correctly

        $ docker exec -it open-webui env | grep -i chroma
        VECTORDB_PROVIDER=chroma
        CHROMADB_SERVER_HOST=http://10.1.10.14:8000
        
        

        Setup RAG in OpenWebUI

        In order to setup RAG you will need to do the following.

        1. Create a Knowledge Base
        2. Upload files
        3. Create the Model that will use the Knowledge Base

        First we will create a knowledge base. Navigate to Workspace > Knowledge > + Create a Knowledge Base. Choose a name for your Knowledge base and add a description.

        We are going to name ours, Gordon Lightfoot

        Now select Create Knowledge

        Look real hard for the text “Drag and drop a file to upload or select a file to view”. This is where you w drag and drop your documents. We have two documents to add to our collection.

        You can also upload entire directories or sync with a directory

        Now navigate to Workspace > Models > + Add New Model. Imput a name for your custom model and choose a base model. I am choosing tinyllama for this test.

        Scroll down and select Save & Create

        Now let’s chat with our new model. Select Workspace and then select your new model (My Gordon Lightfoot Model)

        You are now ready to chat with your model

        Let’s ask it a question

        So there you go. A working RAG implementation with Ollama, OpenWebUI, and VectorDB. I am sure that there are a lot more features to explore here and I am sure I have a lot more tuning to do. But for now I am off to a good start.


        References

        1. https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html
        2. https://docs.openwebui.com/tutorials/tips/rag-tutorial/
      2. How to Install Instructlab + VLLM with Nvidia Cuda Support on Ubuntu 22.04

        How to Install Instructlab + VLLM with Nvidia Cuda Support on Ubuntu 22.04

        Installing Prerequisites

        We are installing on a very fresh install of Ubuntu 22.04 with an Nvidia 3070ti GPU. Nvidia Drivers were installed at build time. However lets check to see what version of the Nvidia driver we are currently running.

        $ nvidia-detector
        nvidia-driver-570

        While we are at it, let’s make sure that we have nvidia-smi installed which is included in the package shown below

        $ sudo apt install nvidia-utils-570
        

        We will need gcc, which the meta-package below will include (along with make and other dev tools).

        # sudo apt install build-essential -y

        Lets check what version of python we have installed.

        $ python3 --version
        Python 3.10.12
        

        Now install python-venv which is the python module that supports creating virtual environments. Reference the python version shown in the output in the step above

        # sudo apt install python3.10-venv -y

        Installing the Nvidia Cuda Toolkit

        Note: If you installed the nvidia-cuda-toolkit from default ubuntu noble repo, uninstall it first as that version is probably too old. Uninstall with “sudo apt purge nvidia-cuda* -y

        “The NVIDIA CUDA Toolkit is a software development kit that helps users create GPU-accelerated applications. It includes libraries, compilers, debuggers, and optimization tools”. Since we have an Nvidia GPU we will install it as shown below.

        # wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-ubuntu2204.pin
        

        First we wget the Nvidia Cuda Repository pin as shown above. Then we move it to /etc/apt/preferences.d/ (shown below).

        This is a configuration file that is used to prioritize packages from the NVIDIA CUDA repository when installing CUDA on a Linux system. Basically it tells apt where to get the Cuda Toolkit.

        $ sudo mv cuda-ubuntu2204.pin /etc/apt/preferences.d/cuda-repository-pin-600

        Now we wget the repo. Note that this is a pretty hefty .deb and may take a few minutes.

        $ wget https://developer.download.nvidia.com/compute/cuda/12.8.0/local_installers/cuda-repo-ubuntu2204-12-8-local_12.8.0-570.86.10-1_amd64.deb

        And install it.

        $ sudo dpkg -i cuda-repo-ubuntu2204-12-8-local_12.8.0-570.86.10-1_amd64.deb
        $ sudo cp /var/cuda-repo-ubuntu2204-12-8-local/cuda-*-keyring.gpg /usr/share/keyrings/

        Finally we install the toolkit.

        $ sudo apt-get update
        $ sudo apt-get -y install cuda-toolkit-12-8
        $ sudo apt install cuda-runtime-12-8
        

        Nvidia states that you need to add the following env vars to your .bashrc, however you will also need to add them to your python virtual env — in venv/bin/activate. These variables will be needed during the install process below.

         export CUDA_HOME=/usr/local/cuda                           
         export PATH=${CUDA_HOME}/bin:${PATH}                       
         export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:$LD_LIBRARY_PATH
        

        Installing Instructlab

        First we make a directory were we want our python virtual env to live.

        $ mkdir instructlab
        $ cd instructlab/

        Now we create the python virtual environment.

        
        $ python3 -m venv --upgrade-deps venv
        $ source venv/bin/activate

        Note that every time you want to use instructlab cli (ilab) post-install you must source the file above. venv/bin/activate

        The install guide found here has you run this command to clear out the pip package cache (for this one package. Not required for first install, but may be on subsequent install runs.

        $ pip cache remove llama_cpp_python

        We then run the 3 commands shown below. Apparently there is a known bug and we will not pick up these required packages as needed, so we need to install them manually, and in the order shown below.

        $ pip install --upgrade pip wheel setuptools
        $ pip install torch
        $ pip install flash-attn

        Now we are ready to install instructlab.

        $ pip install 'instructlab[cuda]' /
           -C cmake.args="-DLLAMA_CUDA=on" /
           -C cmake.args="-DLLAMA_NATIVE=off"

        Lets verify the install

        $ ilab --version
        ilab, version 0.24.0
        

        Installing vLLM

        The instructions have you wrap up the of Instructlab with a pip install of vllm, however this install will fail due as it cannot find nvcc without setting the env variables. So set the following env vars as shown below.

        $ export CUDA_HOME=/usr/local/cuda                           
        $ export PATH=${CUDA_HOME}/bin:${PATH}                       
        $ export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:$LD_LIBRARY_PATH

        The instructions for installing instructlab with Nvidia Cuda support as documented on instructlab.ai currently have you pip install a very specific version of vllm (with cuda support), however I have found that this command will fail (at least on Fedora 40, Ubuntu 22.04, and Ubuntu 24.04) that command is shown below.

        $ pip install vllm@git+https://github.com/opendatahub-io/vllm@2024.08.01

        So this is a method that I have found to work around the issue.

        First run pip install on vllm

        $ pip install vllm

        Confirm vllm installed correctly.

        $ pip show vllm
        Name: vllm
        Version: 0.7.3
        Summary: A high-throughput and memory-efficient inference and serving engine for LLMs
        Home-page: https://github.com/vllm-project/vllm
        Author: vLLM Team
        Author-email: 
        License: Apache License
        
        Author-email: 
        License: Apache 2.0
        Location: /home/cpaquin/Workspace/instructlab/venv/lib/python3.10/site-packages
        Requires: aiohttp, cmake, fastapi, filelock, lm-format-enforcer, ninja, numpy, nvidia-ml-py, openai, outlines, pillow, prometheus-fastapi-instrumentator, prometheus_client, psutil, py-cpuinfo, pydantic, pyzmq, requests, sentencepiece, tiktoken, tokenizers, torch, torchvision, tqdm, transformers, typing_extensions, uvicorn, vllm-flash-attn, xformers
        

        Now remove vllm

        $ pip uninstall vllm

        Now run the original pip install command as documented

        $ pip install vllm@git+https://github.com/opendatahub-io/vllm@2024.08.01

        Now check vllm version, which we can see has cuda support

        $ pip show vllm
        Name: vllm
        Version: 0.5.2.3+cu128
        Summary: A high-throughput and memory-efficient inference and serving engine for LLMs
        Home-page: https://github.com/vllm-project/vllm
        Author: vLLM Team
        Author-email: 
        License: Apache 2.0
        Location: /home/cpaquin/Workspace/instructlab/venv/lib/python3.10/site-packages
        Requires: aiohttp, cmake, fastapi, filelock, lm-format-enforcer, ninja, numpy, nvidia-ml-py, openai, outlines, pillow, prometheus-fastapi-instrumentator, prometheus_client, psutil, py-cpuinfo, pydantic, pyzmq, requests, sentencepiece, tiktoken, tokenizers, torch, torchvision, tqdm, transformers, typing_extensions, uvicorn, vllm-flash-attn, xformers
        Required-by: 
        

        Testing VLLM

        Below is the command that I ran to test that vllm is working and is in fact, leveraging the GPU

        $ vllm serve "TinyLlama/TinyLlama-1.1B-Chat-v1.0" --dtype float16 --gpu-memory-utilization 0.8

        One up and running you will see output similar to what is shown below.

        INFO:     Started server process [1252947]
        INFO:     Waiting for application startup.
        INFO:     Application startup complete.
        INFO:     Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
        

        Testing Pytorch Module

        You can create and run the python script below to test if your GPU is identified correctly. This step is not required, but its handy in identifying potential issues with gpu/cuda.

        import torch
        print("CUDA available:", torch.cuda.is_available())
        print("CUDA version:", torch.version.cuda)
        print("Torch version:", torch.__version__)
        print("GPU count:", torch.cuda.device_count())
        print("GPU name:", torch.cuda.get_device_name(0) if torch.cuda.is_available() else "None")

        Output below for reference.

        $ python3 ./test.py 
        CUDA available: True
        CUDA version: 12.4
        Torch version: 2.5.1+cu124
        GPU count: 1
        GPU name: NVIDIA GeForce RTX 3070 Ti

        Instructlab Init and Setup

        Now that we have ilab installed we can initialize our environment with the command below. This command will download the Taxonomy repository to our local machine along with a config file. Apparently ilab init has a few default GPUs available to choose from, but since my current GPU is

        Our config file is located in our home directory, if you want to take a look. Note that our GPU, being a Nvidia RTX 3070 TI, will have differing config values than what we selected above (A100), so in a later step we will need to edit our config

        /home/cpaquin/.config/instructlab/config.yaml

        To see the info regarding your workstation, you can run the command below. We will use some of the data below to update our config

         ilab system info
        Platform:
          sys.version: 3.10.12 (main, Jan 17 2025, 14:35:34) [GCC 11.4.0]
          sys.platform: linux
          os.name: posix
          platform.release: 6.8.0-52-generic
          platform.machine: x86_64
          platform.node: scar-Z97-HD3
          platform.python_version: 3.10.12
          os-release.ID: ubuntu
          os-release.VERSION_ID: 22.04
          os-release.PRETTY_NAME: Ubuntu 22.04.5 LTS
          memory.total: 31.30 GB
          memory.available: 27.11 GB
          memory.used: 3.60 GB
        
        InstructLab:
          instructlab.version: 0.24.0
          instructlab-dolomite.version: 0.2.0
          instructlab-eval.version: 0.5.1
          instructlab-quantize.version: 0.1.0
          instructlab-schema.version: 0.4.2
          instructlab-sdg.version: 0.7.0
          instructlab-training.version: 0.7.0
        
        Torch:
          torch.version: 2.3.1+cu121
          torch.backends.cpu.capability: AVX2
          torch.version.cuda: 12.1
          torch.version.hip: None
          torch.cuda.available: True
          torch.backends.cuda.is_built: True
          torch.backends.mps.is_built: False
          torch.backends.mps.is_available: False
          torch.cuda.bf16: True
          torch.cuda.current.device: 0
          torch.cuda.0.name: NVIDIA GeForce RTX 3070 Ti
          torch.cuda.0.free: 7.1 GB
          torch.cuda.0.total: 7.7 GB
          torch.cuda.0.capability: 8.6 (see https://developer.nvidia.com/cuda-gpus#compute)
        
        llama_cpp_python:
          llama_cpp_python.version: 0.3.6
          llama_cpp_python.supports_gpu_offload: False
        

        Editing Generated Config

        Use the command below to edit the generated config.

        $ ilab config edit

        Here we go through the file and ensure that we are setting the number of GPUs correctly. We also modify some additonal settings that have differed from the default (as ilab thinks we now have a $40k GPU). Below is some of what we have configured.

        # Metadata pertaining to the specifics of the system which the Configuration is
        # meant to be applied to.
        metadata:
          # Manufacturer, Family, and SKU of the system CPU, ex: Apple M3 Max
          # Default: None
          cpu_info:
          # Amount of GPUs on the system, ex: 8
          # Default: None
          gpu_count: 1
          # Family of the system GPU, ex: H100
          # Default: None
          gpu_family: RTX 3070 TI
          # Manufacturer of the system GPU, ex: Nvidia
          # Default: None
          gpu_manufacturer: Nvidia
          # Specific SKU related information about the given GPU, ex: PCIe, NVL
          # Default: None
          gpu_sku:
        
        


        Working with Models

        Before we start working with a model, lets take a look at the ilab command parameters. We can see that we have several options such as download, list, test, train, chat, serve, etc.

        Lets download a model with the command below. The command below will download the default model sets in the config file

        $ ilab model download

        output below

        View your downloaded models via the command below

        $ ilab model list

        Now we serve the default model with the command below

        $ ilab model serve

        Open another terminal window and source the env file from the instructlab directory

        $ source venv/bin/activate
        

        Then run the command below to begin an interactive chat session

        $ ilab model chat

        References

        1. https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=22.04&target_type=deb_local
        2. https://github.com/instructlab/instructlab/issues/2422
        3. https://github.com/instructlab/instructlab
        4. https://developers.redhat.com/blog/2024/06/12/getting-started-instructlab-generative-ai-model-tuning#getting_started_with_instructlab
        5. https://www.techtarget.com/searchcio/definition/synthetic-data#:~:text=Synthetic%20data%20is%20increasingly%20used,fresh%20domain%20knowledge%20and%20explainability.
        6. https://docs.nvidia.com/cuda/cuda-installation-guide-linux/#meta-packages
        7. https://docs.redhat.com/en/documentation/red_hat_enterprise_linux_ai/1.2/html/building_your_rhel_ai_environment/initializing_instructlab#initialize_ilab

      3. Getting Started with Instructlab: Installing on Fedora 40

        Getting Started with Instructlab: Installing on Fedora 40

        Prerequisite – Install python 3.11. The default on Fedora 40 is python 3.12

        $ sudo dnf -y install python3.11.x86_64 python3.11-devel.x86_64  -y

        Install automake and gcc (GNU Compiler Collection)

        $ sudo dnf install make automake gcc gcc-c++
        

        Add the following env vars to your .bashrc, and source

        export CUDA_HOME=/usr/local/cuda
        export PATH=${CUDA_HOME}/bin:${PATH}
        export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:$LD_LIBRARY_PATH
        

        Create your virtual env and activate

        $ python3.11 -m venv --upgrade-deps venv
        $ source venv/bin/activate
        

        Note that every time you want to use instructlab cli (ilab) post-install you must source the file above. venv/bin/activate

        We then run the 3 commands shown below. Apparently there is a known bug and we will not pick up these required packages as needed, so we need to install them manually.

        $ pip install --upgrade pip wheel setuptools
        $ pip install torch
        $ pip install flash-attn

        The install guide found here has you run this command to clear out the pip package cache (for this one package. Not required for first install, but may be on subsequent runs.

        $ pip cache remove llama_cpp_python

        Now install instructlab

        $ pip install 'instructlab[cuda]' -C cmake.args="-DLLAMA_CUDA=on" -C cmake.args="-DLLAMA_NATIVE=off" 

        Install vllm.

        NOTE: The vllm install is currently failing with this error – ImportError: libcudnn.so.8: cannot open shared object file: No such file or directory. I am looking to find a resolution or work-around

        $ pip install vllm@git+https://github.com/opendatahub-io/vllm@2024.08.01

        Resources

        1. https://docs.instructlab.ai/getting-started/linux_nvidia/
        2. https://github.com/vllm-project/vllm
        3. https://www.redhat.com/en/topics/ai/what-is-vllm
        4. https://github.com/opendatahub-io