How do I use instructlab on the Linux CLSE?

InstructLab Knowledgebase Guide

 

Overview

This guide explains how to set up, run, and use InstructLab, including what to do after running the setup script and after logging out and back in.

 

Activate the environment:

  • Each time you log in, activate the virtual environment:

source ~/uv-instructlab/bin/activate

 

Initialize InstructLab (only needs to be done once per environment):

  • Run: 

ilab config init

 

When prompted:

  • Taxonomy repository: Press Enter to clone the default repository

  • Model path: Press Enter to use the default model, or provide a custom path. (default model: Merlinite) (See below for more details on models)

  • System profile selection

    • If you are using a CAEN linux machine (remote or physical), when prompted:

      • Select 3 for Intel

      • Select 1 for normal CPU-based system 

 

Uploaded Image (Thumbnail)

 

  • Once you see the prompt below, you have finished the initialization process

 

Uploaded Image (Thumbnail)

 


 

Download Model:

  • Even after initialization, you must download the default model using this command:

ilab model download

 

To check out different models available, see this page: https://docs.instructlab.ai/getting-started/download_models/ 

 

Running the Model

ilab model serve

 

Once you see a line like this, you can chat with the model 

Uploaded Image (Thumbnail)

  • Keep this terminal open while using the model

 

To use a custom model (optional):

ilab model serve --model-path models/granite-7b-instruct.gguf

 

Chatting with the Model

  • Open a new terminal, activate the environment, then run:

ilab model chat

 

Uploaded Image (Thumbnail)

Exiting and stopping

  • To exit the chatbot, type: exit or quit or press Ctrl + c

  • To stop the server, press Ctrl + c in the terminal running “ilab model serve”

 

After Logging Out / Reconnecting

When you return 

  1. Activate the environment

source ~/uv-instructlab/bin/activate

 

  1. Start the model

ilab model serve

 

  1. Open a new terminal, activate the environment, and chat:

ilab model chat

 

Configuration Details

  • To change the default model, open the config file in a text editor:

nano ~/.config/instructlab/config.yaml

 

  • Find and update:

model: path: /home/uniquname/.cache/instructlab/models/your-new-model.gguf

 

Additional resources:

Getting Started: https://docs.instructlab.ai/getting-started/initilize_ilab/ 

Serve & Chat: https://docs.instructlab.ai/getting-started/serve_and_chat/ 

Models: https://docs.instructlab.ai/getting-started/download_models/

What is InstructLab: https://www.redhat.com/en/topics/ai/what-is-instructlab 

InstructLab AI: https://instructlab.ai