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.
- Clone the repository:
git clone https://github.com/marquezea/LLM_playground.git
- Navigate to the project directory:
cd LLM_playground
- Create a virtual environment
python -m venv venv
- Activate the virtual environment
.\venv\scripts\activate.ps1 (in powershell)
.\venv\scripts\activate.bat (in command prompt)
.\venv\scripts\activate (in linux)
- Install the python libraries:
pip install -r requirements.txt
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.
- OPENAI_API_KEY www.openai.com
- ANTHROPIC_API_KEY Anthropic API
- STABILITY_API_KEY Stability AI
- LEONARDO_API_KEY Leonardo API
- GEMINI_API_KEY Google Gemini API
- MISTRAL_API_KEY Mistral API
- HFINF_API_KEY Hugging Face API
- GROQ_API_KEY Groq API
Below is an explanation of how to setup the environment variables.
- 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.
- 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.
- 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.
To start the application use the following command:
streamlit run LLM_playground.py
This project is licensed under the MIT License - see the LICENSE file for details.
Adriano Marqueze adriano.marqueze@gmail.com