Ollama开发使用教程和常用命令

创建日期:2024-06-21
更新日期:2025-05-15

官方网站:Ollama

模型下载:Ollama Search

开源项目:ollama/ollama: Get up and running with Llama 3.3, DeepSeek-R1, Phi-4, Gemma 3, Mistral Small 3.1 and other large language models.

API文档:ollama/docs/api.md at main · ollama/ollama

Ollama Model File:ollama/docs/modelfile.md at main · ollama/ollama

Ollama菜鸟教程:Ollama 教程 ~| 菜鸟教程

使用教程

Ollama运行DeepSeek R1

使用Open WebUI在浏览器中访问Ollama(类似DeepSeek官网效果)

使用Ollama实现工具调用的原理及Python代码实现

常用命令

1、查看帮助。

ollama --help

返回

Large language model runner

Usage:
  ollama [flags]
  ollama [command]

Available Commands:
  serve       Start ollama
  create      Create a model from a Modelfile
  show        Show information for a model
  run         Run a model
  stop        Stop a running model
  pull        Pull a model from a registry
  push        Push a model to a registry
  list        List models
  ps          List running models
  cp          Copy a model
  rm          Remove a model
  help        Help about any command

Flags:
  -h, --help      help for ollama
  -v, --version   Show version information

Use "ollama [command] --help" for more information about a command.

2、列出本地已经下载的模型。

ollama list

3、运行模型。

模型仓库:Ollama Search

从模型仓库找到所需模型,上面有对应的运行命令。例如:

ollama run deepseek-r1:7b

如果模型不存在,会自动下载。

4、查看模型详细信息。

ollama show deepseek-r1:7b

5、删除模型。

ollama rm deepseek-r1:7b

转载请注明转自www.hylab.cn,原文地址:Ollama开发使用教程和常用命令

网站简介

一个来自三线小城市的程序员开发经验总结。