安装Ollama
直接安装客户端:
下载地址 :https://ollama.com/download
https://ollama.com/download
准备模型
https://huggingface.co/models?library=gguf&sort=trending
模型选择
| 模型大小(参数数量) | 量化级别 | 最小RAM需求 (GB) | 最小VRAM需求 (GB)(使用GPU时) | 备注 |
|---|---|---|---|---|
| 7B | q4_0 | 4 | 4 | 适合入门级硬件,RAM推荐≥4GB,GPU可选。 |
| 7B | q8_0 | 7 | 7 | 精度较高,RAM推荐≥8GB。 |
| 13B | q4_0 | 7 | 7 | 中等需求,RAM推荐≥8GB,GPU推荐≥8GB VRAM。 |
| 13B | q8_0 | 14 | 14 | 较高精度,RAM推荐≥16GB。 |
| 70B | q4_0 | 35 | 35 | 高性能需求,推荐使用GPU,VRAM≥36GB。 |
| 70B | q8_0 | 70 | 70 | 全精度级别,需高端GPU和充足RAM。 |
这里用 gemma-4-E4B-it-Q4_K_M.gguf
配置文件
把gguf模型和配置文件(手动创建Modelfile文件)放在自定义文件夹(C:\LLMs)内

修改Modelfile配置文件内容
# 指向本地 GGUF 文件的路径(支持相对路径或绝对路径)
FROM C:\LLMs\gemma-4-E4B-it-Q4_K_M.gguf
# 可选:设置系统提示词(System Prompt)
SYSTEM "You are a helpful assistant. Provide direct answers without any internal thought process or reasoning tags."
# 可选:设置参数(例如上下文长度、温度等)
PARAMETER num_ctx 10000
PARAMETER temperature 0.59
导入模型
C:\LLMs下打开cmd

执行命令 ollama create gemma4 -f Modelfile
C:\LLMs>ollama create gemma4 -f Modelfile
gathering model components
copying file sha256:da4f2efe4ce09d272fd6f85ce3c5ecdbf282ff841e7b2d01b69106e7d5a1d98c 100%
parsing GGUF
using existing layer sha256:da4f2efe4ce09d272fd6f85ce3c5ecdbf282ff841e7b2d01b69106e7d5a1d98c
creating new layer sha256:f235c00711b850bc91a06aa5ac9430537cf9f9bb1bf6b8925bd7b118f4011159
creating new layer sha256:5f38e84f1d6db21ed9fd89cf4e06168af3e0dacb7cfbba515c730e62bd06f97f
writing manifest
success
C:\LLMs>ollama list
NAME ID SIZE MODIFIED
gemma4:latest 77729c42dbc9 5.0 GB 9 seconds ago
在客户端里就可以使用了




670

被折叠的 条评论
为什么被折叠?



