Linux command
ollama 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Run a model
ollama run [llama3]
Run a model
ollama run [llama3] "[What is the capital of France?]"
List installed models
ollama list
Pull a model
ollama pull [mistral]
Show model info
ollama show [llama3]
List running models
ollama ps
Remove a model
ollama rm [model_name]
Start the API server
ollama serve
说明
ollama runs large language models locally. It handles model downloads, serving via a REST API, and interactive chat sessions. Supports a wide range of open models including Llama, Mistral, Gemma, Phi, Qwen, DeepSeek, and others. Models are pulled from the Ollama registry and cached locally. The API server provides OpenAI-compatible endpoints for chat completions, embeddings, and model management. Custom models can be created using Modelfiles that specify base models, system prompts, parameters, and adapter layers.
参数
- run _MODEL_ _PROMPT_
- Run model interactively or with a one-off prompt.
- pull _MODEL_
- Download model from registry.
- push _MODEL_
- Push model to registry.
- list (or ls)
- List locally available models.
- show _MODEL_
- Show model information (architecture, parameters, license).
- ps
- List currently running models.
- stop _MODEL_
- Stop a running model.
- rm _MODEL_
- Remove a local model.
- cp _SOURCE_ _DESTINATION_
- Copy a model locally under a new name.
- serve
- Start the Ollama API server (default port 11434).
- create _NAME_ -f _MODELFILE_
- Create a custom model from a Modelfile.
- --help
- Display help information.
FAQ
What is the ollama command used for?
ollama runs large language models locally. It handles model downloads, serving via a REST API, and interactive chat sessions. Supports a wide range of open models including Llama, Mistral, Gemma, Phi, Qwen, DeepSeek, and others. Models are pulled from the Ollama registry and cached locally. The API server provides OpenAI-compatible endpoints for chat completions, embeddings, and model management. Custom models can be created using Modelfiles that specify base models, system prompts, parameters, and adapter layers.
How do I run a basic ollama example?
Run `ollama run [llama3]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does run _MODEL_ _PROMPT_ do in ollama?
Run model interactively or with a one-off prompt.