A local command-line AI chatbot inspired by K-2SO from Star Wars. It uses Ollama to run a local language model and aims for a dry, sarcastic, witty personality while retaining conversational context.
- Local inference through Ollama; no hosted AI API key is required for the local workflow
- Conversational memory during a session
- K-2SO-inspired sarcastic and dry responses
- Command-line interface
- Help and clear-memory commands
- Python 3
- Ollama installed and running
- A model available in Ollama (the examples below use
llama3)
Clone the actual repository and install the Python dependencies:
git clone https://github.com/PrithwishDas101/K-2SO.git
cd K-2SO
pip install -r requirements.txtIn one terminal, start the model:
ollama run llama3Keep Ollama running. In another terminal, start the chatbot:
python main.pyIf the code is configured for a different Ollama model, pull that model and use its exact name instead.
/help— show available commands/clear— clear conversation memoryexit— leave the chatbot
You: hi
K-2SO: Finally, someone to talk to. I was starting to think it was just me and those dull droids out here.
The Python application sends prompts to the local Ollama service and prints the generated response in the terminal. The model runs on your machine, so response speed and memory usage depend on your hardware and the model you choose.
- Make sure Ollama is installed and its service is running before launching the script.
- Confirm the selected model has been downloaded with
ollama list. - If the chatbot cannot connect, check that Ollama is reachable at its configured local address.
- Install dependencies from
requirements.txtin the same Python environment used to runmain.py.
A personal local-AI project by Prithwish Das.