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

【干货实操】AI绘画/设计变现:零美术基础也能赚外快,90天落地计划+提示词模板(附可用学习链接)

前言 你是不是羡慕别人靠设计接单赚钱,却苦于没美术基础、没专业软件、没接单渠道? 当下AI绘画技术的成熟,给普通人打开了一扇零门槛、零成本的变现大门——AI绘画/设计变现。不需要你会手绘、懂PS,只要掌握AI绘画工具的基础操作和精准提示词技巧,依托“AI生成初稿+人工微调优化”的模式,就能做出高质量的设计作品,承接头像、壁纸、海报等刚需订单,适合程序员、职场人、学生党利用碎片化时间赚外快,全程坚守合规底线,可直接落地。 本文整理了90天详细落地计划,包含工具选型、获客渠道、定价策略、版权注意事项等全流程实操步骤,附赠公共可用的学习资料和提示词模板,普通人照做就能上手,轻松实现从0到1的收益突破。 核心原则 1. 零成本起步:拒绝付费会员、培训课程,全部使用免费AI绘画工具和免费获客渠道; 2. AI+人工双驱动:AI负责基础图像生成,人工负责细节优化、风格调整,保证作品差异化; 3. 刚需低竞争赛道切入:避开复杂的商业插画、

找回 Edge 边栏中消失的 Copilot 图标

Edge 边栏的 Copilot 能根据网页内容增强回复,相当于内置了RAG,而且能不限次数使用GPT-5,非常方便。笔者有次打开 Edge 浏览器时发现边栏的Copilot图标消失了,探索了一些方法后终于找到解决方案,以下: 1. win+R 打开运行,输入 powershell 打开,复制以下正则表达式全文到powershell 命令窗口回车运行即可。命令窗口出现“✅ 已将 variations_country 设置为 US。已重新启动 Microsoft Edge”代表已经成功。 & { # 关闭所有 Edge 进程 Get-Process | Where-Object { $_.ProcessName -like "msedge*" } | Stop-Process -Force -ErrorAction SilentlyContinue Start-Sleep -Seconds 3 $localState

理解 IDE 调用大模型(Cursor / Claude Code / Copilot / OpenClaw / Agent IDE) 的 session

理解 IDE 调用大模型(Cursor / Claude Code / Copilot / OpenClaw / Agent IDE) 的 session

一、Session 在 IDE 里的真实含义 在普通 ChatGPT 对话中: Session ≈ 一段聊天 但在 IDE 中: Session ≈ 当前开发工作空间的认知状态 它通常包含: ① 对话历史(Conversation Memory) 你之前说过什么: * 修改哪个模块 * 当前目标 * 已做决策 * 技术约束 模型通过这些推断你下一步意图。 ② 工程上下文(Code Context) IDE 会持续注入: * 当前打开文件 * 最近编辑文件 * git diff * 报错日志 * terminal 输出 * workspace 结构 所以 session 实际上是: 语言上下文 + 代码上下文 + 操作历史 ③ Agent 状态(关键) 在 Agent