{"id":16182778,"url":"https://github.com/brianhuster/chatbot_web","last_synced_at":"2025-04-07T12:41:43.900Z","repository":{"id":219024312,"uuid":"747971066","full_name":"brianhuster/chatbot_web","owner":"brianhuster","description":null,"archived":false,"fork":false,"pushed_at":"2024-01-25T03:21:32.000Z","size":36474,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-13T15:23:14.174Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/brianhuster.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,"roadmap":null,"authors":null}},"created_at":"2024-01-25T02:05:33.000Z","updated_at":"2024-05-05T01:32:42.000Z","dependencies_parsed_at":"2024-01-25T03:35:42.410Z","dependency_job_id":null,"html_url":"https://github.com/brianhuster/chatbot_web","commit_stats":null,"previous_names":["brianhuster/chatbot_web"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianhuster%2Fchatbot_web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianhuster%2Fchatbot_web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianhuster%2Fchatbot_web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brianhuster%2Fchatbot_web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brianhuster","download_url":"https://codeload.github.com/brianhuster/chatbot_web/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247655084,"owners_count":20974117,"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":[],"created_at":"2024-10-10T06:43:56.236Z","updated_at":"2025-04-07T12:41:43.877Z","avatar_url":"https://github.com/brianhuster.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Running the Chat Application\n\nThis guide will help you run the chat application contained in the `index.html` file.\n\n## Prerequisites\n\nEnsure you have the following:\n\n- A modern web browser (Chrome, Firefox, Safari, etc.)\n- A local web server (like Python's SimpleHTTPServer, Node's http-server, etc.). Or you can use Live Server feature from VSCode\n- An API key from OpenAI for API access. Or a laptop/PC with \u003e8GB RAM\n\n## Start the app using OpenAI API\n\n1. **Set up the API key**\n\nOpen the `index.html` file and locate the following line:\n\n```html\nconst chatGPTKey = 'sk-'; // Paste the API key here\n```\n\nReplace `'sk-*****'` with your actual OpenAI GPT-3 API key.\n\n2. **Start the local server**\n\nNavigate to the directory containing `index.html` and start your local server. For example, if you're using Python's SimpleHTTPServer, you can start it with the command:\n\n```bash\npython -m SimpleHTTPServer\n```\n\nIf you're using Node's http-server, you can start it with the command:\n\n```bash\nhttp-server\n```\n\n3. **Access the application**\n\nOpen your web browser and navigate to localhost on the port your server is running. For example, if your server is running on port 8000, you would navigate to `http://localhost:8000`.\n\n4. **Interact with the chat application**\n\nYou should now see the chat interface in your browser. You can type messages into the input field and press \"Send\" to interact with the chatbot.\n\nPlease note that this is a simple setup meant for local development and testing. It is not suitable for a production environment.\n\n## Start the app using Local API\n\n1. **Download model**\n\nCreate a folder named `models`, then download `mistral-7b-openorca.Q4_0.gguf` from here \u003chttps://huggingface.co/Open-Orca/Mistral-7B-OpenOrca\u003e and put into the `models` folder. You can choose any other gguf models from huggingface instead of mistral-7b-openorca.Q4_0.gguf, as long as it is not too heavy to run on your computer. \n\nOr you can download a model from here https://terabox.com/s/1M2Zx-OJFzXHg9K-uMHo36A. All of them are tested, and can be run on such a low-end computer with CPU intel core i5, RAM 8GB and no NVIDIA GPU. \n\n2. **Install llama_cpp Python**\n\nFollow the guide here to install llama_cpp Python \u003chttps://github.com/abetlen/llama-cpp-python\u003e\n\n3. **Run local OpenAI server**\n\nRun the following script to run an OpenAI API server locally. The server should run at port 8000\n\n```bash\npython3 -m llama_cpp.server --model \"./models/{{model_file_name}}\" --chat_format chatml --n_gpu_layers 1\n```\n\n4. **Update chat application code**\n\nOpen the `index.html` file and locate the following line\n\n```html\n  // Real GPT\n  // const OPEN_AI_ENDPOINT = 'https://api.openai.com/v1' // Comment this line\n\n  // Security, do not deploy this in production\n  const chatGPTKey = 'sk-*****'; // Create an API key from here\n\n  // Local GPT\n  const OPEN_AI_ENDPOINT = 'http://localhost:8000/v1' // Uncomment this line\n```\n\nRun the application again. It should use localhost for local API inteference.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianhuster%2Fchatbot_web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrianhuster%2Fchatbot_web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrianhuster%2Fchatbot_web/lists"}