赞
踩
部署中为了尽可能减少对本地环境的污染,使用 Docker 安装!
github: https://github.com/ollama/ollama
version: '3.8' services: ollama: volumes: - ./models:/root/.ollama # 将本地文件夹挂载到容器中的 /root/.ollama 目录 (模型下载位置) container_name: ollama pull_policy: always tty: true restart: unless-stopped image: ollama/ollama:latest ports: - 11434:11434 # Ollama API 端口 open-webui: build: context: . args: OLLAMA_BASE_URL: '/ollama' dockerfile: Dockerfile image: ghcr.io/open-webui/open-webui:main container_name: open-webui volumes: - ./open-webui:/app/backend/data # 前端页面数据挂载位置 depends_on: - ollama ports: - ${OPEN_WEBUI_PORT-3005}:8080 environment: - 'OLLAMA_BASE_URL=http://ollama:11434' - 'WEBUI_SECRET_KEY=' extra_hosts: - host.docker.internal:host-gateway restart: unless-stopped
之后使用 docker compose up -d
等待一段时间之后,docker images pull 成功。即可执行下一步。
LLM 模型参考:
Model | Parameters | Size | Download |
---|---|---|---|
Llama 3 | 8B | 4.7GB | ollama run llama3 |
qwen | 4b | 2.3G | ollama run qwen:4b |
Llama 3 | 70B | 40GB | ollama run llama3:70b |
Phi-3 | 3,8B | 2.3GB | ollama run phi3 |
Mistral | 7B | 4.1GB | ollama run mistral |
Neural Chat | 7B | 4.1GB | ollama run neural-chat |
Starling | 7B | 4.1GB | ollama run starling-lm |
Code Llama | 7B | 3.8GB | ollama run codellama |
Llama 2 Uncensored | 7B | 3.8GB | ollama run llama2-uncensored |
LLaVA | 7B | 4.5GB | ollama run llava |
Gemma | 2B | 1.4GB | ollama run gemma:2b |
Gemma | 7B | 4.8GB | ollama run gemma:7b |
Solar | 10.7B | 6.1GB | ollama run solar |
这里选择最小体积且最好用的模型: llama3:4b 模型,qwen:4b 模型质量很差。
ollama3 run llama3
成功之后会看到下面这样:
root@c5e5ff20a533:/# ollama run llama3
pulling manifest
pulling 6a0746a1ec1a... 100% ▕██████████████████████████████████████████████████████████████████████████████████████████████████████████▏ 4.7 GB
pulling 4fa551d4f938... 100% ▕██████████████████████████████████████████████████████████████████████████████████████████████████████████▏ 12 KB
pulling 8ab4849b038c... 100% ▕██████████████████████████████████████████████████████████████████████████████████████████████████████████▏ 254 B
pulling 577073ffcc6c... 100% ▕██████████████████████████████████████████████████████████████████████████████████████████████████████████▏ 110 B
pulling 3f8eb4da87fa... 100% ▕██████████████████████████████████████████████████████████████████████████████████████████████████████████▏ 485 B
verifying sha256 digest
writing manifest
removing any unused layers
success
>>> 你好
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/代码探险家/article/detail/907221
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。