企业级大模型的部署

📅 发布时间:2026/7/23 5:33:55
企业级大模型的部署 1. 部署Docker#更新软件包 sudo apt update ​ sudo apt upgrade ​ #安装docker依赖 sudo apt install software-properties-common ​ sudo apt-get install ca-certificates curl gnupg lsb-release ​ #添加Docker官方GPG密钥 curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add - ​ #添加Docker软件源输入后根据提示按Enter sudo add-apt-repository deb [archamd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable ​ #安装docker输入后根据提示输入 y sudo apt-get install docker-ce docker-ce-cli containerd.io --fix-missing ​ #安装完毕启动docker并查看状态 sudo systemctl start docker ​ #看到running状态说明docker已经正常启动 sudo systemctl status docker2. 部署Dify最低安装要求CPU 2 Core and RAM 4 GiB官网Dify - 构建生产级 AI 应用GitHub - langgenius/dify: Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack. · GitHub文档说明https://github.com/langgenius/dify/blob/main/README_CN.md使用 Docker Compose 部署 Dify - Dify Docs镜像源配置sudo vi /etc/docker/daemon.json{ registry-mirrors: [ https://docker.xuanyuan.me, https://docker.1ms.run, https://docker.m.daocloud.io, http://hub-mirror.c.163.com, https://docker.unsee.tech, https://dockerpull.org, https://docker.1panel.live, https://dockerhub.icu, https://docker.nju.edu.cn, https://registry.docker-cn.com, https://docker.mirrors.ustc.edu.cn, https://mirror.baidubce.com, https://5tqw56kt.mirror.aliyuncs.com, https://docker.hpcloud.cloud, http://mirrors.ustc.edu.cn, https://docker.chenby.cn, https://docker.ckyl.me, http://mirror.azure.cn, https://hub.rat.dev, https://mbirror.ccs.tencentyun.com] }sudo systemctl daemon-reload ​ sudo systemctl restart docker租赁Dify服务器腾讯云 官网腾讯云 产业智变·云启未来 - 腾讯基础配置 登录 - 腾讯云下载地址Release v0.15.5 · langgenius/dify · GitHub#上传解压: sudo tar -zxvf dify-0.15.5.tar.gz ​ cd xxx/dify-0.15.5/docker ​ sudo cp .env.example .env ​ sudo docker compose up -d ​ sudo docker compose ps访问 http://your_server_ip/install3. 模型部署租赁GPU服务器AutoDL AutoDL算力云 | 弹性、好用、省钱GPU算力零售价格新标杆 (西北地区 GPU推荐 RTX409030903080等)#开启学术资源加速 https://www.autodl.com/docs/network_turbo/ source /etc/network_turbo#部署XInference,准备conda环境**注意智川云如果有问题可以直接问客服只要能建立连接就按照教程步骤走就行** #autodl 算力云 conda create -p /root/autodl-tmp/conda_envs/xinfer_env python3.10 ​ #智川云 conda create -p /root/rivermind-data/conda_envs/xinfer_env python3.10 ​ #初始化conda环境 conda init bash ​ source ~/.bashrc ​ #激活conda环境 conda deactivate ​ #autodl算力云 conda activate /root/autodl-tmp/conda_envs/xinfer_env ​ #智川云 conda activate /root/rivermind-data/conda_envs/xinfer_env ​ #验证conda是否创建成功 which python ​ which pip ​ #部署XInference pip install xinference[vllm,embedding,rerank,transformers]1.16.0 \ --extra-index-url https://pypi.tuna.tsinghua.edu.cn/simple ​ 启动XInference服务端**在此之前执行** pip install sentence_transformers4.0.0 ​ XINFERENCE_MODEL_SRCmodelscope xinference-local --host 0.0.0.0 --port 6006访问XInference WebUI , 查看AutoDL自定义服务地址 , 访问Xinference的WebUI3.1 部署LLM#部署LLM https://inference.readthedocs.io/zh-cn/latest/models/builtin/llm/qwen3.html ​ #新起一个连接窗口激活conda环境 conda activate /root/autodl-tmp/conda_envs/xinfer_env ​ #开启学术加速 source /etc/network_turbo ​ #启动命令云端模型 xinference launch \ --model-engine transformers \ --model-name qwen3 \ --size-in-billions 0_6 \ --model-format pytorch \ --quantization none \ --model-uid Qwen3-0.6B \ --gpu_memory_utilization 0.6 \ --max_model_len 1024 \ --endpoint http://localhost:6006 #启动命令本地模型文件**--model-path模型权重本地存储路径** xinference launch \ --model-engine transforms \ --model-name qwen3 \ --size-in-billions 0_6 \ --model-format pytorch \ --quantization none \ --model-path {your_model_dir} \ --model-uid Qwen3-0.6B \ --gpu_memory_utilization 0.6 \ --max_model_len 1024 \ --endpoint http://localhost:60063.2 部署Embedding模型#云端模型 xinference launch \ --model-name bge-small-zh-v1.5 \ --model-type embedding \ --endpoint http://localhost:60063.3 部署Rerank模型xinference launch \ --model-name bge-reranker-base \ --model-type rerank \ --endpoint http://localhost:60063.4 查看模型部署情况#查看模型部署情况 xinference list \ --endpoint http://localhost:60063.5 Dify对接XInference安装XInference插件添加LLM添加Embedding模型添加Rerank模型