具身人工智能:重构AI感知-决策-执行闭环的技术本质
2026/10/14 8:52:16
在 AI 助手类工具中,Aider 以其便捷的 Git 进程与 LLM 沟通能力受到广大开发者喜爱;Ollama 则是当前支持最广的本地运行的 LLM 平台之一,支持多种模型如 LLaMA3,Mistral,CodeLlama 等。本文将详细介绍如何在完全本地化和无网环境下,部署 Aider + Ollama,实现类 Codex 能力的自动化编程助手。
局域网环境,特别是严格隔网的内网场景,无法连接外网,无法连 GitHub 下载代码,无法 pip install,也无法连通 PyPI 排版版本等。这些因素需要我们重新设计部署流程,包括:
llama3:instructollama pull llama3:instructollama serve在可连网的机器上进行:
pip download aider-d./aider_wheels将该目录整包移动到内网机器,然后手动安装:
pipinstall--no-index --find-links=./aider_wheels aider因为 venv 中 Python 路径和 entrypoint 是系统给定的,直接拷贝应用到不同环境很可能无法使用。建议重新创建 venv 并使用已打包的 wheel 安装所有依赖。
启动 Aider 时加上:
aider --no-check打开:
~\AppData\Local\Programs\Python\Python312\Lib\site-packages\aider\models.py查找_update_cache函数,修改为:
def_update_cache(self):# Skip remote model metadata fetch (disabled by local patch)return此修改可以禁止在内网环境下对 GitHub 进行网络连接,减少启动等待时间。
通过本文手动部署方案,可以实现:
这种部署方式适合于支持内网工程化自动化工作流程,也是私有化 AI DevOps 模型系统的最佳实践之一。