Local LLM Ops (Ollama)
概述
该本地 LLM 仓库在 Apple Silicon 上提供完整的本地 LLM 工具链:安装脚本、功能丰富的 CLI 聊天启动器、基准测试和诊断。操作路径为:安装 Ollama、确保服务运行、初始化虚拟环境、拉取模型,然后启动聊天或基准测试。
快速开始
./setup_chatbot.sh ./chatllm
如果没有模型:
ollama pull mistral
安装检查清单
安装 Ollama:brew install ollama
启动服务:brew services start ollama
运行安装:./setup_chatbot.sh
验证服务:curl http://localhost:11434/api/version
聊天启动器
./chatllm(主启动器)
./chat 或 ./chat.py(备用启动器)
别名:./install_aliases.sh 然后 llm、llm-code、llm-fast
任务模式:
./chat -t coding -m codellama:70b ./chat -t creative -m llama3.1:70b ./chat -t analytical
基准测试工作流
基准测试脚本位于 scripts/run_benchmarks.sh:
./scripts/run_benchmarks.sh
这会运行 bench_ollama.py,使用:
benchmarks/prompts.yaml
benchmarks/models.yaml
多次运行和最大 token 限制
诊断
安装失败时运行内置诊断脚本:
./diagnose.sh
常见修复:
重新运行 ./setup_chatbot.sh
确保 ollama 在 PATH 中
至少拉取一个模型:ollama pull mistral
操作说明
虚拟环境位于 .venv
聊天配置和会话位于 ~/.localllm/ 下
Ollama API 运行在 http://localhost:11434
相关技能
toolchains/universal/infrastructure/docker