pmcbride / chatgpt-clone-js

Javascript ChatGPT clone. JavaScript only - no need php, python ... etc. Easily installed on any web server and localhost. Only 1 file to setup. You can see the demo site below. Demo have limit 300 tokens.

Home Page:https://autofm.ru/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ChatGPT - JavaScript clone

Version ChatGPT 3.5 turbo, 3.5 turbo 0301.
Version GPT 4 has not been tested yet.

chatgpt

➥ Download ZIP or use git command.

➥ Get your OpenAi key - https://platform.openai.com/account/api-keys

➥ Open config.js and fill const strIndex = "YOUR_API_KEY";

➥ If you want to change path - const path = "/chat"; - change it. For root use const path = "";

// const root = "."; This parameter need if you use app in the root or localhost - delete slashes.

➥ Make path /chat or any other on your web server.

➥ Upload files to this directory.

➥ Type in the browser your address https://your-website.com/chat/ and enjoy.

➥ Also you can use Obfuscator to hide your api key for security reason.
https://codebeautify.org/javascript-obfuscator

Used frontpage html, js and css from this project (with some mods)
https://github.com/xtekky/chatgpt-clone

Used Javascript Openai api request
https://www.builder.io/blog/stream-ai-javascript

All functions are preserved, except for the web search - instead, a change in theme from dark to light has been made. Added temperature change function.

Run on localhost

This program runs on a laptop or desktop computer locally from a folder.

How to install localhost

Read this stackoverflow solution
https://stackoverflow.com/questions/38497334/how-to-run-html-file-on-localhost

You can use Node.js or Python server.

How to install app on Pyton:

  1. Install Pyton - https://www.python.org
  2. Сreate a directory chat.
  3. Change const path in config.js to path = "";.
  4. Change const root in config.js to root = "."; ( just delete //).
  5. Put index.html and assets files here.
On the Windows command line or in the Mac terminal, type
cd chat
then
python -m http.server
  • Open in browser http://192.168.1.52:8000/
  • Also you can use http://127.0.0.1:8000/
  • Or this address http:/localhost:8000/

Use app on your local computer.

chatgpt

Last update - added convertations.
Removed all php files.
Changed path for assets files.

About

Javascript ChatGPT clone. JavaScript only - no need php, python ... etc. Easily installed on any web server and localhost. Only 1 file to setup. You can see the demo site below. Demo have limit 300 tokens.

https://autofm.ru/

License:GNU General Public License v3.0


Languages

Language:CSS 43.0%Language:JavaScript 41.4%Language:HTML 15.6%