What to know
- Microsoft’s Phi-3 is a small but powerful AI model that you can run locally on Windows.
- Install Ollama, then run the command
ollama run phi3
on a terminal app (like CMD). Once phi-3 is downloaded, you’ll be able to chat with the AI within the terminal itself. - You can also use a software like LM Studio for a graphical interface to chat with Phi-3 locally. Download the Phi-3 guff file separately and save it within LM Studio’s directory. Then load the model within LM Studio and start chatting with Phi-3 on Windows locally.
Microsoft’s Phi-3 family of language models are finally here. For their size, they’re definitely a class apart and are already proving much better than other recently released models like Llama 3 and Mixtral on many fronts. Thanks to its tiny size, Phi-3 can easily run on your Windows PC locally. Here’s how you can do so using Ollama and LM Studio.
How to run Microsoft’s Phi-3 on Windows using Ollama
Ollama is a software framework that lets you run and experiment with LLMs. Here’s how to use it to run Microsoft’s Phi-3 on Windows locally.
Step 1: Download and install Ollama
Firstly, let’s download and install Ollama. Here’s how:
- Ollama for Windows | Download Link
- Use the link mentioned above and click on Download for Windows (Preview).
- Once downloaded, run the setup file.
- Click on Install and install Ollama.
Step 2: Run Phi-3 command and download the LLM
Next, let’s download the Phi-3 model using Ollama.
- Open Ollama.com and click on Models.
- Scroll down and click on phi3. If you don’t see it at first, you can search for it as well.
- Here, copy the command to download phi3.
- Next, open the Command Prompt (or any terminal app of your choice) from the Start menu.
- Here, paste the copied command.
- Hit Enter and wait for Phi-3 to download on your machine.
- Once you see the “Send a message” message, you’re ready to start chatting with the model locally.
Step 3: Start chatting with Microsoft’s Phi-3 LLM
You can start chatting within the terminal app itself. Simply type a prompt and hit Enter. Here are a few areas we tested the model in.
Testing censorship resistance
Testing understanding of complex topics
Testing for hallucinations
Testing for creativity
How to run Microsoft’s Phi-3 on Windows using LM Studio
If you don’t like chatting with Microsoft’s Phi-3 on Windows using your terminal app and would rather have a dedicated interface for it, there’s nothing better than LM Studio. Here’s how to set up Phi-3 on LM Studio and start chatting with the model locally.
Step 1: Install LM Studio
- LM Studio | Download link
- Use the link above and click on LM Studio for Windows to download it.
- Once downloaded, run the installer and let the LM Studio install.
Step 2: Download Phi-3 gguf file
You won’t be able to search for and download Phi-3 from within LM Studio itself. You’ll need to get the Phi-3 guff file separately. Here’s how:
- Phi-3-Mini Guff file | Download Link
- Use the link given above and click on Files.
- Here, you’ll find two versions of the Phi-3 model. Select one. For our purposes, we’re selecting the smaller version.
- Click on Download.
- Then save it in a convenient location.
Step 3: Load the Phi-3 model
Next, we’re going to load the downloaded Phi-3 model. Follow the steps to do so:
- Open LM Studio and click on My Models on the left.
- Take note of the ‘Local models folder’. This is where we need to move the downloaded Phi-3 guff file. Click on Show in File Explorer to open the directory.
- Here, create a new folder titled Microsoft.
- Within the Microsoft folder, create another folder titled Phi-3.
- Paste the downloaded Phi-3 guff file within the Phi-3 folder.
- Once you’ve moved the Phi-3 guff file, it will appear in the LM Studio as well.
You may need to restart LM Studio for it to recognize Phi-3 in its directory. - To load the Phi-3 model, click on the AI Chat option on the left.
- Click on Select a model to load.
- And select the Phi-3 model.
- Wait for it to load. Once done, you can start chatting with Phi-3. However, we recommend offloading the model to the GPU so your CPU doesn’t come under undue pressure. To do so, under ‘System Prompt’ on the right, click on Advanced Configuration > Hardware Settings.
- Under ‘GPU Acceleration’, click on Max.
- Click on Reload model to apply configuration.
- Once the model loads, you can start chatting with Phi-3.
Step 4: Start chatting with Microsoft’s Phi-3 LLM
And that’s about it. Go ahead and enter a prompt. Regardless of whether or not you have an internet connection, you’ll now be able to chat with Microsoft’s Phi-3 model on your Windows PC locally.
FAQ
Let’s consider a few commonly asked questions about running Microsoft’s Phi-3 locally on your Windows PC.
How to fix Ollama stuck at downloading Phi-3?
If you encounter issues downloading Phi-3 via Ollama on the command prompt, simply enter the command ollama run phi3
again. The download will resume from the point where it was struck before.
We hope this guide helped you run Microsoft’s Phi-3 model locally on your Windows PC via Ollama and LM Studio. Until next time!
Discussion