Skip to content

jeremiahpantaras/Askium

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿค– AI Chatbot with Ollama

React Django Ollama Tailwind

A modern, full-stack AI chatbot application powered by local LLMs

Features โ€ข Demo โ€ข Installation โ€ข Usage โ€ข Tech Stack โ€ข Contributing


โœจ Features

๐ŸŽจ Beautiful UI/UX

  • ๐ŸŒ“ Dark/Light Mode - Seamless theme switching with custom dark blue palette
  • ๐Ÿ“ฑ Fully Responsive - Works flawlessly on desktop, tablet, and mobile
  • ๐ŸŽญ Smooth Animations - Elegant transitions and fade-in effects
  • ๐ŸŽฏ Modern Design - Clean, intuitive interface with gradient accents

๐Ÿ’ฌ Chat Functionality

  • ๐Ÿ—จ๏ธ Multiple Chat Sessions - Create and manage unlimited conversations
  • ๐Ÿ” Search Chats - Quickly find previous conversations
  • ๐Ÿ“ Message History - Full conversation context maintained
  • โšก Real-time Responses - Instant AI replies with typing indicators
  • ๐Ÿ—‘๏ธ Delete Chats - Easy cleanup of unwanted conversations

๐Ÿš€ Technical Features

  • ๐Ÿค– Local LLM - Runs completely offline using Ollama (no API costs!)
  • ๐Ÿ’พ Persistent Storage - SQLite database for chat history
  • ๐Ÿ”„ REST API - Clean Django REST Framework backend
  • โš›๏ธ Modern Frontend - React 19 with hooks and functional components
  • ๐Ÿ“ฆ State Management - React Query for efficient data fetching

๐Ÿ› ๏ธ Tech Stack

Frontend

  • โš›๏ธ React 19.2.0 - Modern UI library
  • ๐ŸŽจ Tailwind CSS 4.0 - Utility-first CSS framework
  • ๐Ÿ”€ React Router 7.9 - Client-side routing
  • ๐Ÿ”„ TanStack Query 5.90 - Data fetching and caching
  • ๐ŸŽญ Lucide React - Beautiful icon library
  • โšก Vite 7.2 - Lightning-fast build tool

Backend

  • ๐Ÿ Django 5.1 - High-level Python web framework
  • ๐Ÿ”Œ Django REST Framework 3.15 - Powerful API toolkit
  • ๐Ÿ—„๏ธ SQLite - Lightweight database
  • ๐Ÿฆ™ LangChain - LLM application framework
  • ๐Ÿค– Ollama - Local LLM runtime

AI Model

  • ๐Ÿฆ™ Llama 2 - Meta's open-source language model
  • ๐Ÿ’ป Runs Locally - No internet required after setup
  • ๐Ÿ”’ Private - Your data never leaves your machine
  • ๐Ÿ’ฐ Free - No API costs or rate limits

๐Ÿ“ฆ Installation

Prerequisites

  • ๐Ÿ Python 3.10+
  • ๐Ÿ“ฆ Node.js 18+
  • ๐Ÿบ Homebrew (macOS)
  • ๐Ÿค– Ollama

1๏ธโƒฃ Clone the Repository

git clone https://github.com/Yirmeyahuu/Askium.git
cd Askium

2๏ธโƒฃ Backend Setup

# Navigate to backend
cd backend

# Create virtual environment
python -m venv virt
source virt/bin/activate  # On Windows: virt\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Run migrations
python manage.py migrate

# Start Django server
python manage.py runserver

3๏ธโƒฃ Frontend Setup

# Navigate to frontend (in a new terminal)
cd frontend

# Install dependencies
npm install

# Start development server
npm run dev

4๏ธโƒฃ Install Ollama & Model

# Install Ollama
brew install ollama

# Start Ollama service
brew services start ollama

# Pull Llama 2 model (in a new terminal)
ollama pull llama2

# Verify installation
ollama list

๐Ÿš€ Usage

  1. Start all services:

    # Terminal 1: Django backend
    cd backend && python manage.py runserver
    
    # Terminal 2: React frontend
    cd frontend && npm run dev
    
    # Terminal 3: Ollama (if not running as service)
    ollama serve
  2. Open your browser:

    http://localhost:5173
    
  3. Start chatting!

    • Click "New Chat" to create a conversation
    • Type your message and press Enter
    • Switch between light/dark mode with the theme toggle
    • Search through your chat history
    • Delete unwanted conversations

๐Ÿ“ Project Structure

llm-chatbot/
โ”œโ”€โ”€ backend/                  # Django backend
โ”‚   โ”œโ”€โ”€ chats/               # Chat app
โ”‚   โ”‚   โ”œโ”€โ”€ models.py        # Database models
โ”‚   โ”‚   โ”œโ”€โ”€ views.py         # API endpoints
โ”‚   โ”‚   โ”œโ”€โ”€ serializers.py   # Data serialization
โ”‚   โ”‚   โ””โ”€โ”€ utils.py         # Ollama integration
โ”‚   โ”œโ”€โ”€ llmproject/          # Project settings
โ”‚   โ””โ”€โ”€ requirements.txt     # Python dependencies
โ”‚
โ”œโ”€โ”€ frontend/                # React frontend
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ components/      # React components
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ Sidebar.jsx  # Chat list sidebar
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ ChatRoom.jsx # Chat interface
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ ThemeToggle.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ context/         # React context
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ ThemeContext.jsx
โ”‚   โ”‚   โ”œโ”€โ”€ services/        # API services
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ api.js
โ”‚   โ”‚   โ”œโ”€โ”€ App.jsx          # Main app component
โ”‚   โ”‚   โ””โ”€โ”€ App.css          # Global styles
โ”‚   โ””โ”€โ”€ package.json         # Node dependencies
โ”‚
โ””โ”€โ”€ README.md               # You are here!

๐ŸŽฏ API Endpoints

Method Endpoint Description
GET /api/sessions/ List all chat sessions
POST /api/sessions/new/ Create new chat session
GET /api/sessions/:id/ Get specific chat session
POST /api/sessions/:id/ Send message to chat
DELETE /api/sessions/:id/ Delete chat session

๐ŸŽจ Customization

Change AI Model

Edit backend/chats/utils.py:

llm = Ollama(
    model="mistral",  # or "llama3.2", "codellama", etc.
    base_url="http://localhost:11434",
    temperature=0.7
)

Modify Theme Colors

Edit frontend/src/App.css:

@theme {
  --color-dark-blue-950: #your-color;
}

Adjust AI Temperature

Higher = more creative, Lower = more focused

temperature=0.7  # Range: 0.0 to 1.0

๐Ÿ› Troubleshooting

Ollama Connection Issues

# Check if Ollama is running
ollama list

# Restart Ollama service
brew services restart ollama

# Or start manually
ollama serve

Port Already in Use

# Backend (Django)
python manage.py runserver 8001

# Frontend (Vite)
npm run dev -- --port 5174

Database Issues

cd backend
python manage.py migrate
python manage.py makemigrations

๐Ÿ“ License

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


๐ŸŒŸ Acknowledgments


Project Link: https://github.com/Yirmeyahuu/Askium.git

About

Built an AI chatbot application powered by local LLMs.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

โšก