1)安装llama.cpp

https://github.com/ai-dock/llama.cpp-cuda/releases


2) 下载模型文件
https://www.modelscope.cn/models/unsloth/GLM-4.7-Flash-GGUF/files

3)在WSL2中启动模型

export LD_LIBRARY_PATH=/mnt/d/GLM-4.7-Flash-GGUF/llama-cuda-12.8:$LD_LIBRARY_PATH
export PATH=/mnt/d/GLM-4.7-Flash-GGUF/llama-cuda-12.8:$PATH

llama-server -m GLM-4.7-Flash-UD-Q4_K_XL.gguf \
--host 0.0.0.0 --port 9091 \
--n-gpu-layers 99 \
--log-timestamps \
--alias gpt-4 \ #伪装成gpt-4
--reasoning off \
--log-prompts-dir /mnt/d/GLM-4.7-Flash-GGUF/logs


4)测试llama服务器运行情况
http://127.0.0.1:9091/v1/models

5)用kvprof记录Trae/DeepSeek Harness/OpenCode/WorkBuddy等Agent的提示词

set PATH=D:\Program Files\Python311;D:\Program Files\Python311\Scripts;%PATH%
set KVPROF_LISTEN=127.0.0.1:9091
set KVPROF_TRACE_DIR=D:\Work\trae1\log3
kvprof start --upstream


多次对比验证后,4090D上使用 llama+GLM-4.7-Flash-UD-Q4_K_XL 是更合适的选择(2026年10月)。


本文链接地址: 在4090D上运行GLM-4.7-Flash-UD-Q4_K_XL
https://blog.qingfengju.com/index.asp?id=460

分类:杂谈随感 查看次数:60 发布时间:2026/10/27 22:52:20