AI Assitant

I recently came across an intriguing video1 titled “Creating J.A.R.V.I.S. powered by GROQ and Python,” which showcased the seamless construction of an AI system using external components. The video left me inspired and sparked the question: could a similar system be built and run locally with comparable performance?

To put this concept to the test, I embarked on the journey of creating my own “J.A.R.V.I.S”2 or “HAL 9000”3 inspired system that operates locally. The challenge was set: could I achieve the functionalities of these iconic AI assistants without relying on online APIs?

Drawing inspiration from the aforementioned video, I utilized code snippets for the interface and key components. However, to ensure local operation, I replaced online APIs with alternative tools. Here’s a breakdown of the components I used:

LLM Interface: Leveraging Kobold.cpp4 lite to run a 7B model due to constraints on my local machine’s processing power. Speech-to-Text Interface: Implemented using whisper.cpp5 with a base model. Text-to-Speech: Integrated pyttsx3 for text-to-speech conversion. After tweaking the code and making the necessary connections, I successfully created a locally-operating system that mimicked the functionality of “J.A.R.V.I.S” and “HAL 9000.” The debug output revealed a promising outcome.

S2T:  Tell me a joke.
 [ Silence ]

Answer is: A blind man walks into a bar with a seeing eye dog named Buddy. The bartender looks at them and says, "What'll you have?" The blind man replies, "I'll have a beer, but get whatever Buddy wants on his tab."
T2S: output.wav
127.0.0.1 - - [13/Apr/2024 21:17:53] "POST /process-audio HTTP/1.1" 200 -
S2T:  What is 2 plus 2?

Answer is: Answer: 4
T2S: output.wav
127.0.0.1 - - [13/Apr/2024 21:18:18] "POST /process-audio HTTP/1.1" 200 -

The response time was adequate and speech recognition was good.

Moving forward, several areas can be enhanced in this project:

Optimization: Fine-tuning the system for improved performance and efficiency. Expansion: Adding new features and capabilities to enhance the user experience. Customization: Allowing users to personalize the system according to their preferences.

The potential applications for such a system are vast:

Personal Assistant: Assisting users with daily tasks, reminders, and information retrieval. Home Automation: Controlling smart devices and creating a seamless smart home experience. Learning Tool: Facilitating educational purposes through interactive sessions and information dissemination.

I am eager to hear your thoughts on this project! Do you see any other applications or have suggestions for improvements? Feel free to share your feedback in the comments section below. Let’s continue to explore the possibilities of local AI systems together.

Image: “AI assistant powered by J.A.R.V.I.S and HAL 9000, 3600x300px” Made with Designer. Powered by DALL·E 3.