{"id":15717579,"url":"https://github.com/lcary/local-chatgpt-app","last_synced_at":"2026-05-06T22:09:56.909Z","repository":{"id":211136573,"uuid":"728278493","full_name":"lcary/local-chatgpt-app","owner":"lcary","description":"Local ChatGPT model and UI running on macOS","archived":false,"fork":false,"pushed_at":"2023-12-07T02:15:10.000Z","size":8,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-06T00:42:36.103Z","etag":null,"topics":["browser-app","chat-application","chatbot","chatgpt","chatgpt-api","local-development","macos","macos-app","openai","openai-api","web-application","web-ui"],"latest_commit_sha":null,"homepage":"","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/lcary.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":"2023-12-06T15:51:43.000Z","updated_at":"2024-05-19T08:05:14.000Z","dependencies_parsed_at":"2023-12-19T01:52:44.005Z","dependency_job_id":null,"html_url":"https://github.com/lcary/local-chatgpt-app","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"7e816f1a4cccbc71f3074e4c179ce65f405e6228"},"previous_names":["lcary/local-chatgpt-app"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lcary%2Flocal-chatgpt-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lcary%2Flocal-chatgpt-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lcary%2Flocal-chatgpt-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lcary%2Flocal-chatgpt-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lcary","download_url":"https://codeload.github.com/lcary/local-chatgpt-app/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246380740,"owners_count":20767895,"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":["browser-app","chat-application","chatbot","chatgpt","chatgpt-api","local-development","macos","macos-app","openai","openai-api","web-application","web-ui"],"created_at":"2024-10-03T21:50:35.420Z","updated_at":"2026-05-06T22:09:51.876Z","avatar_url":"https://github.com/lcary.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# local-chatgpt-app\n\nA complete LLM ChatBot UI and server, all running on your laptop (tested on macOS):\n\n```mermaid\ngraph LR;\n    subgraph laptop [Your Laptop Environment]\n    ChatBot[ChatBot UI] -- HTTP --\u003e LLM[LLM Web Server];\n    end\n```\n\n - Runs a ChatGPT-like LLM (e.g. Llama 2) locally (using [llama-cpp-python](https://github.com/abetlen/llama-cpp-python))\n - Runs a ChatGPT-like UI/app locally (using [chainlit](https://github.com/Chainlit/chainlit))\n\n## Setup\n\nThis loosely follows the setup steps from https://llama-cpp-python.readthedocs.io/en/latest/install/macos/.\n\n### Python Version\n\nThis code has been tested on Python version 3.9.16. [Pyenv](https://github.com/pyenv/pyenv) is a great way to\ninstall Python.\n\n### Python Library Installation\n\nSet up a virtual environment and install Python requirements:\n\n```\npython -m venv venv \u0026\u0026 source venv/bin/activate\npip install -r requirements.txt\n```\n\n### Model Download\n\nModel download command:\n```\nhuggingface-cli download \\\n    TheBloke/Llama-2-7B-Chat-GGUF \\\n    llama-2-7b-chat.Q5_K_M.gguf \\\n    --local-dir ./models/llama-7b-chat/ \\\n    --local-dir-use-symlinks False\n```\n\nThis model file format (GGUF) is used for running LLM inference on macOS.\nTo use a different model:\n 1. Update the above download command to use a different huggingface repo\n    and filename (must be in [GGUF](https://huggingface.co/models?sort=modified\u0026search=gguf) format).\n 3. Update the `run-server.sh` script's `MODEL` variable with the path to the `.gguf` file after download.\n\n## Usage\n\n### Model Server\n\nIn one terminal, activate the virtualenv and run the model server with:\n```\n./run-server.sh\n```\n\nThis will run the Llama 7B chat model inference server (by default on port 8000).\n\n### Chat UI\n\nIn another terminal, activate the virtualenv and run the UI with:\n```\n./run-ui.sh\n```\n\nThis will open a ChatGPT-like UI in your browser using Chainlit (by default on port 8001),\nconnected to the inference server.\n\n## Troubleshooting\n\n### Llama Library File Override\n\nIt may be necessary to run the `llama_cpp.server` with an override configured for `LLAMA_CPP_LIB`\nto the path of the `.dylib` file created in the environment by the `llama-cpp-python` package.\nThis can be found by running `find /path/to/venv -name '*.dylib'` in your venv (or Conda env).\nAttempting to build the llama C++ from scratch using https://github.com/ggerganov/llama.cpp resulted in\na segmentation fault for me when running the `llama_cpp.server` module, so the library override\nusing a pre-built library file seems to be more stable.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flcary%2Flocal-chatgpt-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flcary%2Flocal-chatgpt-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flcary%2Flocal-chatgpt-app/lists"}