Local model interaction
Integrated an Ollama-hosted Qwen model into a Python-driven assistant with typed conversation and command handling.
A local-first AI assistant built to bring language models, conversational memory, speech recognition, and spoken responses into one practical desktop experience.
A Python application developed and tested on a Windows desktop, using a virtual environment for dependencies.
Locally hosted language-model inference, with development and performance testing on an NVIDIA RTX 2070 (8 GB).
Text-based commands, Whisper-powered speech recognition, text-to-speech output, and a persistent memory workflow.
AI assistants are often experienced as remote chat services. Project Eli explores what changes when an assistant runs on personal hardware and the developer controls its behavior, voice interface, memory, and safeguards. My goal is to develop a usable application while gaining hands-on experience integrating AI components into a complete software system.
The assistant connects user input to a Python application layer, which coordinates local model inference, optional speech processing, and memory retrieval or storage.
Integrated an Ollama-hosted Qwen model into a Python-driven assistant with typed conversation and command handling.
Added a memory workflow that can store information explicitly provided by the user and reuse it during later interactions.
Connected speech recognition and text-to-speech functionality. Device selection, playback behavior, and transcription responsiveness have required repeated troubleshooting.
Exploring distinct configurations for personal experimentation and potential wider release, including stronger boundaries for harmful requests and context-sensitive handling of satire.
Microphone enumeration and Windows audio backends produced invalid-device and stream errors during testing. Debugging involved inspecting available inputs, testing headset and webcam microphones, and adjusting device selection.
Voice interaction introduced latency, recognition interruptions, and a text-to-speech issue where only the first reply was spoken. Iterative changes improved follow-up speech playback; smooth end-to-end voice interaction remains an active focus.
Working with a local 8B model required attention to available GPU memory, drivers, inference setup, and performance tradeoffs. This work connects model deployment with practical desktop hardware constraints.
Persistent memory and adjustable safeguards introduce questions about what should be stored, how users should control behavior, and how an assistant should distinguish benign context from risky instructions. These remain design priorities as the prototype evolves.
Set up Python, a virtual environment, Ollama, and the local Qwen model.
Established typed interaction and command discovery, including an in-app help workflow.
Added explicit memory storage and retrieval behavior for user-provided information.
Integrated speech tools and addressed audio input selection and repeated-response playback issues.
Continue refining voice performance and safety behavior, document the setup, and add verified screenshots or a demo when ready.
Connecting model inference, application logic, speech tools, hardware interfaces, and persistent data into a single workflow.
Isolating issues across drivers, audio devices, Python dependencies, GPU configuration, and application state.
Testing real interactions, diagnosing failures, and using the results to improve the application.
Considering privacy, local execution, user control, and safeguards early in the design process.
Two short excerpts from Eli’s Python application.
The handler recognizes “remember” commands, extracts the fact, and sends it to Eli’s memory module. Returning True tells the conversation loop that the command has been handled.
def handle_memory_command(user_input):
lower_input = user_input.lower()
if lower_input.startswith('remember that '):
memory = user_input[len('remember that '):].strip()
if memory:
save_memory('user', memory)
print("Eli: I'll remember that.")
return True
if lower_input.startswith('remember '):
memory = user_input[len('remember '):].strip()
if memory:
save_memory('user', memory)
print("Eli: I'll remember that.")
return True
return FalseFrom main_eli_anti_repeat.py; formatting condensed. save_memory is imported from Eli’s memory module.
Before generating a reply, Eli refreshes the system prompt with the computer’s local date, time, and timezone. This gives the model a current clock reference instead of leaving it to infer the date from its training data.
f"\nCurrent Windows local date/time: {datetime.now().astimezone().strftime('%A, %B %d, %Y at %I:%M %p %Z (%z)')}. "
"Treat this as the authoritative current date and time, not your training cutoff. "Clock portion of the per-message prompt in generate_response, from main_eli_anti_repeat.py.
The next step is to timestamp user messages and saved conversation context, calculate the actual gap since the last message, and supply that gap alongside the current time. Retaining the topic and its original timestamp would let Eli return to an idea after a break without treating minutes as days or an old conversation as something that just happened.
My next priorities are conversation continuity that accounts for time between messages, smoother voice conversations, better memory retrieval, and printer and scanner commands. Longer term, I want Eli to provide on-demand help while I’m gaming.