Files
deploy.stack/ollama/gemma4/readme.md
cnphpbb 0f44e5b328 feat(gemma4): 添加gemma4模型配置文件和说明文档
添加modelfile定义模型参数和系统提示词规则
添加readme.md包含模型信息和部署说明
2026-04-22 14:23:39 +08:00

69 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Gemma4 26B 模型配置
## 模型信息
- 基础模型: `gemma4:26b-a4b-it-q4_K_M`
- 量化级别: Q4_K_M
## 硬件配置
适用于: **2080Ti 22GB + NPU**
## Windows 环境变量设置
在运行 Ollama 之前,需要设置以下环境变量:
```powershell
$env:OLLAMA_NPU_ACCELERATE = "true"
$env:OLLAMA_GPU_OFFLOAD_KV = "true"
```
## 模型参数说明
### 硬件参数
| 参数 | 值 | 说明 |
|------|-----|------|
| `num_gpu` | 99 | GPU 层数 |
| `num_ctx` | 8192 | 上下文长度 |
| `num_batch` | 512 | 批处理大小 |
| `num_thread` | 12 | 线程数 |
### 采样参数
| 参数 | 值 | 说明 |
|------|-----|------|
| `temperature` | 0.32 | 温度系数 |
| `top_p` | 0.85 | 核采样概率 |
| `top_k` | 55 | Top-K 采样 |
| `repeat_penalty` | 1.08 | 重复惩罚 |
| `stop` | `<end_of_turn>` | 停止标记 |
## 创建模型
```powershell
ollama create gemma4-custom -f ./modelfile
```
### 无 >>> 静默运行命令
```powershell
ollama run gemma4-custom "你的问题" --nowordwrap
```
## 系统提示词说明
本模型配置了 Cherry Studio + SearXNG 工具调用能力,主要特性:
1. **工具调用格式**: 使用 `<|tool_call|>` 标签进行搜索调用
2. **单轮限制**: 每轮对话最多调用 1 次搜索
3. **结果收敛**: 收到搜索结果后直接回答,不再生成工具调用
4. **防循环机制**: 禁止触发二次搜索的话术
## Cherry 工具全局设置
### 搜索源:选择你自建的 SearXNG
最大工具调用次数1
最大单轮搜索次数1