基础依赖安装
sudo apt update && sudo apt install -y git build-essential cmake
克隆仓库
git clone https://gitcode.com/mirrors/ggml-org/models cd models
模型文件验证
md5sum phi-2/ggml-model-q4_0.gguf # 应返回:d41d8cd98f00b204e9800998ecf8427e
### 典型部署命令示例
**1. 本地开发测试(Mistral-7B)**
```bash
# 需要8GB以上内存
./llama.cpp/main -m mistral-7b-v0.2-iq3_s-imat.gguf \
-p "Explain quantum computing in simple terms:" \
-n 512 \
--color \
--temp 0.7
2. 嵌入式设备(TinyLlama-15M Q4_0)
# 树莓派专用优化命令
./llama.cpp/main -m tinyllamas/stories15M-q4_0.gguf \
-p "Write a short poem about AI:" \
-n 128 \
--threads 2 \
--no-mmap \
--low-vram
创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考



