This project will show you how to setup with Ollama on Apple MacBooks and also how to run python scripts to call the Mistral or Llama2 using API.
- Visit this official Ollama Website
- Click on the "Download" Button.
- Once Ollama is downloaded on your mac. Move it to your Applications folder and run it through Spotlight search.
- Now open the terminal and type
ollama run mistral
It will take a few minutes to download and run the mistral model.
-
Once the download is done and you see ">>>", start chatting with the mistral model to see if everything is fine.
-
You can also download llama2 model by typing in your terminal
ollama run llama2
-
Some commands to interact with ollama using terminal
- To see all the downloaded models:
ollama list - To run a model:
ollama run - To delete a model:
ollama rm
- To see all the downloaded models:
Install the project by following these steps:
- Clone the repository:
git clone https://github.com/UsmanQT/Ollama-Mistral.git - Navigate to the project directory if not already. Otherwise skip this step:
cd Ollama-Mistral
To use the project, follow these steps:
-
Run the python script:
python3 mistral-ollama.py -
Enter prompt: "Hey how are you doing?"
-
You can change the model's name to "llama2" in the curl command if you wish to use llama2.
For inquiries, please contact:
- Email: usman.nja.14@gmail.com
- LinkedIn: @iusmanq