Code Monkey home page Code Monkey logo

josiahbeynon / customchatgpt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gdroguski/customchatgpt

0.0 0.0 0.0 598 KB

An open-source project building a customizable ChatGPT-like clone. Built with Django and Next.js, it features chat history, streaming responses, auto-generated titles, and more. Perfect for those looking to experiment with OS AI chatbot functionalities.

License: GNU Affero General Public License v3.0

JavaScript 44.05% Python 45.66% CSS 10.29%

customchatgpt's Introduction

Custom ChatGPT - work in progress

This project is a custom-built chatbot application that mimics the functionalities of ChatGPT for personal use. It's built using Python, Django for the backend, and React with Next.js for the frontend. The application provides regular chatting capabilities with history stored in the database, streaming responses, and auto-generated titles using gpt3.5. It also allows for title editing, conversation deletion, and messages regeneration. Project currently supports model selection between gpt3.5 and gpt4. It also features a custom Django admin page for managing conversations, versions, and messages.

It is a work in progress, with plans to add more features and functionalities.

The idea behind this project is to experiment with Next.js and create a personal version of ChatGPT with custom functionalities and features.

Technologies

Backend

  • Python
  • Django
  • Django Rest Framework

Frontend

  • Next.js
  • React

Database

  • SQLite for now -> will be changed to PostgreSQL

Functionalities

  • Regular chatting with history stored in DB as well as with different versions of conversation: while regenerating messages (or editing existing ones), the new version is created for given conversation
  • Streaming responses
  • Auto generated titles using gpt3.5
  • Title edition for given conversation
  • Deletion of given conversation
  • Assistant messages regeneration
  • User messages edition
  • Models selection: currently gpt3.5 or gpt4
  • Custom django admin page for managing conversations, versions and messages

Images

Main view

main window

Streaming

streaming

Title edition

title edition

Switching versions and editing messages

switching versions and editing messages

Login page

login page

Register page

register page

Admin page

admin page

How to run this? (atm, docker-compose incoming)

  • Backend:
    • Setup environment variables in backend/.env (create file if not exists):
      • FRONTEND_URL - url of frontend app - default: http://127.0.0.1:3000
      • BACKEND_URL - url of backend app - default: http://127.0.0.1:8000
      • BE_ADMIN_EMAIL - email for django admin page - default: [email protected]
      • BE_ADMIN_PASSWORD - password for django admin page - default: admin
      • DJANGO_SECRET_KEY - django secret key
      • GPT part (currently set up for Azure endpoint):
        • OPENAI_API_TYPE: azure
        • OPENAI_API_BASE: your azure endpoint
        • OPENAI_API_VERSION: your azure api version
        • OPENAI_API_KEY: your azure api key
    • Create virtual environment and install requirements from dependencies.txt
    • Run python manage.py makemigrations and python manage.py migrate
    • Run python manage.py create_superuser for creating superuser
    • Run python manage.py create_roles for creating user and assistant roles
    • Run python manage.py collectstatic
    • Run python manage.py runserver if you want to run it in vanilla way
    • Run python server.py if you want to run it with uvicorn
  • Frontend:
    • Setup environment variables in frontend/.env.local (create file if not exists):
    • Run npm install
    • Run npm run dev
  • Go to http://127.0.0.1:3000 and enjoy!

ToDo:

  • Dockerize: docker-compose for frontend, backend and db
  • migrate to PostgreSQL <- in progress
  • add support for different LLMs:
    • Claude
    • LLaMa
  • add functionality for GUI to edit messages and switch between versions
  • add RAG subpage
  • add work with files subpage
  • add login & authorization for users
  • add registration
  • add user chats separation
  • async django rest framework views
  • add more tests

customchatgpt's People

Contributors

gdroguski avatar dependabot[bot] avatar josiahbeynon avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.