Skip to content

shaz-1n/task-1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python AI Chatroom

A simple web-based chatroom built with Flask, SQLite, and the Groq API (Llama 3.1).

Features

  • Flask backend with SQLite storage
  • Groq API integration using the openai Python SDK
  • Vanilla JS & plain HTML frontend
  • Real-time interaction with the bot without full page reloads
  • Conversation history maintained for contextual LLM responses
  • Simple CLI testing client via requests

Requirements

Setup

  1. Get a free Groq API Key

    • Go to groq.com
    • Sign up / Log in
    • Go to the API Keys section
    • The free tier does not require a credit card and provides generous usage limits on Llama 3.1!
  2. Install Dependencies

    pip install -r requirements.txt
  3. Configure Environment

    • Copy .env.example to .env:
      cp .env.example .env
    • Edit .env and fill in your Groq API key:
      GROQ_API_KEY=gsk_your_api_key_here
      

How to Run

  1. Start the Web Server

    python web_server.py

    The database (chat.db) and its schema will be initialized automatically. The server will run on http://0.0.0.0:5000 in debug mode.

  2. Access the Web Interface

  3. Use the CLI Client (Optional)

    • Start the server using the instructions above.
    • Open a new terminal window / tab.
    • Run the client script:
      python client.py
    • You can chat directly from the terminal!

About

csbb352

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors