An intelligent chatbot with context memory, emotional awareness, and question-answering capabilities that runs on local hardware. Cooper stands for Conversational Office Organizer and Personal Entertainment Robot.
I cannot guarantee this will run for you on your own machine. This is still an alpha project, and I plan to provide better instructions for replication as well as a graphical model replacement of the robot (a 3D face, basically) so the robot will not be required to run this. Also, with the online mode, it may run on more diverse hardware. Also, the Larynx docker server is customized by me; it is almost ready to place here and is coming soon as of May 2 2023. These scripts will not run without my custom Larynx server scripts; as of May-3-23 I am more focused on developing COOPER and adding features than worrying about reproducibility and it probably won't run for you. But a version everyone can use IS COMING!!! :-)
Fixed COOPER's lip syncing! It is not perfect. But it does sync to a good degree, mostly accurately! I think the limitations come from the robot hardware- the lip sync starts off well aligned and gets worse as it speaks longer (the longer the response, the more apparent this is) I have also added an online mode - the offline mode was always intended as a backup or alternative to spending money on API calls (and will continue being developed further as an important part of COOPER). COOPER now uses the gpt-3.5-turbo model using the OpenAI API for much improved intelligence and response times. Make no mistake about it though - COOPER is still COOPER, with the same cheeky attitude!
Connects to expressive robot which syncs mouth movements with language model output

Robot speaks using Larynx running in a Docker container. Github link
Robot intuitively listens for speech and does it's best to take turns. Speech recognition is done using Whisper ASR model(s) by OpenAI running in a Docker container. Github link
Main Language Model: Using the Pygmalion-6B model with 6-billion parameters. Inference working (albeit slowly) on single-node (desktop PC with 64GB RAM+ RTX 2080 Super 8GB VRAM) by utilizing Deepspeed Zero-3 inference with parameter offloading augmented by Huggingface Accelerate launcher.
Bot has several internal summarizers (which will be better utilized in future updates) for the purpose of assisting in understanding conversational context. Very basic context management currently. Current ability includes topic identification and conversation summarization.
Multiple model size choices for efficient utilization on a variety of hardware. This will receive many changes in upcoming updates.
More efficient hardware utilization!!
A complex and swiftly evolving plan for context understanding and real-time synthesis of contextual information. A VERY preliminary idea-map can be seen here 
This will include an integration of a variety of low-compute classifier steps. Not only will this allow for better understanding of context and the ability to gauage appropriateness of responses, it will also allow for performance improvement by passing certain narrow-domain tasks to much smaller fine-tuned text generation models. New classification steps which may lead to different models or different prompting may include: a. Sentiment analysis of input b. Sentiment analysis of output c. Emotional classification of output d. Emotional classification of output e. Intent prediction of input, including task identification (tasks to be defined later) f. Statement vs Question classification g. Natural language inference of outputs (and possibly inputs). h. Check for math problems in the input i. Emotional analysis of audible speech inputs j. Checking outputs for toxicity and appropriateness k. Identify relations between entities, topics l. Identify user sentiment about entities, topics
Generating questions based on inputs or context. This will be triggered by various things, such as emotion detection, task commands that require clarification, and hypothesis consistency as determined by natural language inference models.
Image generation on command, using Stable-Diffusion based on user input prompts as enhanced by SD prompt generation models. To be displayed on device screen.
Face tracking. The ability to follow a face as the robot speaks to the user. This would ideally include visual speaker identification and differentiation between speakers. This will be a work in progress.
Object recognition. Will be able to visually identify and verbally confirm object names.
Visual action detection, for identification of user actions, to support context understanding.
Image captioning models for visual context understanding.
Facial recognition for recognition of specific users.
Visual question answering. The ability to answer questions posed by users using vision-language models.
Detect and solve math problems, even when stated as word problems.
Search the Internet.
Home control tasks.
Ability to generate and tell stories.
Ability to play a variety of games (as yet undetermined, one possibility is chess). Mad libs? Hangman? Trivia?
A variety of fine-tuned expert models for various narrow-domain functions.
Better model choices in general
8-bit quantization (of at least some models) to reduce memory footprint
- Internal Dialogue: While currently compute resources force this one onto a backburner, in the future I would like to experiment with giving the bot it's own internal (context-aware) dialogue. According to my research, this may produce a convincing simulation of real-time awareness (assuming the compute is sufficient to run in real time!)
- Larger Models: Currently, my compute availability limits development involving the use of larger models. However, I would very much like to make this system scalable to any level of (minimally sufficient) hardware and cloud VMs so that capability can scale (in an automatic way) with the available hardware. So that the larger the hardware it is plugged into, the more intelligent the bot will be.
He can see!:
Long Demo Video:
Knowledge Retrieval:
Unexpected Behaviors:
72 commits
1 commits
Python
98.8%
Dockerfile
1.1%
An intelligent chatbot with context memory, emotional awareness, and question-answering capabilities that runs on local hardware. Cooper stands for Conversational Office Organizer and Personal Entertainment Robot.
I cannot guarantee this will run for you on your own machine. This is still an alpha project, and I plan to provide better instructions for replication as well as a graphical model replacement of the robot (a 3D face, basically) so the robot will not be required to run this. Also, with the online mode, it may run on more diverse hardware. Also, the Larynx docker server is customized by me; it is almost ready to place here and is coming soon as of May 2 2023. These scripts will not run without my custom Larynx server scripts; as of May-3-23 I am more focused on developing COOPER and adding features than worrying about reproducibility and it probably won't run for you. But a version everyone can use IS COMING!!! :-)
Fixed COOPER's lip syncing! It is not perfect. But it does sync to a good degree, mostly accurately! I think the limitations come from the robot hardware- the lip sync starts off well aligned and gets worse as it speaks longer (the longer the response, the more apparent this is) I have also added an online mode - the offline mode was always intended as a backup or alternative to spending money on API calls (and will continue being developed further as an important part of COOPER). COOPER now uses the gpt-3.5-turbo model using the OpenAI API for much improved intelligence and response times. Make no mistake about it though - COOPER is still COOPER, with the same cheeky attitude!
Connects to expressive robot which syncs mouth movements with language model output

Robot speaks using Larynx running in a Docker container. Github link
Robot intuitively listens for speech and does it's best to take turns. Speech recognition is done using Whisper ASR model(s) by OpenAI running in a Docker container. Github link
Main Language Model: Using the Pygmalion-6B model with 6-billion parameters. Inference working (albeit slowly) on single-node (desktop PC with 64GB RAM+ RTX 2080 Super 8GB VRAM) by utilizing Deepspeed Zero-3 inference with parameter offloading augmented by Huggingface Accelerate launcher.
Bot has several internal summarizers (which will be better utilized in future updates) for the purpose of assisting in understanding conversational context. Very basic context management currently. Current ability includes topic identification and conversation summarization.
Multiple model size choices for efficient utilization on a variety of hardware. This will receive many changes in upcoming updates.
More efficient hardware utilization!!
A complex and swiftly evolving plan for context understanding and real-time synthesis of contextual information. A VERY preliminary idea-map can be seen here 
This will include an integration of a variety of low-compute classifier steps. Not only will this allow for better understanding of context and the ability to gauage appropriateness of responses, it will also allow for performance improvement by passing certain narrow-domain tasks to much smaller fine-tuned text generation models. New classification steps which may lead to different models or different prompting may include: a. Sentiment analysis of input b. Sentiment analysis of output c. Emotional classification of output d. Emotional classification of output e. Intent prediction of input, including task identification (tasks to be defined later) f. Statement vs Question classification g. Natural language inference of outputs (and possibly inputs). h. Check for math problems in the input i. Emotional analysis of audible speech inputs j. Checking outputs for toxicity and appropriateness k. Identify relations between entities, topics l. Identify user sentiment about entities, topics
Generating questions based on inputs or context. This will be triggered by various things, such as emotion detection, task commands that require clarification, and hypothesis consistency as determined by natural language inference models.
Image generation on command, using Stable-Diffusion based on user input prompts as enhanced by SD prompt generation models. To be displayed on device screen.
Face tracking. The ability to follow a face as the robot speaks to the user. This would ideally include visual speaker identification and differentiation between speakers. This will be a work in progress.
Object recognition. Will be able to visually identify and verbally confirm object names.
Visual action detection, for identification of user actions, to support context understanding.
Image captioning models for visual context understanding.
Facial recognition for recognition of specific users.
Visual question answering. The ability to answer questions posed by users using vision-language models.
Detect and solve math problems, even when stated as word problems.
Search the Internet.
Home control tasks.
Ability to generate and tell stories.
Ability to play a variety of games (as yet undetermined, one possibility is chess). Mad libs? Hangman? Trivia?
A variety of fine-tuned expert models for various narrow-domain functions.
Better model choices in general
8-bit quantization (of at least some models) to reduce memory footprint
- Internal Dialogue: While currently compute resources force this one onto a backburner, in the future I would like to experiment with giving the bot it's own internal (context-aware) dialogue. According to my research, this may produce a convincing simulation of real-time awareness (assuming the compute is sufficient to run in real time!)
- Larger Models: Currently, my compute availability limits development involving the use of larger models. However, I would very much like to make this system scalable to any level of (minimally sufficient) hardware and cloud VMs so that capability can scale (in an automatic way) with the available hardware. So that the larger the hardware it is plugged into, the more intelligent the bot will be.
He can see!:
Long Demo Video:
Knowledge Retrieval:
Unexpected Behaviors:
72 commits
1 commits
Python
98.8%
Dockerfile
1.1%