Artificial Intelligence has become increasingly accessible thanks to local LLM runtimes such as Ollama and frameworks like LangChain. In this project, I built a desktop AI chatbot using Python and Tkinter, allowing users to interact with local language models through a simple graphical interface.
This application provides a lightweight desktop experience for chatting with AI models running locally through Ollama. The chatbot is powered by LangChain and features a clean Tkinter-based user interface.
Users can:
Interact with local AI models through a desktop application
Switch between different Ollama models
Enter multi-line prompts
View conversations in a chat-style interface
Run AI models entirely on their local machine
Because the models run locally, no external API keys or cloud services are required.
Python serves as the foundation of the application and handles the GUI, model communication, and application logic.
Tkinter provides the desktop interface, making the chatbot simple to run on Windows, macOS, and Linux without additional UI frameworks.
LangChain simplifies communication with language models and provides a structured way to manage prompts and responses.
Ollama allows large language models to run locally on your machine, enabling private and offline AI interactions.
All conversations are processed locally through Ollama, helping improve privacy and reduce dependency on cloud services.
Users can choose from any installed Ollama model, making it easy to experiment with different LLMs.
Popular options include:
Llama 3
Mistral
Gemma
Phi
DeepSeek
The chatbot uses a Tkinter Text widget, allowing users to submit longer prompts and structured questions.
Messages are displayed in a conversational format with visual distinction between user prompts and AI responses.
A virtual environment is recommended to isolate project dependencies.
Create a virtual environment:
python -m venv venv
Activate the environment:
venv\Scripts\activate
source venv/bin/activate
Install required packages:
pip install -U langchain-ollama
Download and install Ollama from the official website.
Verify the installation:
ollama --version
Download a model:
ollama pull llama3
View installed models:
ollama list
Start the chatbot using:
python main.py
After launching the application:
Select an available AI model.
Enter a question or prompt.
Press Ctrl + Enter or click Ask.
Review the AI-generated response in the conversation window.
Building this project demonstrated how powerful local AI development has become. By combining Ollama, LangChain, and Tkinter, it is possible to create a fully functional desktop AI assistant without relying on cloud APIs or subscription-based services.
The project also highlights how traditional desktop applications can integrate modern AI capabilities while remaining lightweight and easy to distribute.
The complete source code is available in the project's GitHub repository.
Masoud
June 16th, 2026