Skip to content

An educational playground for exploring and demonstrating various use cases and concepts of Large Language Models (LLMs). This repository provides examples of utilizing LLM APIs for different tasks, making it easier for developers to integrate LLMs into their projects.

License

Notifications You must be signed in to change notification settings

marquezea/LLM_playground

Repository files navigation

LLM_playground

An educational playground for exploring and demonstrating various use cases and concepts of Large Language Models (LLMs). This repository provides examples of utilizing LLM APIs for different tasks, making it easier for developers to integrate LLMs into their projects.

alt text

alt text

alt text

alt text

alt text

alt text

alt text

alt text

Installation

  1. Clone the repository:
git clone https://github.com/marquezea/LLM_playground.git
  1. Navigate to the project directory:
cd LLM_playground
  1. Create a virtual environment
python -m venv venv
  1. Activate the virtual environment
.\venv\scripts\activate.ps1 (in powershell)
.\venv\scripts\activate.bat (in command prompt)
.\venv\scripts\activate (in linux)
  1. Install the python libraries:
pip install -r requirements.txt

Setting API Keys

This applications invokes LLM APIs from different providers. You must have API KEYs for all the services that you intend to use. The following API KEYs are used in this project but you can decide which one to use.

Below is an explanation of how to setup the environment variables.

1. Windows:
  • Open Command Prompt or PowerShell.
  • Use the following command to set the environment variable for the current session:
set OPENAI_API_KEY=<your api key>
  • To make it persistent, add the variable to the system environment variables:
    • Search for "Environment Variables" in the start menu.
    • Click on "Edit the system environment variables."
    • In the System Properties window, click "Environment Variables."
    • Under "User variables" or "System variables," click "New" and add OPENAI_API_KEY as the name and your API key as the value.
2. Linux:
  • Open your terminal.
  • Set the environment variable for the current session with:
export OPENAI_API_KEY=<your api key>

To make it permanent, add the following line to your shell configuration file (~/.bashrc, ~/.zshrc, etc.):

export OPENAI_API_KEY=<your api key>
  • Save the file and run source ~/.bashrc (or the equivalent for your shell) to apply the changes.
3. macOS:
  • Open your terminal.
  • Set the environment variable for the current session:
export OPENAI_API_KEY=<your api key>
  • To make it permanent, add the following line to your shell configuration file (~/.bash_profile, ~/.zshrc, etc.):
export OPENAI_API_KEY=<your api key>

Save the file and run source ~/.bash_profile (or the equivalent for your shell) to apply the changes.

Usage

To start the application use the following command:

streamlit run LLM_playground.py

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contact Information

Adriano Marqueze adriano.marqueze@gmail.com

About

An educational playground for exploring and demonstrating various use cases and concepts of Large Language Models (LLMs). This repository provides examples of utilizing LLM APIs for different tasks, making it easier for developers to integrate LLMs into their projects.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages