How to Fix Error: model not found. Run 'ollama pull' first (Ollama)
Quick Answer: This error occurs when Ollama tries to load or run a model that has not been downloaded to your local machine yet. The fastest fix is to open your terminal and run the command 'ollama pull <model-name>' to download the required model.
What Causes This Error
- The requested model has never been downloaded or pulled onto your local machine.
- A typo exists in the model name specified in your configuration file, API request, or command-line argument.
- The Ollama service is pointing to a different directory or home path where models are not stored.
- A recent update or reinstallation cleared out the local model storage directory.
Step-by-Step Fixes
Fix 1: Fix 1: Pull the Missing Model
Open your terminal or command prompt.,Run the command 'ollama list' to check which models are currently available locally.,Run 'ollama pull <model-name>' (e.g., 'ollama pull llama3' or 'ollama pull mistral') to download the model.
Fix 2: Fix 2: Verify Model Name and Tags
Check your application code, configuration file, or CLI command for spelling mistakes in the model name.,Ensure you include the correct version tag if required (e.g., 'phi3:mini' instead of just 'phi3').,Visit the official Ollama library website to verify the exact spelling and available tags for the model.
Fix 3: Fix 3: Restart the Ollama Service
Quit the Ollama application completely from your system tray or task manager.,Relaunch Ollama to ensure it refreshes its local registry and background daemon.,Retry running your prompt or application command.
Advanced Fixes
Advanced Fix 1: Advanced: Configure Custom OLLAMA_MODELS Directory
If your models are stored in a non-standard location, set the OLLAMA_MODELS environment variable to point to that directory.,On Linux/macOS, run 'export OLLAMA_MODELS=/path/to/your/models' before starting Ollama.,On Windows, set the OLLAMA_MODELS system environment variable via the System Properties panel.
FAQs
Q: Where does Ollama store downloaded models by default?
A: By default, Ollama stores models in '~/.ollama/models' on Linux/macOS and '%USERPROFILE%\.ollama\models' on Windows.
Q: Can I use Ollama models offline after running 'ollama pull'?
A: Yes. Once a model is successfully pulled, Ollama runs entirely locally and does not require an active internet connection.