昨天看到了实验室服务器文件夹下面有一个deepseek的gguf文件,就顺便部署一下 至于为什么要本地呢?https://chat.deepseek.com/downloads/DeepSeek%20Privacy%20Policy.html 可能有一些学术隐私的东西不方便被收集吧。(我应该没有关系,反正都是学术垃圾)
此外,也要感谢deepseek的开源精神!!!!!!
实验室服务器是ubuntu 18(没人管理升级),不能上外网。 看了一眼lm studio的linux,要求ubuntu20 https://lmstudio.ai/docs/system-requirements,所以选择了ollama。 在这里选择ollama+open webui进行部署。
1. 安装ollama
1.1 ollama是什么
这里就不多赘述了,别的大佬和成熟的文章都写了 Ollama是一个支持在Windows、Linux和MacOS上本地运行大语言模型的工具。它允许用户非常方便地运行和使用各种大语言模型,比如Qwen模型等。用户只需一行命令就可以启动模型。
有一种Docker的感觉。
1.2 安装ollma
这里主要参考这篇文章: linux离线安装Ollama并完成大模型配置(无网络)
ollama在github里面推荐使用sh安装,当然也有手动自定义配置。我们这里就直接参考上面的文章,修改sh文件,使用本地安装包进行安装。
1.2.1. 下载安装包
可以去github的release页面下载:https://github.com/ollama/ollama/releases 或者直接在官网下载:https://ollama.com/download/ollama-linux-amd64.tgz。我这里是amd64,就选择对应的安装包即可
1.2.2. 新建sh文件并运行
这里就直接参考上面文章了。
- 在安装包同一目录下,新建一个install.sh文件,文本编辑器编辑,写入以下内容:
- #!/bin/sh
- # This script installs Ollama on Linux.
- # It detects the current operating system architecture and installs the appropriate version of Ollama.
-
- set -eu
-
-
- status() {
-
- echo ">>> $*" >&2; }
- error() {
-
- echo "ERROR $*"; exit 1; }
- warning() {
-
- echo "WARNING: $*"; }
-
- TEMP_DIR=$(mktemp -d)
- cleanup() {
-
- rm -rf $TEMP_DIR; }
- trap cleanup EXIT
-
- available() {
-
- command -v $1 >/dev/null; }
- require() {
-
-
- local MISSING=''
- for TOOL in $*; do
- if ! available $TOOL; then
- MISSING="$MISSING $TOOL"
- fi
- done
-
- echo $MISSING
- }
-
- [ "$(uname -s)" = "Linux" ] || error 'This script is intended to run on Linux only.'
-
- ARCH=$(uname -m)
- case "$ARCH" in
- x86_64) ARCH="amd64" ;;
- aarch64|arm64) ARCH="arm64" ;;
- *) error "Unsupported architecture: $ARCH" ;;
- esac
-
- IS_WSL2=false
-
- KERN=$(uname -r)
- case "$KERN" in
- *icrosoft*WSL2 | *icrosoft*wsl2) IS_WSL2=true;;
- *icrosoft) error "Microsoft WSL1 is not currently supported. Please use WSL2 with 'wsl --set-version <distro> 2'" ;;
- *) ;;
- esac
-
- VER_PARAM="${OLLAMA_VERSION:+?version=$OLLAMA_VERSION}"
-
- SUDO=
- if [ "$(id -u)" -ne 0 ]; then
- # Running as root, no need for sudo
- if ! available sudo; then
- error "This script requires superuser permissions. Please re-run as root."
- fi
-
- SUDO="sudo"
- fi
-
- NEEDS=$(require curl awk grep sed tee xargs)
- if [ -n "$NEEDS" ]; then
- status "ERROR: The following tools are required but missing:"
- for NEED in $NEEDS; do
- echo " - $NEED"
- done
- exit 1
- fi
-
- for BINDIR in /usr/local/bin /usr/bin /bin; do
- echo $PATH | grep -q $BINDIR && break || continue
- done
- OLLAMA_INSTALL_DIR=$(dirname ${
-
- BINDIR})
-
- status "Installing ollama to $OLLAMA_INSTALL_DIR"
- $SUDO install -o0 -g0 -m755 -d $BINDIR
- $SUDO
复制代码 |