{"id":25648892,"url":"https://github.com/groovybits/consciouschat","last_synced_at":"2025-02-23T13:37:37.848Z","repository":{"id":200061123,"uuid":"704973724","full_name":"groovybits/consciousChat","owner":"groovybits","description":"Create AI emulations of consciousness","archived":false,"fork":false,"pushed_at":"2023-10-24T08:42:15.000Z","size":587,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-10-25T01:24:23.500Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/groovybits.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-14T17:05:09.000Z","updated_at":"2023-10-25T01:24:23.501Z","dependencies_parsed_at":null,"dependency_job_id":"f164e280-d3a8-404d-b1fb-ef8f1049e6b5","html_url":"https://github.com/groovybits/consciousChat","commit_stats":null,"previous_names":["groovybits/consciouschat"],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groovybits%2FconsciousChat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groovybits%2FconsciousChat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groovybits%2FconsciousChat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groovybits%2FconsciousChat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/groovybits","download_url":"https://codeload.github.com/groovybits/consciousChat/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240322320,"owners_count":19783219,"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":"2025-02-23T13:37:37.339Z","updated_at":"2025-02-23T13:37:37.822Z","avatar_url":"https://github.com/groovybits.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"```\nCompletely local LLM TTS Stable Diffusion Chatbot that speaks/writes any language with images and subtitles.\n\nMultispeaker LLM locally with TTS all free if run locally. GPT-3.5 LLM Twitch bot streamer.\n\nChris Kennedy (C) The Groovy Organization Apache License\n\n```\n# Conscious Chat: Local Free to run 24/7 Multispeaker/Multi-lingual LLM with TTS Twitch Bot!\n\nThis chatbot, developed by Chris Kennedy of The Groovy Organization, creates an engaging conversation environment through the use of multispeaker Language Models (LLM) and Text-to-Speech (TTS) technology. The goal of the project is to foster multi-user interactions among multiple AI entities, creating a Game of Life-like phenomenon for human entertainment and question answering.\n\nTry it at [Groovy AI Bot on Twitch](https://twitch.com/groovyaibot) to see it in action!\n\nThis project is licensed under the Apache License. You can use it to build your Twitch AI chatbot empire.\n\n## Features\n\n- **Multispeaker LLM**: Engage in conversation with AI entities possessing unique personalities.\n- **Text-to-Speech (TTS)**: Hear responses audibly, adding a layer of realism to the interaction.\n- **Customizable Personalities**: Tailor the personality of AI and user entities to your liking.\n- **Local Execution**: All functionalities are available for free when run locally.\n- **Auto Generate Responses**: The chatbot can automatically generate responses without requiring manual input.\n- **Stop on New Line**: The conversation can be configured to pause when a new line is detected.\n- **Stochastic Token Generation**: The chatbot can generate a variable number of tokens per response, making the conversation feel more dynamic and natural.\n- **Stream Speak**: Streams the conversation per `tokenstospeak` value instead of speaking at new lines.\n- **Episode Mode**: Enables the output to follow a TV episode script format.\n- **Multi-Lingual**: Ability to speak in most languages on output text and voice (if uroman.pl is installed).\n- **Webpage Retrieval**: Ability to look up all URLs in prompt and load up the LLM context with the summary + store them locally for future fast retrieval.\n- **Twitch Bot**: Ability to have twitch users interact with the conversation via Twitch chatrooms and an OBS. Future output will be direct to twitch as video.\n- **User History**: Bot has knowlege of users past questions to build up a context and impression of them.\n- **Stable Diffusion Images**: Images from output speaker lines, 6-10 a minute + capable with tokens driving generation by sentence chunking.\n- **Hard Subtitle**: Subtitles synced with audio speaking voice and image generation.\n\n## TODO\n\n- Prompt template usage for cleaning up the prompt and making it standard.\n- Document retrieval from PDFs, Json, Text files for Context injection.\n- Female TTS model voices.\n- Document retrieval tuning of settings, speed up if possible.\n- Background Music generation.\n- Persistent chat history between sessions.\n- Multiple models running simultaneously each as a personality chatting with other running models and sharing context and history.\n- News context injection for news reporting and seeding story generation without human interaction.\n- Storage of sessions in a DB (long-term, not a priority).\n- Generate a video in HLS or MpegTS format to stream out and push up to YouTube.\n- 3D Model control for characters vtuber type Blender models controlled by text generation and image generation.\n- Timing metrics\n- Many Many odds and ends, fixups and optimizations.\n\n## Recommended Models\n\n- TTS: [facebook/mms-tts-eng](https://huggingface.co/facebook/mms-tts-eng)\n    - https://huggingface.co/docs/transformers/main/en/model_doc/vits More details on config options\n    - More information: [Meta AI Launches Massively Multilingual Speech MMS Project](https://www.marktechpost.com/2023/05/30/meta-ai-launches-massively-multilingual-speech-mms-project-introducing-speech-to-text-text-to-speech-and-more-for-1000-languages/)\n    - Research paper: https://arxiv.org/abs/2106.06103\n- LLM: [TheBloke/zephyr-7B-alpha-GGUF](https://huggingface.co/TheBloke/zephyr-7B-alpha-GGUF)\n    - More information: https://news.ycombinator.com/item?id=37842618\n- Summarization:\n    - https://huggingface.co/kunaltilaganji/Abstractive-Summarization-with-Transformers\n- Embeddings: LLama.cpp is slow\n    - https://huggingface.co/Aryanne/OpenLlama-Platypus-3B-gguf\n    - https://platypus-llm.github.io/\n\n## Setup and Usage\n\n### Prerequisites\n\n- Python 3.x\n- Python framework for llama.cpp from https://github.com/abetlen/llama-cpp-python\n- Install the required packages from `requirements.txt` with pip:\n- Uroman Perl program https://github.com/isi-nlp/uroman.git (if wanting multi-lingual speaking in more than English)\n    - Set the path to uroman.pl, where you cloned it to: \"export UROMAN=`pwd`/uroman/bin\".\n    - Use the \"-ro\" option to romanize the TTS speaking text.\n- Optional Japanese font like [Noto-Sans-JP](https://fonts.google.com/noto/specimen/Noto+Sans+JP?noto.query=jp) using the -jf \u003cfont_path\u003e option.\n    - Use -ro -jf \u003cjapanese_font\u003e to allow japanese speaking and subtitles to work. \n\n```bash\n# Development SDK on Mac OS X\n\n# Python3 path set on Mac OS X to SDK tools\n\n# Install OpenSSL on Mac OS X so Python doesn't complain\nbrew install openssl\n\n# Portaudio on Mac OS X\nbrew install portaudio\n\n# setup Python virtual environment\npip install virtualenv\npython -m venv consciousChat\nsource consciousChat/bin/activate\n\n# Install required dependency python3 packages\npip install -r requirements.txt\n\n# Run program\n./characterChat.py\n\n# Stop env and clean it up\ndeactivate\n```\n\n### Running the Chatbot\n\nYou can initiate a chat session by running the `characterChat.py` script from your terminal:\n\n```bash\n./characterChat.py [options]\n```\n\n#### Options\n\n```plaintext\nusage: characterChat.py [-h] [-l LANGUAGE] [-pd PERSISTDIRECTORY] [-m MODEL] [-em EMBEDDINGMODEL] [-ag] [-ss] [-tts TOKENSTOSPEAK]\n                        [-aittss AITTSSEED] [-usttss USTTSSEED] [-mtts MINTOKENSTOSPEAK] [-q QUESTION] [-un USERNAME]\n                        [-up USERPERSONALITY] [-ap AIPERSONALITY] [-an AINAME] [-asr AISPEAKINGRATE] [-ans AINOISESCALE]\n                        [-apr AISAMPLINGRATE] [-usr USERSPEAKINGRATE] [-uns USERNOISESCALE] [-upr USERSAMPLINGRATE] [-sts STOPTOKENS]\n                        [-ctx CONTEXT] [-mt MAXTOKENS] [-gl GPULAYERS] [-t TEMPERATURE] [-d] [-dd] [-s] [-ro] [-e]\n                        [-pc PROMPTCOMPLETION] [-re ROLEENFORCER] [-sd] [-udb URLSDB] [-cdb CHATDB] [-ectx EMBEDDINGSCONTEXT]\n                        [-ews EMBEDDINGWINDOWSIZE] [-ewo EMBEDDINGWINDOWOVERLAP] [-eds EMBEDDINGDOCSIZE] [-hctx HISTORYCONTEXT]\n                        [-im IMAGEMODEL] [-ns] [-tw] [-gu] [-si] [-ll LOGLEVEL] [-ars AUDIOPACKETREADSIZE] [-ren] [-wi WIDTH]\n                        [-he HEIGHT] [-as]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -l LANGUAGE, --language LANGUAGE\n                        Have output use another language than the default English for text and speech. See the -ro option and uroman.pl\n                        program needed.\n  -pd PERSISTDIRECTORY, --persistdirectory PERSISTDIRECTORY\n                        Persist directory for Chroma Vector DB used for web page lookups and document analysis.\n  -m MODEL, --model MODEL\n                        File path to model to load and use. Default is models/zephyr-7b-alpha.Q8_0.gguf\n  -em EMBEDDINGMODEL, --embeddingmodel EMBEDDINGMODEL\n                        File path to embedding model to load and use. Use a small simple one to keep it fast. Default is\n                        models/q4-openllama-platypus-3b.gguf\n  -ag, --autogenerate   Keep autogenerating the conversation without interactive prompting.\n  -ss, --streamspeak    Speak the text as tts token count chunks.\n  -tts TOKENSTOSPEAK, --tokenstospeak TOKENSTOSPEAK\n                        When in streamspeak mode, the number of tokens to generate before sending to TTS text to speech.\n  -aittss AITTSSEED, --aittsseed AITTSSEED\n                        AI Bot TTS 'Seed' to fix the voice models speaking sound instead of varying on input. Set to 0 to allow\n                        variance per line spoken.\n  -usttss USTTSSEED, --usttsseed USTTSSEED\n                        User Bot TTS 'Seed' to fix the voice models speaking sound instead of varying on input. Set to 0 to allow\n                        variance per line spoken.\n  -mtts MINTOKENSTOSPEAK, --mintokenstospeak MINTOKENSTOSPEAK\n                        Minimum number of tokens to generate before sending to TTS text to speech.\n  -q QUESTION, --question QUESTION\n                        Question to ask initially, else you will be prompted.\n  -un USERNAME, --username USERNAME\n                        Your preferred name to use for your character.\n  -up USERPERSONALITY, --userpersonality USERPERSONALITY\n                        Users (Your) personality.\n  -ap AIPERSONALITY, --aipersonality AIPERSONALITY\n                        AI (Chat Bot) Personality.\n  -an AINAME, --ainame AINAME\n                        AI Character name to use.\n  -asr AISPEAKINGRATE, --aispeakingrate AISPEAKINGRATE\n                        AI speaking rate of TTS speaking.\n  -ans AINOISESCALE, --ainoisescale AINOISESCALE\n                        AI noisescale for TTS speaking.\n  -apr AISAMPLINGRATE, --aisamplingrate AISAMPLINGRATE\n                        AI sampling rate of TTS speaking, do not change from 16000!\n  -usr USERSPEAKINGRATE, --userspeakingrate USERSPEAKINGRATE\n                        User speaking rate for TTS.\n  -uns USERNOISESCALE, --usernoisescale USERNOISESCALE\n                        User noisescale for TTS speaking.\n  -upr USERSAMPLINGRATE, --usersamplingrate USERSAMPLINGRATE\n                        User sampling rate of TTS speaking, do not change from 16000!\n  -sts STOPTOKENS, --stoptokens STOPTOKENS\n                        Stop tokens to use, do not change unless you know what you are doing!\n  -ctx CONTEXT, --context CONTEXT\n                        Model context, default 32768.\n  -mt MAXTOKENS, --maxtokens MAXTOKENS\n                        Model max tokens to generate, default unlimited or 0.\n  -gl GPULAYERS, --gpulayers GPULAYERS\n                        GPU Layers to offload model to.\n  -t TEMPERATURE, --temperature TEMPERATURE\n                        Temperature to set LLM Model.\n  -d, --debug           Debug in a verbose manner.\n  -dd, --doubledebug    Extra debugging output, very verbose.\n  -s, --silent          Silent mode, No TTS Speaking.\n  -ro, --romanize       Romanize LLM output text before input into TTS engine.\n  -e, --episode         Episode mode, Output an TV Episode format script.\n  -pc PROMPTCOMPLETION, --promptcompletion PROMPTCOMPLETION\n                        Prompt completion like... Question: {user_question} Answer:\n  -re ROLEENFORCER, --roleenforcer ROLEENFORCER\n                        Role enforcer statement with {user} and {assistant} template names replaced by the actual ones in use.\n  -sd, --summarizedocs  Summarize the documents retrieved with a summarization model, takes a lot of resources.\n  -udb URLSDB, --urlsdb URLSDB\n                        SQL Light retrieval URLs DB file location.\n  -cdb CHATDB, --chatdb CHATDB\n                        SQL Light DB Twitch Chat file location.\n  -ectx EMBEDDINGSCONTEXT, --embeddingscontext EMBEDDINGSCONTEXT\n                        Embedding Model context, default 512.\n  -ews EMBEDDINGWINDOWSIZE, --embeddingwindowsize EMBEDDINGWINDOWSIZE\n                        Document embedding window size, default 256.\n  -ewo EMBEDDINGWINDOWOVERLAP, --embeddingwindowoverlap EMBEDDINGWINDOWOVERLAP\n                        Document embedding window overlap, default 25.\n  -eds EMBEDDINGDOCSIZE, --embeddingdocsize EMBEDDINGDOCSIZE\n                        Document embedding window overlap, default 4096.\n  -hctx HISTORYCONTEXT, --historycontext HISTORYCONTEXT\n                        User history context stored and sent to the LLM, default 8192.\n  -im IMAGEMODEL, --imagemodel IMAGEMODEL\n                        Stable Diffusion Image Model to use.\n  -ns, --nosync         Don't sync the text with the speaking, output realtiem.\n  -tw, --twitch         Twitch mode, output to twitch chat.\n  -gu, --geturls        Get URLs from the prompt and use them to retrieve documents.\n  -si, --saveimages     Save images to disk.\n  -ll LOGLEVEL, --loglevel LOGLEVEL\n                        Logging level: debug, info...\n  -ars AUDIOPACKETREADSIZE, --audiopacketreadsize AUDIOPACKETREADSIZE\n                        Size of audio packet read/write\n  -ren, --render        Render the output to a GUI OpenCV window for playback viewing.\n  -wi WIDTH, --width WIDTH\n                        Width of rendered window, only used with -ren\n  -he HEIGHT, --height HEIGHT\n                        Height of rendered window, only used with -ren\n  -as, --ascii          Render ascii images\n```\n\n## Contributing\n\nFeel free to fork the project, open a PR, or submit issues with suggestions, corrections, or improvements.\n\nFor more information, please contact Chris Kennedy at The Groovy Organization.\n\n## License\n\nThis project is under the Apache License and is maintained by Chris Kennedy of The Groovy Organization.\n\n## Try it out!\n\nEmbark on a journey of interactive conversations, rich auditory experiences, and explore the realms of AI-human interactions with Conscious Chat.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgroovybits%2Fconsciouschat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgroovybits%2Fconsciouschat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgroovybits%2Fconsciouschat/lists"}