{"id":13463996,"url":"https://github.com/orhanerday/ChatGPT","last_synced_at":"2025-03-25T09:31:25.258Z","repository":{"id":91792523,"uuid":"603475081","full_name":"orhanerday/ChatGPT","owner":"orhanerday","description":"ChatGPT AI Supported - ChatGPT clone is a simple web application powered by the OpenAI library and built with PHP. It allows users to chat with an AI language model that responds in real-time. Chat history is saved using cookies, and the project requires the use of an API key and enabled SQLite3.","archived":false,"fork":false,"pushed_at":"2023-12-07T12:00:31.000Z","size":71,"stargazers_count":294,"open_issues_count":2,"forks_count":80,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-22T02:53:53.032Z","etag":null,"topics":["php"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/orhanerday.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-02-18T16:18:52.000Z","updated_at":"2025-03-17T13:33:34.000Z","dependencies_parsed_at":"2023-12-07T13:24:40.272Z","dependency_job_id":null,"html_url":"https://github.com/orhanerday/ChatGPT","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orhanerday%2FChatGPT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orhanerday%2FChatGPT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orhanerday%2FChatGPT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orhanerday%2FChatGPT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orhanerday","download_url":"https://codeload.github.com/orhanerday/ChatGPT/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245435176,"owners_count":20614853,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php"],"created_at":"2024-07-31T14:00:31.852Z","updated_at":"2025-03-25T09:31:25.225Z","avatar_url":"https://github.com/orhanerday.png","language":"JavaScript","funding_links":["https://www.buymeacoffee.com/orhane"],"categories":["Awesome PHP Open AI Projects"],"sub_categories":[],"readme":"# ChatGPT Clone\n\nChatGPT clone is a simple web application powered by the OpenAI library and built with PHP. It allows users to chat with an AI language model that responds in real-time. Chat history is saved using cookies, and the project requires the use of an API key and enabled SQLite3.\n\n## Prerequisites\nBefore running this project, you should have the following:\n\n* PHP 7.4 or later with SQLite3 enabled\n* Composer\n* An OpenAI API key (which should be set to the $open_ai_key variable in event-stream.php)\nGetting Started\n\n## Get Started\n\n### Enable sqlite3\n\n* Open the php.ini file. This file is usually located in the PHP installation directory.\n* Find the following line: ;extension=php_sqlite3.dll\n* Remove the semicolon at the beginning of the line to uncomment it.\n* Save the file.\n* Restart the web server.\n\n* ### Clone this repository to your local machine\n```sh\ngit clone https://github.com/orhanerday/ChatGPT.git\n```\n* ### Navigate to the project directory\n```sh\ncd ChatGPT\n```\n* ### Install OrhanErday/OpenAI\n```sh\ncomposer require orhanerday/open-ai\n```\n\n* ### Set your OpenAI API key as the `$open_ai_key` variable in `event-stream.php`\n```php\n$open_ai_key = \"\"; \n```\n\n* ### Start the PHP built-in web server\n```sh\nphp -S localhost:8000 -t .\n```\n* ### Open your web browser and go to http://localhost:8000\n\n* ### You should now see the ChatGPT clone interface, where you can chat with the OpenAI language model.\n\n\u003chr\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n![ezgif-1-92e240a6d3](https://user-images.githubusercontent.com/22305274/220125119-ccbdb855-bdb9-476f-8f5f-f5d5530f0a24.gif)\n\n\u003c/div\u003e\n\nThis project is a ChatGPT clone that allows users to chat with an AI language model trained by OpenAI. It's powered by the github.com/orhanerday/OpenAI php library, which provides an easy-to-use interface for communicating with the OpenAI API.\n\n![Image](https://user-images.githubusercontent.com/22305274/219878523-6d8be435-35df-4cce-b2cd-52334f9e7f12.png)\n\n### Live Demo Video\n\u003cbr\u003e\n\nhttps://user-images.githubusercontent.com/22305274/219877050-e5237734-4635-46f8-bf49-71a26356e0db.mp4\n\n# Important Notice\nThis project was created to highlight the [Stream Example](https://github.com/orhanerday/open-ai#stream-example) feature of [OpenAI GPT-3 Api Client in PHP by Orhan Erday](https://github.com/orhanerday/open-ai), please don't have too high expectations about the project.\n\n## Donation\n\n\u003ca href=\"https://www.buymeacoffee.com/orhane\" target=\"_blank\"\u003e\u003cimg src=\"https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png\" alt=\"Buy Me A Coffee\" style=\"height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;\" \u003e\u003c/a\u003e\n\n## Join our discord server\n\n![Discord Banner 2](https://discordapp.com/api/guilds/1047074572488417330/widget.png?style=banner2)\n\n[Click here to join the Discord server](https://discord.gg/xpGUD528XJ)\n\n## GPT-4\nChange model at `event-stream.php`\n```php\n....\n$chat = $open_ai-\u003echat([\n    'model' =\u003e 'gpt-4',\n\n....\n```\n\n## Using Docker\n\u003chr\u003e\n\n\u003e #### Method I\n\n#### Clone this repository to your local machine\n```sh\ngit clone https://github.com/orhanerday/ChatGPT.git\n```\n#### Navigate to the project directory\n```sh\ncd ChatGPT\n```\n#### Build the image\n```shell\ndocker build -t chatgpt .\n```\n#### Run the app\n```shell\ndocker run -p 8000:8000 -e OPENAI_API_KEY=sk-o7hL4nCDcjw chatgpt\n```\n#### Open your web browser and go\n\nhttp://localhost:8000\n\u003chr\u003e\n\n\u003e #### Method II\n\n### *Or* you can use docker hub without cloning or building;  \n\n#### Pull the image from Docker Hub\n\n```shell\ndocker pull orhan55555/chatgpt\n```\n\n#### Run the app\n```shell\ndocker run -p 8000:8000 -e OPENAI_API_KEY=sk-o7hL4nCDcjw orhan55555/chatgpt\n```\n#### Open your web browser and go\n\nhttp://localhost:8000\n\u003chr\u003e\n\n## Chat History\nThis project saves chat history using cookies by default. If you want to change this to use authentication instead, you can modify the code in index.php to save chat history in a database or other storage mechanism.\n\n## Credits\nThis project is powered by the github.com/orhanerday/OpenAI php library, which provides an easy-to-use interface for communicating with the OpenAI API.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forhanerday%2FChatGPT","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forhanerday%2FChatGPT","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forhanerday%2FChatGPT/lists"}