Skip to content

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 site closed.

License

alexsky177/chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 = "";

➥ If you want to change system_message - const system_message = "You are a smart robot!"; - change it. By changing this setting, you can adapt this application to your needs.

➥ 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. Added context. So GPT remember your last questions.

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 site closed.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published