A demonstration project showcasing local AI model deployment and interaction using Ollama.
- Python 3.10.11
- Command line interface (Terminal/CMD)
- Internet connection for initial setup
- Download the Ollama setup file from https://ollama.com/
- Run the installer and follow the installation instructions
- Verify the installation by opening your command line interface and typing:
If Ollama is properly installed, you should see the help information.
ollama
Install the required models for this demo:
ollama run mistral
ollama run llama2
ollama run llama3.2Note: Model downloads may take some time depending on your internet connection, as these are large files.
After installation, you can interact with any model directly:
ollama run mistral- Ask questions and interact with the model locally
- To exit the model interface, type
/bye
git clone [repository-url]
cd ollama-demo# Create virtual environment
python -m venv venv
# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activatepip install -r requirements.txtWith your virtual environment activated, execute the following commands:
# Run the main package
python ../../package.py
# Run sample requests
python ../../sample_requests.pyYou can create custom AI agents using Modelfiles:
ollama create [custom-name] -f [Modelfile]Replace [custom-name] with your desired agent name and [Modelfile] with the path to your Modelfile.
This demo includes the following pre-configured models:
- Mistral: A 7B parameter model optimized for instruction following
- Llama2: Meta's foundation model for general-purpose tasks
- Llama3.2: Latest version with improved performance and capabilities
- Ollama command not recognized: Ensure Ollama is properly installed and added to your system PATH
- Model download fails: Check your internet connection and available disk space
- Virtual environment issues: Ensure you've activated the virtual environment before running Python scripts
- Visit Ollama Documentation for detailed guides
- Check model-specific documentation for advanced usage
ollama-demo/
├── package.py
├── sample_requests.py
├── requirements.txt
├── README.md
└── venv/
Feel free to submit issues and enhancement requests to improve this demo.
MIT lincence
Note: This demo is designed for local development and testing. Ensure you have sufficient system resources for running large language models locally.


