{"id":28135494,"url":"https://github.com/reprompts/lightchat","last_synced_at":"2026-03-06T19:06:52.376Z","repository":{"id":292308325,"uuid":"979574275","full_name":"Reprompts/lightchat","owner":"Reprompts","description":"LightChat is a lightweight GPT-2–based toolkit built on top of DistilGPT2. It enables anyone to train, deploy, and interact with a custom chatbot on low‑end devices using simple CLI commands","archived":false,"fork":false,"pushed_at":"2025-05-09T07:47:12.000Z","size":7,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-09T08:38:31.549Z","etag":null,"topics":["ai","artificial-intelligence","artificial-neural-networks","beginner-friendly","chatbot","chatbots","chatgpt","chatgpt-api","gpt","machine-learning","machinelearning","open-source","pip","pypi","python","python3"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/lightchat/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Reprompts.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-07T18:16:14.000Z","updated_at":"2025-05-09T07:47:16.000Z","dependencies_parsed_at":"2025-05-09T08:53:48.191Z","dependency_job_id":null,"html_url":"https://github.com/Reprompts/lightchat","commit_stats":null,"previous_names":["reprompts/lightchat"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Reprompts%2Flightchat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Reprompts%2Flightchat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Reprompts%2Flightchat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Reprompts%2Flightchat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Reprompts","download_url":"https://codeload.github.com/Reprompts/lightchat/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254170140,"owners_count":22026223,"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","artificial-intelligence","artificial-neural-networks","beginner-friendly","chatbot","chatbots","chatgpt","chatgpt-api","gpt","machine-learning","machinelearning","open-source","pip","pypi","python","python3"],"created_at":"2025-05-14T15:18:58.035Z","updated_at":"2026-03-06T19:06:52.286Z","avatar_url":"https://github.com/Reprompts.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LightChat\r\n\r\n![Downloads](https://static.pepy.tech/badge/lightchat/month)  \r\n\r\nLightChat is a lightweight GPT-2–based toolkit built on top of DistilGPT2. It enables anyone to train, deploy, and interact with a custom chatbot on low‑end devices using simple CLI commands.\r\n\r\n\r\n## 🌐 Links \u0026 Community\r\n\r\n- 🔗 GitHub Repository: [github.com/reprompts/lightchat](https://github.com/reprompts/lightchat)\r\n- 💼 LinkedIn Group: [LightChat Dev Group](https://www.linkedin.com/groups/14631875/)\r\n- 📰 Dev.to Profile: [@repromptsquest](https://dev.to/repromptsquest)\r\n- 🐦 Twitter: [@repromptsquest](https://twitter.com/repromptsquest)\r\n\r\n\r\n\r\n---\r\n\r\n## 🔧 Features\r\n\r\n* **Train** your own language model on plain text files\r\n* **Chat** interactively with your fine‑tuned model\r\n* **List** \u0026 **delete** saved models\r\n* Supports **top‑k** and **top‑p** (nucleus) sampling\r\n\r\n---\r\n\r\n## 📋 Dataset Preparation\r\n\r\n* Provide a **plain text** file (`.txt`) with **one sentence per line**.\r\n* Aim for at least **1,000–10,000 lines** for reasonable results on CPU.\r\n* Clean, focused content yields better chat relevance.\r\n\r\n**Example** (`data.txt`):\r\n\r\n```\r\nHello, how can I help you today?\r\nI love reading sci‑fi novels.\r\nWhat's the weather like?\r\n```\r\n\r\n---\r\n\r\n## ⚙️ Installation\r\n\r\n```bash\r\npip install lightchat\r\n```\r\n\r\n\u003e **⚠️ CPU install note:** Transformers and PyTorch may take several minutes to compile on CPU.\r\n\r\n---\r\n\r\n## 🚀 Training\r\n\r\n```bash\r\nlightchat train \u003cmodel_name\u003e \u003cdata.txt\u003e \\\r\n  --epochs 3 \\\r\n  --batch-size 8 \\\r\n  --learning-rate 5e-5\r\n\r\nExample Command:\r\nlightchat train newmodel data.txt --epochs 1 --batch-size 8 --learning-rate 5e-5\r\n\r\n\r\n\u003e **⚠️ Data file path \u003cdata.txt\u003e:** Give proper path to the dataset or keep dataset inside the root directory of project where library is installed.\r\n\r\n```\r\n\r\n* **model\\_name**: directory under `models/` to save to\r\n* **epochs**: full passes over your data\r\n* **batch-size**: number of samples per step\r\n* **learning-rate**: step size for optimizer\r\n\r\n\u003e **⚠️ CPU training note:** Training on CPU is slow. More epochs/bigger batch sizes = longer time but better fit.\r\n\r\n---\r\n\r\n## 💬 Chatting\r\n\r\n```bash\r\nlightchat chat \u003cmodel_name\u003e \\\r\n  --max-length 100 \\\r\n  --top-k 50 \\\r\n  --top-p 0.9 \\\r\n  --temperature 1.0\r\n\r\n\r\nExample Command:\r\nlightchat chat newmodel --max-length 100 --top-k 50 --temperature 0.9\r\n\r\n```\r\n\r\n* **max-length**: max generated tokens per reply\r\n* **top-k**: sample from top *k* tokens\r\n* **top-p**: sample from top cumulative probability *p*\r\n* **temperature**: randomness control (higher = more creative)\r\n\r\n\r\nGive \"exit\" as an prompt to the model to exit the conversation and you can load the trained models anytime by following the instructions given below. \r\n\r\n\r\n\u003e Trained models live in `models/\u003cmodel_name\u003e/`.\r\n\r\n---\r\n\r\n## 📂 Model Management\r\n\r\n* **List** saved models: `lightchat list-models`\r\n* **Delete** a model: `lightchat delete-model \u003cmodel_name\u003e`\r\n* Or manually remove `models/\u003cmodel_name\u003e/` directory.\r\n\r\n---\r\n\r\n## 🙌 Contributions\r\n\r\nContributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md).\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freprompts%2Flightchat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freprompts%2Flightchat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freprompts%2Flightchat/lists"}