乐闻世界logo
搜索文章和话题

How to install Ollama and what are the common commands?

2月19日 19:52

Installing Ollama is very simple and supports multiple operating systems:

macOS Installation:

bash
brew install ollama

Linux Installation:

bash
curl -fsSL https://ollama.com/install.sh | sh

Windows Installation: Download the installer from the official website and run it.

Common Commands:

  1. Run a model:
bash
ollama run llama2 ollama run mistral ollama run codellama
  1. List installed models:
bash
ollama list
  1. Download a model:
bash
ollama pull llama2
  1. Remove a model:
bash
ollama rm llama2
  1. View model information:
bash
ollama show llama2
  1. Start API service:
bash
ollama serve
  1. View logs:
bash
ollama logs

API Call Example:

bash
curl http://localhost:11434/api/generate -d '{ "model": "llama2", "prompt": "Why is the sky blue?" }'
标签:Ollama