llama.cpp + llama-server 的安装部署验证

飞桨AI Studio星河社区-人工智能学习与实训社区

用的是 魔塔的免费资源 不太稳定

我的Notebook · 魔搭社区

cat /etc/os-release

 Ubuntu 22.04.5 LTS (Jammy Jellyfish) —— 这是一个长期支持(LTS)且完全受支持的现代 Linux 发行版,非常适合部署 llama.cpp + llama-server。Ubuntu 22.04 自带较新的 GCC(11+)、CMake(3.22+)和 Python 3.10+,无需手动升级工具链,部署过程非常顺畅。

一、安装系统依赖
sudo apt update

sudo apt install -y git build-essential cmake libssl-dev

二、克隆并编译 llama.cpp

1. 克隆仓库

git clone https://github.com/ggerganov/llama.cpp

cd llama.cpp

步骤 3:使用 CMake 构建 server

mkdir build

sudo apt install -y ninja-build

cd build

cmake .. -G Ninja

ninja server  报错了

rm -rf build  
重新来
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DLLAMA_BUILD_SERVER=ON


make -j $(nproc) llama-server

三、准备 GGUF 模型

下载量化模型(以 Llama-3-8B-Instruct Q4_K_M 为例)
cd /mnt/data/

pip install --upgrade pip

pip install modelscope

modelscope download --model QuantFactory/Llama-3-8B-Instruct-Coder-GGUF Llama-3-8B-Instruct-Coder.Q6_K.gguf --local_dir /mnt/data

modelscope download --model ngxson/Qwen2.5-7B-Instruct-1M-Q4_K_M-GGUF qwen2.5-7b-instruct-1m-q4_k_m.gguf --local_dir /mnt/data

Qwen2.5-7B-Instruct-1M-Q4_K_M-GGUF · 模型库

Llama-3-8B-Instruct-Coder-GGUF · 模型库


# 启动

/mnt/workspace/llama.cpp/build/bin/llama-server -m /mnt/data/Llama-3-8B-Instruct-Coder.Q6_K.gguf --port 8080 --host 0.0.0.0 --ctx-size 2048 --threads 8

# 1. 后台启动

nohup /mnt/workspace/llama.cpp/build/bin/llama-server -m /mnt/data/Llama-3-8B-Instruct-Coder.Q6_K.gguf --port 8080 --host 0.0.0.0 --ctx-size 8192 --threads 8 > /mnt/workspace/llama-server.log 2>&1 &

nohup /mnt/workspace/llama.cpp/build/bin/llama-server -m /mnt/data/qwen2.5-7b-instruct-1m-q4_k_m.gguf --port 8080 --host 0.0.0.0 --ctx-size 8192 --threads 8 > /mnt/workspace/llama-server.log 2>&1 &

# 2. 验证

curl http://localhost:8080/health

# 3. 查日志

tail -f /mnt/workspace/llama-server.log

# 4. 停止

pkill -f llama-server

curl http://localhost:8080/completion \ -H "Content-Type: application/json" \ -d '{ "prompt": "<|start_header_id|>user<|end_header_id|>\n\n你好,请写一首关于春天的诗。<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n\n", "n_predict": 150, "stop": ["<|eot_id|>"] }'

curl http://localhost:8080/v1/chat/completions \ -H "Content-Type: application/json" \ -d '{ "messages": [{"role": "user", "content": "你好!"}], "temperature": 0.7, "max_tokens": 50 }'

Read more

【AIGC】即梦omnihuaman-api调用实现

即梦数字人视频生成(Streamlit Demo) 基于 火山引擎即梦(Jimeng)CV API 的数字人视频生成示例项目。 支持 图片 + 音频驱动 的数字人视频生成流程,集成了主体检测、Mask 选择、Prompt 控制、视频生成与下载等完整功能,适合 内部测试 / 技术演示 / 二次开发。 一、功能概览 ✅ 核心功能 * 🔐 AK / SK 在线填写 * 支持火山引擎 Access Key / Secret Key 在页面中直接输入 * 无需写死在代码中,便于多账号切换 * api key申请地址:https://console.volcengine.com/iam/keymanage * 🖼 图片上传(人物图像) * 支持 JPG / PNG

Whisper 模型本地化部署:全版本下载链接与离线环境搭建教程

Whisper 模型本地化部署指南 一、模型版本与下载 Whisper 提供多种规模版本,可通过以下官方渠道获取: 1. GitHub 仓库 https://github.com/openai/whisper 包含最新代码、预训练权重和文档 * tiny.en / tiny * base.en / base * small.en / small * medium.en / medium * large-v2 (最新大模型) Hugging Face 模型库 所有版本下载路径: https://huggingface.co/openai/whisper-{version}/tree/main 替换 {version} 为具体型号: 二、离线环境搭建教程 准备工作 1.

VsCode远程连接服务器后安装Github Copilot无法使用

VsCode远程连接服务器后安装Github Copilot无法使用

VsCode远程连接服务器后安装Github Copilot无法使用 1.在Vscode的settings中搜索Extension Kind,如图所示: 2.点击Edit in settings.json,添加如下代码: "remote.extensionKind":{"GitHub.copilot":["ui"],"GitHub.copilot-chat":["ui"],} remote.extensionKind 的作用 这是 VS Code 的远程开发配置项,用于控制扩展在远程环境(如 SSH、容器、WSL)中的运行位置。可选值: “ui”:扩展在本地客户端运行 “workspace”:扩展在远程服务器运行 这两个扩展始终在 本地客户端运行,

RISC-V五级流水线CPU的Xilinx FPGA移植操作指南

手把手教你把 RISC-V 五级流水线 CPU 移植到 Xilinx FPGA 你有没有想过,自己写一个 CPU?不是买现成的芯片,而是从零开始用 Verilog 搭建一个真正能跑程序的处理器——哪怕只是一个教学级的五级流水线架构。听起来很酷,对吧? 更进一步:把这个 CPU 下载到一块 Xilinx FPGA 开发板上,让它点亮 LED、打印“Hello World”,甚至执行你自己编译的 C 程序。这不仅是计算机体系结构课的经典实验,更是理解现代 CPU 工作原理最直接的方式。 本文不讲空泛理论,也不堆砌术语。我们将以 实战视角 ,带你完整走通 RISC-V 五级流水线 CPU 在 Xilinx FPGA 上的移植全流程 。你会看到每一个关键决策背后的“为什么”