0% found this document useful (0 votes)
41 views4 pages

Hacking LLM

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views4 pages

Hacking LLM

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Hacking-LLM

Introduction
Workshop by Parimal

This PDF document outlines the comprehensive steps to replicate a contained


environment, exclusively for educational purposes and hands-on practice. It is essential
to note that exceeding this scope may lead to unauthorized activities and potentially
result in severe consequences.
Note: The sole intention of this exercise is educational

Pre-requisites
Note

To install the application locally, it is important to understand the pre-requisites.


Given below are the minimum specifications

Name Specification
Processor >3.5 GHz
RAM >8GB
HDD >20GB
GPU Good to have but not required

Setting up the lab environment


Important

It is assumed that the basic python environment setting is known to the user.
The steps given below clearly demonstrates the setting up process, at any given point,
it is required by the user to troubleshoot the steps and the document maker cannot be
held liable for the setting up this lab environment
1. Installing python
Download Python | Python.org
2. In the link given above, the latest version of python (3.13.1) setup can be downloaded
and installed on your system using the standard installation process
3. Once the installation is complete, open terminal
1. Windows - PowerShell
2. Linux - Bash
4. Type the following command to validate the python installation:

python --version

5. If the output is displayed, the python installation has been successfully validated.
6. Go to the following GitHub repository given below:

GitHub Chatbot Link

GitHub - AdMediastic/chatbot: The repository is used to create a local chatbot


application using python flask serve, Ollama and llama3.1 base model.

7. For the simplified steps, click on the Releases button on the right-hand side and
download the chatbot-workshop.zip file and extract the zip file contents
8. To do it manually, make sure Git For Windows is installed on the system:

Git for Windows


Git - Downloads

9. Use the following command to clone the repository:

git clone https://github.com/AdMediastic/chatbot.git

10. Now enter the cloned repository using the cd command

cd .\chatbot

11. Type the following command to install dependencies and packages to the run the
chatbot:

pip install -r requirements.txt

12. Install Ollama, link given below:


Ollama
Download Ollama on Windows

13. Validate the Ollama installation by running the following command:

ollama

14. Next, use the following command to download and use Llama 3.1 (8 Billion Parameter
Model) via Ollama Service:

ollama run llama3.1:8b

Note

This process may take time depending upon the internet connectivity, speed and
other factors.

Running the Chatbot App:


In case of Failure

In case of any errors, please troubleshoot by searching for the errors on Google
If you troubleshooting still hasn't resolved, get in touch with the Group Admins and the
moderators will help you in the troubleshooting process

To run the chatbot app, use the following command given below:

python app.py

Local Server

The configured local chatbot application will be available on:


http://127.0.0.1:5000/
If the application is not available, check for the Port Number or Proxy server if you
have configured any and restart the application
Usually, the flask server runs on Port 5000
If the port is unavailable, check the flask documentation to configure the server on any
other port: Development Server — Flask Documentation (3.1.x)

Virtual Environment

It is advisable to setup and activate the virtual environment


Explaining the same is beyond the scope of this workshop
For more information please refer python documentation for the same
venv — Creation of virtual environments — Python 3.13.1 documentation

Info

For your reference, a sample DAN (Do-Anything-Now) prompt injection is available in


the prompt directory

Thank You

I hope that you have liked the workshop


For more such interesting workshop follow THM Nagpur
If you personally want to connect with me, dropping my LinkedIn below:
https://linkedin.com/in/parimal-aglawe

You might also like