This project is a simple Python chat app that uses the Groq API to talk to an LLM from the terminal.
It is already set up to work with uv, which manages Python dependencies and the virtual environment for you.
Make sure you have the following installed on your machine:
- Python 3.14 or newer
- VS Code
- Git
uv
On macOS and Linux:
curl -LsSf https://astral.sh/uv/install.sh | shOn Windows PowerShell:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"Verify the installation:
uv --version- Open the project folder in VS Code.
- Open the integrated terminal.
- Make sure you are inside the project root.
Recommended extensions:
- Python
- Jupyter
- Pylance
These extensions help with Python syntax, IntelliSense, notebook support, and interpreter selection.
From the project root, run:
uv syncThis will create the virtual environment and install the packages listed in pyproject.toml.
On macOS/Linux:
source .venv/bin/activateOn Windows:
.venv\Scripts\activateIf you do not want to activate it manually, you can still run commands through uv directly.
This project uses a .env file for configuration.
Create a file named .env in the project root and add the following:
GROQ_API_KEY=your_groq_api_key_here
MODEL=llama-3.3-70b-versatile- Go to https://console.groq.com/
- Create or sign in to your account.
- Create an API key.
- Paste it into the
.envfile.
Important: Do not commit your
.envfile or share your API key publicly.
From the project root, run:
uv run main.pyYou will see a chat prompt like:
You:
Type your message and press Enter. To exit the chat, type:
exit
If you want to use the notebook file in VS Code to play with python(not relevant to this project):
uv add ipykernelThen in VS Code:
- Open the notebook file.
- Select the Python interpreter from the
.venvenvironment. - Run the cells.
- Add a package:
uv add package-name- Run a Python file:
uv run main.py- Open a shell in the project environment:
uv shellRestart the terminal after installation or check that the install path is available in your shell.
Run:
uv syncCheck that:
- Your Groq API key is correct.
- The
.envfile is in the project root. - The
MODELvalue is valid for your account.
Open the Command Palette and choose:
- Python: Select Interpreter
Then select the interpreter from the .venv folder inside this project.