使用ollama + webui 运行任意大模型

安装ollama 

https://hub.docker.com/r/ollama/ollama

docker run -d -v ~/Documents/work/softs/docker/ollama:/root/.ollama -p 11434:11434 --name ollama ollama/ollama

验证安装

# 进入容器
 docker exec -it ollama bash
# 运行大模型
ollama run llama2
# 发送请求(会有很多输出,一直到结束)
curl http://localhost:11434/api/generate -d '{
  "model": "llama2",
  "prompt":"Why is the sky blue?"
}'

可以选择其支持的模型列表GitHub - ollama/ollama: Get up and running with Llama 2, Mistral, Gemma, and other large language models.

安装webui

GitHub - open-webui/open-webui: User-friendly WebUI for LLMs (Formerly Ollama WebUI)

# host.docker.internal == 127.0.0.1  主要是mac下docker 不支持127.0.0.1
docker run -d -p 3000:8080 -e OLLAMA_BASE_URL=http://host.docker.internal:11434 -v ~/Documents/work/softs/docker/open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main

验证安装

访问http://127.0.0.1:3000,开始对话

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-03-20 22:10:02       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-03-20 22:10:02       100 阅读
  3. 在Django里面运行非项目文件

    2024-03-20 22:10:02       82 阅读
  4. Python语言-面向对象

    2024-03-20 22:10:02       91 阅读

热门阅读

  1. 机器学习的专业术语 和 各种技巧

    2024-03-20 22:10:02       36 阅读
  2. Python中的异常处理

    2024-03-20 22:10:02       47 阅读
  3. 前端-ES6箭头函数以及带来的好处

    2024-03-20 22:10:02       45 阅读
  4. Linux 学习笔记(18)完结

    2024-03-20 22:10:02       38 阅读
  5. cloudfoundry搭建jenkins

    2024-03-20 22:10:02       45 阅读
  6. python非常优秀的图结构处理框架

    2024-03-20 22:10:02       47 阅读
  7. 不规则数组

    2024-03-20 22:10:02       43 阅读
  8. C语言:htoi十六进制转十进制

    2024-03-20 22:10:02       43 阅读
  9. 100道面试必会算法-07-用 Rand7() 实现 Rand10()

    2024-03-20 22:10:02       49 阅读