← 返回 Skills 市场
212
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install ollama-migrator
功能描述
Ollama 模型迁移技能。用于将 Ollama 模型从 C 盘迁移到其他磁盘,释放 C 盘空间。使用场景:(1) C 盘空间不足需要迁移模型,(2) 更换模型存储位置,(3) 检查 Ollama 模型占用空间,(4) 验证迁移后模型可用性
安全使用建议
This skill appears to do what it says: move local Ollama model files, set OLLAMA_MODELS, and verify with the local 'ollama' CLI. Before installing/run it: 1) Confirm you're on Windows (the scripts use taskkill and winreg). 2) Ensure you have Python and the 'ollama' CLI available and working. 3) Inspect the scripts (they are included) and run the check mode first: python scripts/migrate_ollama.py --check (or python scripts/check_ollama_status.py) to preview results. 4) Note SKILL.md mentions scripts/verify_ollama.py which is missing — the migrate script uses subprocess('ollama list') for verification, so double-check verification behavior. 5) Backup important models before using --cleanup; the script will delete source files if you pass --cleanup and confirm. 6) Expect the script to stop the ollama.exe process and to write a user-level environment variable (HKEY_CURRENT_USER) — administrative/system-wide changes are not performed. If any of these behaviors are unexpected for your environment, don't run the migration until you've adjusted or validated the scripts.
功能分析
Type: OpenClaw Skill
Name: ollama-migrator
Version: 1.0.0
The ollama-migrator skill is designed to move Ollama model files to a different disk to free up space. It includes scripts to check disk usage (check_ollama_status.py) and perform the migration (migrate_ollama.py), which involves stopping the Ollama service, copying files, and updating the OLLAMA_MODELS environment variable via the Windows Registry. While the scripts perform sensitive operations like process termination and registry modification, these actions are directly related to the stated purpose and include user confirmation prompts for destructive actions like cleanup.
能力评估
Purpose & Capability
The name/description (migrating Ollama models off C:) match the scripts' behavior: scanning model folder, copying files, stopping Ollama, setting OLLAMA_MODELS, verifying via 'ollama list', and optional cleanup. Incoherences: SKILL.md references a scripts/verify_ollama.py that is not present, and the metadata declares no required binaries/commands even though the scripts call external commands ('ollama', 'taskkill'). These are documentation omissions but not functionality mismatches.
Instruction Scope
Runtime instructions and scripts stay within the migration scope: they read model files under the user's home (~/.ollama/models), check disk usage, copy files, set a user environment variable, stop a specific process (ollama.exe) and optionally remove the source. They do modify the user registry (user-level env var) and kill a process, which is expected for this task but worth noting. There are no network calls or attempts to read unrelated system secrets.
Install Mechanism
No install spec is provided and the skill is effectively instruction + helper scripts. That minimizes installer risk. The scripts will run on the host via Python; nothing is downloaded or extracted by an installer.
Credentials
The skill does not request external credentials and only uses/sets the OLLAMA_MODELS environment variable — appropriate for changing model location. Minor mismatch: registry/system-level environment variables are discussed in SKILL.md, but the code only writes a user-level environment variable (HKEY_CURRENT_USER). Also the skill assumes availability of 'ollama' CLI and Windows utilities but does not declare them as required.
Persistence & Privilege
The skill does not request permanent/always-on privileges and will not modify other skills or system-wide agent settings. It does persist a user-level environment variable (expected for this purpose) and may delete source files only when you explicitly pass --cleanup and confirm.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install ollama-migrator - 安装完成后,直接呼叫该 Skill 的名称或使用
/ollama-migrator触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
---
name: ollama-migrator
description: Ollama 模型迁移技能。用于将 Ollama 模型从 C 盘迁移到其他磁盘,释放 C 盘空间。使用场景:(1) C 盘空间不足需要迁移模型,(2) 更换模型存储位置,(3) 检查 Ollama 模型占用空间,(4) 验证迁移后模型可用性
---
# Ollama 模型迁移助手
本技能帮助将 Ollama 模型安全迁移到其他磁盘,释放 C 盘空间。
## 核心能力
### 1. 空间分析
- 检查当前模型存储位置
- 计算模型总占用空间
- 检查目标磁盘可用空间
### 2. 安全迁移
- 停止 Ollama 服务
- 复制模型文件(保留完整性)
- 设置环境变量
- 验证迁移结果
### 3. 回滚支持
- 保留源文件直到验证完成
- 支持手动回滚
- 迁移日志记录
## 工作流程
### 步骤 1: 检查状态
```powershell
# 检查当前模型位置和大小
python scripts/check_ollama_status.py
```
### 步骤 2: 执行迁移
```powershell
# 迁移到 D 盘(默认)
python scripts/migrate_ollama.py --target D:\Ollama\models
# 迁移到其他位置
python scripts/migrate_ollama.py --target E:\AI\models
```
### 步骤 3: 验证
```powershell
# 验证模型列表
ollama list
# 测试运行模型
ollama run qwen3.5:9b
```
### 步骤 4: 清理(可选)
确认迁移成功后,删除旧文件:
```powershell
python scripts/migrate_ollama.py --cleanup
```
## 环境变量
迁移后设置的环境变量:
- **用户级**: `OLLAMA_MODELS = <目标路径>`
- **系统级**: 需要管理员权限(可选)
## 脚本工具
- `scripts/check_ollama_status.py` - 检查 Ollama 状态和模型占用
- `scripts/migrate_ollama.py` - 执行迁移操作
- `scripts/verify_ollama.py` - 验证迁移结果
## 触发条件
当用户提到:
- "Ollama 迁移"
- "Ollama 模型移动到其他盘"
- "C 盘 Ollama 占用太大"
- "Ollama 模型位置"
- "迁移 Ollama 到 D 盘"
## 安全机制
### 必须遵守的规则
1. **迁移前检查**:
- 确认 Ollama 服务已停止
- 检查目标磁盘空间充足
- 记录当前模型列表
2. **数据完整性**:
- 使用可靠复制(验证大小)
- 保留源文件直到验证完成
- 迁移日志记录
3. **用户确认**:
- 显示迁移计划
- 用户明确确认后才执行
- 支持预览模式
4. **验证机制**:
- 迁移后自动验证模型列表
- 测试运行一个模型
- 确认无误后才建议清理
## 注意事项
1. **新终端窗口**:环境变量在新打开的终端中生效
2. **运行中的服务**:需要重启 Ollama 服务
3. **权限问题**:系统级环境变量需要管理员权限
4. **备份建议**:重要模型建议先备份
元数据
常见问题
ollama-migrator 是什么?
Ollama 模型迁移技能。用于将 Ollama 模型从 C 盘迁移到其他磁盘,释放 C 盘空间。使用场景:(1) C 盘空间不足需要迁移模型,(2) 更换模型存储位置,(3) 检查 Ollama 模型占用空间,(4) 验证迁移后模型可用性. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 212 次。
如何安装 ollama-migrator?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install ollama-migrator」即可一键安装,无需额外配置。
ollama-migrator 是免费的吗?
是的,ollama-migrator 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
ollama-migrator 支持哪些平台?
ollama-migrator 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 ollama-migrator?
由 test_heng(@jjflydudu)开发并维护,当前版本 v1.0.0。
推荐 Skills