{"id":13603210,"url":"https://github.com/machaao/gpt-j-chatbot","last_synced_at":"2026-01-12T10:15:37.874Z","repository":{"id":41502707,"uuid":"486965781","full_name":"machaao/gpt-j-chatbot","owner":"machaao","description":"A GPT-J Chatbot Template for creating AI Characters (Virtual Girlfriend Chatbot, Stories, Roleplay, Replika-esque)","archived":false,"fork":false,"pushed_at":"2023-06-05T04:47:18.000Z","size":156,"stargazers_count":132,"open_issues_count":0,"forks_count":25,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-11-07T06:41:06.039Z","etag":null,"topics":["ai","android","chatbot","gpt-3","gpt-j","python"],"latest_commit_sha":null,"homepage":"https://messengerx.io","language":"Python","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/machaao.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":"2022-04-29T12:34:28.000Z","updated_at":"2024-09-24T03:11:29.000Z","dependencies_parsed_at":"2024-01-16T22:21:52.144Z","dependency_job_id":"97d01a1b-89ef-4dfc-a22a-96542897681a","html_url":"https://github.com/machaao/gpt-j-chatbot","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machaao%2Fgpt-j-chatbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machaao%2Fgpt-j-chatbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machaao%2Fgpt-j-chatbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/machaao%2Fgpt-j-chatbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/machaao","download_url":"https://codeload.github.com/machaao/gpt-j-chatbot/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248419648,"owners_count":21100213,"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":["ai","android","chatbot","gpt-3","gpt-j","python"],"created_at":"2024-08-01T18:01:57.613Z","updated_at":"2025-04-11T14:30:37.581Z","avatar_url":"https://github.com/machaao.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"## A GPT-J Powered AI Character Girlfriend Chatbot Template ##\nThe intent of this template is to serve as a quick intro guide for fellow developers \nlooking to build AI Powered Personalized Characters\n\n## Live Web Demo ##\n![figure](images/img.png)\n\n[Jeanie](https://messengerx.io/jeanie) is a GPT-J powered virtual girlfriend based on this repository\n\n## Requirements for running it locally on laptop ##\n* Windows / Mac / Linux with Git installed\n* Python 3.5+\n* MessengerX.io API Token - FREE for Indie Developers\n* Ngrok for Tunneling\n* Desktop / Laptop with a minimum of 16GB RAM \n* GPU is required for faster inference\n* EleutherAI/gpt-neo-1.3B (Be patient, first load and / or first time inference can take time)\n* NLPCloud.io Token - (Optional)\n\n  \n## Local Setup ##\n### Download or clone this repository ###\n```\ngit clone git@github.com:machaao/gpt-j-chatbot.git\n\ncd gpt-j-chatbot\n```\n\n\n### Install requirements ###\n```bash\npip install -r requirements.txt\n```\n\n### Create a new .env file in the gpt-j-chatbot directory ###\n```bash\nnano -w .env\n```\n\n```\nAPI_TOKEN = \u003cMachaao API Token\u003e\nBASE_URL = \u003cMachaao Base Url\u003e ex: https://ganglia.machaao.com\nNAME = \u003cYour Bot Display Name\u003e ex: Jess\nDASHBOT_KEY = \u003cYour dashbot token\u003e (Optional) (Conversational Analytics)\nMODEL_NAME=EleutherAI/gpt-neo-1.3B # for local inference / testing [we recommend using GPT-NEO 1.3B for 16GB ram - load can take up to 1 min and inference avg is about 10 - 20 seconds] See https://huggingface.co/EleutherAI for additional models\nNLP_CLOUD_TOKEN = \u003cNLP Cloud Token\u003e  # for faster remote inference\n\n\n# BOT PARAMS - Unset Parameters would use their default values.\n# Don't use Top_p and Temperature parameters simultaneously.\n# Default Values are mentioned below.\n# The higher this value, the less deterministic the result will be\nTOP_P=\"1.0\" \n# The higher this value, the less deterministic the result will be\nTEMPERATURE=\"0.8\"\n# The lower this value, the less likely GPT-J is going to generate off-topic text\nTOP_K=\"50\"\n# The maximum number of tokens that the generated text should contain\nMAX_LENGTH=\"50\"\n```\nFor better understanding of the above GPT-J parameters, check out the [nlpcloud.io](https://docs.nlpcloud.io/#generation) docs\n\n\n## Get MessengerX.io API Key ##\n* Get your FREE Developer API Token via [MessengerX.io](https://portal.messengerx.io), replace it in the ```.env``` file under the entry ```API_TOKEN```\n* MessengerX.io allows you to build and integrate a custom chatbot in your website or app\n\n\n## Get NLPCloud.io API Key (Recommended for Production) ##\n* You can acquire an NLPCloud API Key via [NLP Cloud](https://nlpcloud.io) and replace it in the ```.env``` file under the entry\n```NLP_CLOUD_TOKEN```\n  \n## Get Dashbot.io API KEY (Recommended for Production) ##\n* You can acquire the API Key via [Dashbot.io](https://dashbot.io) and replace it in the ```.env``` file under the entry\n```DASHBOT_KEY```\n\n### Modify logic/prompt.txt to change the character script ###\n```\nbot_name is a very understanding girl\nbot_name and stranger are seeing each other\nHere is a recent discussion between stranger and bot_name\n###\nstranger: hi\nbot_name: hello there\n```\n\n### Modify the core() function in logic/bot_logic.py to personalize responses ###\n```\ndef core(self, req: str, user_id: str):\n```\n* Refer to [platform documentation](https://messengerx.rtfd.iio) for personalization options\n\n### Run the chatbot server from the root directory of the repo ###\n```\npython app.py\n```\n\n### Start ngrok.io tunnel ###\n```\nngrok http 5000\n```\n\n### Update your webhook ###\nUpdate your bot Webhook URL at [MessengerX.io Portal](https://portal.messengerx.io) with the url provided as shown below to continue development\n```\nIf you use [Ngrok.io](https://ngrok.io), your webhook URL would be of the format as in the example below\nhttps://1234-115-187-40-104.ngrok.io/machaao/hook\n```\n![figure](https://github.com/machaao/machaao-py/raw/master/images/mx_screenshot.png?raw=true)\n\n### Test your bot:\nVisit: ```https://messengerx.io/\u003cbot-name\u003e```\n\n## Remote Setup (Heroku) ##\n\nWe are assuming you have access to a [heroku account](https://heroku.com)\nand have installed heroku command line client for your OS.\n\n### Login to Heroku ###\n```\nheroku login\n```\n\n### Create a new app on Heroku and note down your heroku app name\n```\nheroku create\n```\n\n### Commit changes and push the repository to Heroku ###\n```\ngit commit -m \".env updated\"\ngit push heroku master\n```\n\n### Open the logs to confirm successful Deployment ###\n```\nheroku logs --tail\n```\n\n### Update your webhook ###\nUpdate your bot Webhook URL at [MessengerX.io Portal](https://portal.messengerx.io) with the heroku app url\n```\nWebhook Url: \u003cYOUR-HEROKU-APP-URL\u003e/machaao/hook\n```\n\n### Test your bot:\nVisit: ```https://messengerx.io/\u003cyour-character-name\u003e```\n\n### Known Issues (on M1+ Macs)\n```\nTips for MPS on Mac [Use Nightly Build]\npip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cpu\n```\n\n- Running on MPS is unstable\n- Running on CPU is reliable but slower\n- Approx inference time \u003e 60 seconds on Mac M1 Pro 2021 / 16GB (GPT-Neo)\n\n\n## Notes / Additional Resources ##\n* Please note that this document isn't meant to be used as a guide for production environment setup.\n* Reach out to us on [Twitter](https://twitter.com/messengerxio) for any queries\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmachaao%2Fgpt-j-chatbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmachaao%2Fgpt-j-chatbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmachaao%2Fgpt-j-chatbot/lists"}