[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-aorwall--moatless-tools":3,"tool-aorwall--moatless-tools":62},[4,18,26,36,46,54],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",160784,2,"2026-04-19T11:32:54",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":42,"last_commit_at":43,"category_tags":44,"status":17},8272,"opencode","anomalyco\u002Fopencode","OpenCode 是一款开源的 AI 编程助手（Coding Agent），旨在像一位智能搭档一样融入您的开发流程。它不仅仅是一个代码补全插件，而是一个能够理解项目上下文、自主规划任务并执行复杂编码操作的智能体。无论是生成全新功能、重构现有代码，还是排查难以定位的 Bug，OpenCode 都能通过自然语言交互高效完成，显著减少开发者在重复性劳动和上下文切换上的时间消耗。\n\n这款工具专为软件开发者、工程师及技术研究人员设计，特别适合希望利用大模型能力来提升编码效率、加速原型开发或处理遗留代码维护的专业人群。其核心亮点在于完全开源的架构，这意味着用户可以审查代码逻辑、自定义行为策略，甚至私有化部署以保障数据安全，彻底打破了传统闭源 AI 助手的“黑盒”限制。\n\n在技术体验上，OpenCode 提供了灵活的终端界面（Terminal UI）和正在测试中的桌面应用程序，支持 macOS、Windows 及 Linux 全平台。它兼容多种包管理工具，安装便捷，并能无缝集成到现有的开发环境中。无论您是追求极致控制权的资深极客，还是渴望提升产出的独立开发者，OpenCode 都提供了一个透明、可信",144296,1,"2026-04-16T14:50:03",[13,45],"插件",{"id":47,"name":48,"github_repo":49,"description_zh":50,"stars":51,"difficulty_score":32,"last_commit_at":52,"category_tags":53,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",109154,"2026-04-18T11:18:24",[14,15,13],{"id":55,"name":56,"github_repo":57,"description_zh":58,"stars":59,"difficulty_score":32,"last_commit_at":60,"category_tags":61,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[45,13,15,14],{"id":63,"github_repo":64,"name":65,"description_en":66,"description_zh":67,"ai_summary_zh":68,"readme_en":69,"readme_zh":70,"quickstart_zh":71,"use_case_zh":72,"hero_image_url":73,"owner_login":74,"owner_name":75,"owner_avatar_url":76,"owner_bio":66,"owner_company":66,"owner_location":77,"owner_email":78,"owner_twitter":74,"owner_website":66,"owner_url":79,"languages":80,"stars":105,"forks":106,"last_commit_at":107,"license":108,"difficulty_score":10,"env_os":109,"env_gpu":110,"env_ram":110,"env_deps":111,"category_tags":120,"github_topics":121,"view_count":32,"oss_zip_url":66,"oss_zip_packed_at":66,"status":17,"created_at":128,"updated_at":129,"faqs":130,"releases":159},9669,"aorwall\u002Fmoatless-tools","moatless-tools",null,"moatless-tools 是一个专注于利用大语言模型（LLM）在大型现有代码库中进行代码编辑的开源实验项目。它旨在解决当前 AI 编程助手在处理复杂项目时，因缺乏精准上下文而导致修改错误或效率低下的痛点。与传统依赖智能体自主推理不同，moatless-tools 的核心理念是构建高效的工具链，主动为模型注入正确的上下文信息并规范其响应，从而实现更可靠的代码变更。\n\n该项目在权威的 SWE-bench 基准测试中表现优异，例如配合 Claude 3.5 Sonnet 模型时，问题解决率可达 70.8%，且单次运行成本控制在较低水平。其独特技术亮点在于支持基于蒙特卡洛树搜索（MCTS）和迭代优化的策略（相关实现在 moatless-tree-search 项目中），并提供了一套完整的评估框架，方便用户验证不同模型在真实软件缺陷修复任务中的表现。\n\nmoatless-tools 非常适合软件开发者和 AI 研究人员使用。开发者可以利用它探索自动化修复代码缺陷的新工作流，而研究人员则能借助其提供的 Docker 环境和评估脚本，复现论文结果或测试新的 Agent 架构。虽然目前主要面向技术","moatless-tools 是一个专注于利用大语言模型（LLM）在大型现有代码库中进行代码编辑的开源实验项目。它旨在解决当前 AI 编程助手在处理复杂项目时，因缺乏精准上下文而导致修改错误或效率低下的痛点。与传统依赖智能体自主推理不同，moatless-tools 的核心理念是构建高效的工具链，主动为模型注入正确的上下文信息并规范其响应，从而实现更可靠的代码变更。\n\n该项目在权威的 SWE-bench 基准测试中表现优异，例如配合 Claude 3.5 Sonnet 模型时，问题解决率可达 70.8%，且单次运行成本控制在较低水平。其独特技术亮点在于支持基于蒙特卡洛树搜索（MCTS）和迭代优化的策略（相关实现在 moatless-tree-search 项目中），并提供了一套完整的评估框架，方便用户验证不同模型在真实软件缺陷修复任务中的表现。\n\nmoatless-tools 非常适合软件开发者和 AI 研究人员使用。开发者可以利用它探索自动化修复代码缺陷的新工作流，而研究人员则能借助其提供的 Docker 环境和评估脚本，复现论文结果或测试新的 Agent 架构。虽然目前主要面向技术人群，但其模块化的设计也为未来集成到更广泛的开发工具中奠定了基础。","# Moatless Tools\nMoatless Tools is a hobby project where I experiment with some ideas I have about how LLMs can be used to edit code in large existing codebases. I believe that rather than relying on an agent to reason its way to a solution, it is crucial to build good tools to insert the right context into the prompt and handle the response.\n\n_For the implementation used in the paper [SWE-Search: Enhancing Software Agents with Monte Carlo Tree Search and Iterative Refinement](https:\u002F\u002Farxiv.org\u002Fabs\u002F2410.20285), please see [moatless-tree-search](https:\u002F\u002Fgithub.com\u002Faorwall\u002Fmoatless-tree-search)._\n\n## SWE-Bench\nI use the [SWE-bench benchmark](https:\u002F\u002Fwww.swebench.com\u002F) as a way to verify my ideas. \n\n* Claude 4 Sonnet - 70.8% solve rate, $0.63 per instance.\n\n# Try it out\n\n## Run in Docker\n\n1. Clone the repository:\n   ```bash\n   git clone https:\u002F\u002Fgithub.com\u002Faorwall\u002Fmoatless-tools.git\n   cd moatless-tools\n   ```\n\n2. Set up environment variables:\n   ```bash\n   cp .env.example .env\n   ```\n   \n   Edit the `.env` file to set your API keys and other configuration options, including the required `MOATLESS_DIR` variable:\n   ```\n   MOATLESS_DIR=\u002Fpath\u002Fto\u002Fyour\u002Fmoatless\u002Fdata\n   ```\n   \n   **Note**: `MOATLESS_DIR` specifies the directory where Moatless will store configuration files and trajectory data. This directory will be mounted as a volume in the Docker containers.\n\n3. Start the services:\n   ```bash\n   make run\n   ```\n\n4. Access the UI at http:\u002F\u002Flocalhost\n\n## Install from PyPI\n\n```bash\n# Install base package only\npip install moatless\n\n# Install with Kubernetes runner support\npip install \"moatless[kubernetes]\"\n```\n\n## Install from source\n\nClone the repository and install using Poetry\n\n```bash\n# Clone the repository\ngit clone https:\u002F\u002Fgithub.com\u002Faorwall\u002Fmoatless-tools.git\ncd moatless-tools\n\n# Install using uv\nuv sync\n```\n\n# Code Examples\n\n## Basic agent flow\n\n```python\nfrom moatless.actions import Respond\nfrom moatless.agent import ActionAgent\nfrom moatless.completion.tool_call import ToolCallCompletionModel\n\ncompletion_model = ToolCallCompletionModel(\n    model=\"gpt-4.1-mini\",\n    temperature=0.0,\n    model_api_key=\"\"\n)\n\nagent = ActionAgent(\n    completion_model=completion_model,\n    system_prompt=\"You are a helpful assistant that can answer questions.\",\n    actions=[\n        Respond()\n    ]\n)\n\nobservation = await agent.run_simple(\"Hello\")\n\nprint(observation.message)\n```\n\n## Code inspector agent\n\n[notebooks\u002Fcode_inspector_agent.ipynb](See notebook)\n\n# Run SWE-Bench evaluations \n\nBefore running the evaluation, you'll need:\n1. At least one LLM provider API key (e.g., OpenAI, Anthropic, etc.)\n2. A Voyage AI API key from [voyageai.com](https:\u002F\u002Fvoyageai.com) to use the pre-embedded vector stores for SWE-Bench instances.\n\n## Verify Setup\n\nBefore running the full evaluation, you can verify your setup running a simple SWE-Bench instance.\n\n```bash\nuv run python scripts\u002Fdocker_run.py  --flow swebench_tools --model-id gpt-4o-mini-2024-07-18 --instance-id django__django-11099 --evaluation-name testing_setup\n```\n\nThe script will run the model against a sample SWE-Bench instance\n\nResults are saved in `.moatless\u002Fprojects\u002Ftesting_setup`.\n\n## Run evaluation\n\nEvaluation script to run evaluation in a docker containers. \n\n```bash\npython3 scripts\u002Frun_evaluation.py  --model gpt-4o-mini-2024-07-18 --dataset-split [dataset_split] --evaluation-name [evaluation_name]\n```\n\nRequired arguments:\n- `--dataset-split`: Dataset split to use\n- `--evaluation-name`: Name of the evaluation\n\nOptional arguments:\n- `--model`: Model to use for evaluation (default: gpt-4o-mini-2024-07-18, equivalent to --model-id)\n- `--model-id`: Model configuration ID to use (replaces entire model configuration)\n- `--litellm-model-name`: LiteLLM model name to override (keeps other model settings)\n- `--flow`: Flow to use for evaluation (defaults to \"simple_coding\")\n- `--num-parallel-jobs`: Number of parallel jobs (default: 1)\n\n## Flows \nAvailable flows that can be specified with the `--flow` argument:\n\n| Flow ID | Format | Best Suited For | Default Model |\n|---------|--------|-----------------|---------------|\n| swebench_tools | Function calling | Models with native function calling support | gpt-4o-mini-2024-07-18 |\n| swebench_tools_and_reasoning | Function calling | Reasoning models with native function calling support | claude-sonnet-4-20250514 |\n| swebench_react | ReACT | Open source models without native function calling support | openrouter\u002Fmistralai\u002Fdevstral-small |\n| swebench_react_reasoning | ReACT | Reasoning models without function calling support | openrouter\u002Fdeepseek\u002Fdeepseek-r1-0528 |\n\n## Model Configuration\n\nBoth evaluation scripts support flexible model configuration through the following options:\n\n### Model Options\n\n- `--model-id`: Specify a complete model configuration ID. This replaces the entire completion model configuration including temperature, max tokens, and all other settings.\n- `--litellm-model-name`: Override only the [LiteLLM model name](https:\u002F\u002Fdocs.litellm.ai\u002Fdocs\u002Fproviders) while keeping all other completion model settings (temperature, max tokens, etc.) from the flow or model configuration.\n\n### Verified Models\n\nDefault model configurations are provided for verified models. Note that other models may work but have not been extensively tested. \nVerified models are models that have been tested and found to work with the [Verified Mini subset](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002FMariusHobbhahn\u002Fswe-bench-verified-mini) of the SWE-Bench dataset.\n\nWhen specifying just the `--model-id` argument, the following configurations are used:\n\n| Model | Response Format | Message History | Thoughts in Action | Verified Mini |\n|-------|----------------|-----------------|-------------------|---------------|\n| claude-3-5-sonnet-20241022 | tool_call | messages | no | [46%](https:\u002F\u002Fexperiments.moatless.ai\u002Fevaluations\u002F20250119_claude_3_5_sonnet_20241022_0_0_n_20_fmt_tool_call_verified_mini) | \n| claude-3-5-haiku-20241022 | tool_call | messages | no | [28%](https:\u002F\u002Fexperiments.moatless.ai\u002Fevaluations\u002F20250118_claude_3_5_haiku_20241022_0_0_n_20_fmt_tool_call_verified_mini) |\n| gpt-4o-2024-11-20 | tool_call | messages | yes | [32%](https:\u002F\u002Fexperiments.moatless.ai\u002Fevaluations\u002F20250119_azure_gpt_4o_0_0_n_20_fmt_tool_call_thoughts-in-action_1_verified_mini) |\n| gpt-4o-mini-2024-07-18 | tool_call | messages | yes | [16%](https:\u002F\u002Fexperiments.moatless.ai\u002Fevaluations\u002F20250118_gpt_4o_mini_2024_07_18_0_0_n_20_fmt_tool_call_thoughts-in-action_6_verified_mini) |\n| o1-mini-2024-09-12 | react | react | no (disabled thoughts) | [28%](https:\u002F\u002Fexperiments.moatless.ai\u002Fevaluations\u002F20250114_o1_mini_2024_09_12_0_0_n_20_fmt_react_hist_react_verified_mini) |\n| deepseek\u002Fdeepseek-chat | react | react | no | [36%](https:\u002F\u002Fexperiments.moatless.ai\u002Fevaluations\u002F20250118_deepseek_deepseek_chat_0_0_n_20_fmt_react_verified_mini) |\n| deepseek\u002Fdeepseek-reasoner | react | react | no (disabled thoughts) | [50%](https:\u002F\u002Fexperiments.moatless.ai\u002Fevaluations\u002F20250120_deepseek_deepseek_reasoner_None_n_20_fmt_react_verified_mini) |\n| gemini\u002Fgemini-2.0-flash-exp | react | react | no | [38%](https:\u002F\u002Fexperiments.moatless.ai\u002Fevaluations\u002F20250119_gemini_gemini_2.0_flash_exp_0_0_n_20_fmt_react_verified_mini) |\n| openrouter\u002Fmeta-llama\u002Fllama-3.1-70b-instruct | react | react | no | - |\n| openrouter\u002Fmeta-llama\u002Fllama-3.1-405b-instruct | react | react | no | [28%](https:\u002F\u002Fexperiments.moatless.ai\u002Fevaluations\u002F20250119_openai_meta_llama_Meta_Llama_3.1_405B_Instruct_FP8_0_0_n_20_fmt_react_verified_mini) | - |\n| openrouter\u002Fqwen\u002Fqwen-2.5-coder-32b-instruct | react | react | no | [32%](https:\u002F\u002Fexperiments.moatless.ai\u002Fevaluations\u002F20250119_openai_Qwen_Qwen2.5_Coder_32B_Instruct_0_0_n_20_fmt_react_verified_mini) | - |\n\n## Dataset splits\n\nAvailable dataset splits that can be specified with the `--dataset-split` argument:\n\n| Split Name | Description | Instance Count |\n|------------|-------------|----------------|\n| lite | All instances from the lite dataset | 300 | \n| verified | All instances from the verified dataset | 500 | \n| verified_mini | [MariusHobbhahn\u002Fswe-bench-verified-mini](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002FMariusHobbhahn\u002Fswe-bench-verified-mini), a subset of SWE-Bench Verified  | 50 |\n| lite_and_verified_solvable | Instances that exist in both lite and verified datasets and have at least one solved submission to SWE-Bench | 84 |\n\n## Example usage\n```bash\n# Run evaluation with Claude 3.5 Sonnet using complete model configuration\npython3 scripts\u002Frun_evaluation.py \\\n  --model-id claude-3-5-sonnet-20241022 \\\n  --flow swebench_tools_and_reasoning \\\n  --dataset-split verified_mini \\\n  --num-parallel-jobs 5\n\n# Run evaluation overriding just the model name while keeping flow's model settings\npython3 scripts\u002Frun_evaluation.py \\\n  --litellm-model-name openrouter\u002Fqwen\u002Fqwen-2.5-coder-32b-instruct \\\n  --flow swebench_react \\\n  --dataset-split verified_mini \\\n  --num-parallel-jobs 5\n","# Moatless Tools\nMoatless Tools 是一个兴趣项目，我在其中尝试一些关于如何利用大型语言模型（LLM）编辑大型现有代码库的想法。我认为，与其依赖代理自行推理出解决方案，不如构建优秀的工具来为提示注入正确的上下文，并妥善处理响应。\n\n_有关论文 [SWE-Search: Enhancing Software Agents with Monte Carlo Tree Search and Iterative Refinement](https:\u002F\u002Farxiv.org\u002Fabs\u002F2410.20285) 中所使用的实现，请参阅 [moatless-tree-search](https:\u002F\u002Fgithub.com\u002Faorwall\u002Fmoatless-tree-search)。_\n\n## SWE-Bench\n我使用 [SWE-bench 基准测试](https:\u002F\u002Fwww.swebench.com\u002F) 来验证我的想法。\n\n* Claude 4 Sonnet - 解决率为70.8%，每次实例费用为0.63美元。\n\n# 试用一下\n\n## 在 Docker 中运行\n\n1. 克隆仓库：\n   ```bash\n   git clone https:\u002F\u002Fgithub.com\u002Faorwall\u002Fmoatless-tools.git\n   cd moatless-tools\n   ```\n\n2. 设置环境变量：\n   ```bash\n   cp .env.example .env\n   ```\n   \n   编辑 `.env` 文件以设置您的 API 密钥和其他配置选项，包括必需的 `MOATLESS_DIR` 变量：\n   ```\n   MOATLESS_DIR=\u002Fpath\u002Fto\u002Fyour\u002Fmoatless\u002Fdata\n   ```\n   \n   **注意**：`MOATLESS_DIR` 指定了 Moatless 将存储配置文件和轨迹数据的目录。该目录将在 Docker 容器中作为卷挂载。\n\n3. 启动服务：\n   ```bash\n   make run\n   ```\n\n4. 访问 UI：http:\u002F\u002Flocalhost\n\n## 从 PyPI 安装\n\n```bash\n# 仅安装基础包\npip install moatless\n\n# 安装支持 Kubernetes 运行器的版本\npip install \"moatless[kubernetes]\"\n```\n\n## 从源码安装\n\n克隆仓库并使用 Poetry 安装\n\n```bash\n# 克隆仓库\ngit clone https:\u002F\u002Fgithub.com\u002Faorwall\u002Fmoatless-tools.git\ncd moatless-tools\n\n# 使用 uv 安装依赖\nuv sync\n```\n\n# 代码示例\n\n## 基本代理流程\n\n```python\nfrom moatless.actions import Respond\nfrom moatless.agent import ActionAgent\nfrom moatless.completion.tool_call import ToolCallCompletionModel\n\ncompletion_model = ToolCallCompletionModel(\n    model=\"gpt-4.1-mini\",\n    temperature=0.0,\n    model_api_key=\"\"\n)\n\nagent = ActionAgent(\n    completion_model=completion_model,\n    system_prompt=\"您是一位能够回答问题的助手。\",\n    actions=[\n        Respond()\n    ]\n)\n\nobservation = await agent.run_simple(\"你好\")\n\nprint(observation.message)\n```\n\n## 代码检查器代理\n\n[notebooks\u002Fcode_inspector_agent.ipynb](查看笔记本)\n\n# 运行 SWE-Bench 评估\n\n在运行评估之前，您需要：\n1. 至少一个 LLM 提供商的 API 密钥（例如 OpenAI、Anthropic 等）\n2. 一个来自 [voyageai.com](https:\u002F\u002Fvoyageai.com) 的 Voyage AI API 密钥，用于 SWE-Bench 实例的预嵌入向量存储。\n\n## 验证设置\n\n在运行完整评估之前，您可以先运行一个简单的 SWE-Bench 实例来验证您的设置。\n\n```bash\nuv run python scripts\u002Fdocker_run.py  --flow swebench_tools --model-id gpt-4o-mini-2024-07-18 --instance-id django__django-11099 --evaluation-name testing_setup\n```\n\n该脚本将针对一个 SWE-Bench 示例实例运行模型。\n\n结果会保存在 `.moatless\u002Fprojects\u002Ftesting_setup` 中。\n\n## 运行评估\n\n用于在 Docker 容器中运行评估的脚本。\n\n```bash\npython3 scripts\u002Frun_evaluation.py  --model gpt-4o-mini-2024-07-18 --dataset-split [dataset_split] --evaluation-name [evaluation_name]\n```\n\n必填参数：\n- `--dataset-split`：要使用的数据集划分\n- `--evaluation-name`：评估名称\n\n可选参数：\n- `--model`：用于评估的模型（默认为 gpt-4o-mini-2024-07-18，等同于 --model-id）\n- `--model-id`：要使用的模型配置 ID（替换整个模型配置）\n- `--litellm-model-name`：要覆盖的 LiteLLM 模型名称（保留其他模型设置）\n- `--flow`：用于评估的流程（默认为 “simple_coding”）\n- `--num-parallel-jobs`：并行作业数量（默认为 1）\n\n## 流程\n可通过 `--flow` 参数指定的可用流程：\n\n| 流程 ID | 格式 | 最适合场景 | 默认模型 |\n|---------|--------|-----------------|---------------|\n| swebench_tools | 函数调用 | 支持原生函数调用的模型 | gpt-4o-mini-2024-07-18 |\n| swebench_tools_and_reasoning | 函数调用 | 支持原生函数调用的推理模型 | claude-sonnet-4-20250514 |\n| swebench_react | ReACT | 不支持原生函数调用的开源模型 | openrouter\u002Fmistralai\u002Fdevstral-small |\n| swebench_react_reasoning | ReACT | 不支持函数调用的推理模型 | openrouter\u002Fdeepseek\u002Fdeepseek-r1-0528 |\n\n## 模型配置\n两个评估脚本都支持通过以下选项进行灵活的模型配置：\n\n### 模型选项\n\n- `--model-id`：指定完整的模型配置 ID。这将替换整个完成模型配置，包括温度、最大令牌数及其他所有设置。\n- `--litellm-model-name`：仅覆盖 [LiteLLM 模型名称](https:\u002F\u002Fdocs.litellm.ai\u002Fdocs\u002Fproviders)，同时保留来自流程或模型配置的所有其他完成模型设置（温度、最大令牌数等）。\n\n### 已验证模型\n\n为已验证模型提供了默认的模型配置。请注意，其他模型可能也能工作，但尚未经过广泛测试。  \n已验证模型是指已在 SWE-Bench 数据集的 [Verified Mini 子集](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002FMariusHobbhahn\u002Fswe-bench-verified-mini) 上进行测试并确认可用的模型。\n\n当仅指定 `--model-id` 参数时，将使用以下配置：\n\n| 模型 | 响应格式 | 消息历史 | 思考过程 | Verified Mini |\n|-------|----------------|-----------------|-------------------|---------------|\n| claude-3-5-sonnet-20241022 | tool_call | messages | 否 | [46%](https:\u002F\u002Fexperiments.moatless.ai\u002Fevaluations\u002F20250119_claude_3_5_sonnet_20241022_0_0_n_20_fmt_tool_call_verified_mini) | \n| claude-3-5-haiku-20241022 | tool_call | messages | 否 | [28%](https:\u002F\u002Fexperiments.moatless.ai\u002Fevaluations\u002F20250118_claude_3_5_haiku_20241022_0_0_n_20_fmt_tool_call_verified_mini) |\n| gpt-4o-2024-11-20 | tool_call | messages | 是 | [32%](https:\u002F\u002Fexperiments.moatless.ai\u002Fevaluations\u002F20250119_azure_gpt_4o_0_0_n_20_fmt_tool_call_thoughts-in-action_1_verified_mini) |\n| gpt-4o-mini-2024-07-18 | tool_call | messages | 是 | [16%](https:\u002F\u002Fexperiments.moatless.ai\u002Fevaluations\u002F20250118_gpt_4o_mini_2024_07_18_0_0_n_20_fmt_tool_call_thoughts-in-action_6_verified_mini) |\n| o1-mini-2024-09-12 | react | react | 否（禁用思考） | [28%](https:\u002F\u002Fexperiments.moatless.ai\u002Fevaluations\u002F20250114_o1_mini_2024_09_12_0_0_n_20_fmt_react_hist_react_verified_mini) |\n| deepseek\u002Fdeepseek-chat | react | react | 否 | [36%](https:\u002F\u002Fexperiments.moatless.ai\u002Fevaluations\u002F20250118_deepseek_deepseek_chat_0_0_n_20_fmt_react_verified_mini) |\n| deepseek\u002Fdeepseek-reasoner | react | react | 否（禁用思考） | [50%](https:\u002F\u002Fexperiments.moatless.ai\u002Fevaluations\u002F20250120_deepseek_deepseek_reasoner_None_n_20_fmt_react_verified_mini) |\n| gemini\u002Fgemini-2.0-flash-exp | react | react | 否 | [38%](https:\u002F\u002Fexperiments.moatless.ai\u002Fevaluations\u002F20250119_gemini_gemini_2.0_flash_exp_0_0_n_20_fmt_react_verified_mini) |\n| openrouter\u002Fmeta-llama\u002Fllama-3.1-70b-instruct | react | react | 否 | - |\n| openrouter\u002Fmeta-llama\u002Fllama-3.1-405b-instruct | react | react | 否 | [28%](https:\u002F\u002Fexperiments.moatless.ai\u002Fevaluations\u002F20250119_openai_meta_llama_Meta_Llama_3.1_405B_Instruct_FP8_0_0_n_20_fmt_react_verified_mini) | - |\n| openrouter\u002Fqwen\u002Fqwen-2.5-coder-32b-instruct | react | react | 否 | [32%](https:\u002F\u002Fexperiments.moatless.ai\u002Fevaluations\u002F20250119_openai_Qwen_Qwen2.5_Coder_32B_Instruct_0_0_n_20_fmt_react_verified_mini) | - |\n\n## 数据集划分\n\n可通过 `--dataset-split` 参数指定的可用数据集划分如下：\n\n| 划分名称 | 描述 | 实例数量 |\n|------------|-------------|----------------|\n| lite | lite 数据集中的所有实例 | 300 | \n| verified | verified 数据集中的所有实例 | 500 | \n| verified_mini | [MariusHobbhahn\u002Fswe-bench-verified-mini](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002FMariusHobbhahn\u002Fswe-bench-verified-mini)，SWE-Bench Verified 的一个子集 | 50 |\n| lite_and_verified_solvable | 同时存在于 lite 和 verified 数据集中，且至少有一份在 SWE-Bench 上被成功解决的提交的实例 | 84 |\n\n## 使用示例\n```bash\n# 使用 Claude 3.5 Sonnet 运行评估，并采用完整的模型配置\npython3 scripts\u002Frun_evaluation.py \\\n  --model-id claude-3-5-sonnet-20241022 \\\n  --flow swebench_tools_and_reasoning \\\n  --dataset-split verified_mini \\\n  --num-parallel-jobs 5\n\n# 仅覆盖模型名称，同时保留流程的模型设置来运行评估\npython3 scripts\u002Frun_evaluation.py \\\n  --litellm-model-name openrouter\u002Fqwen\u002Fqwen-2.5-coder-32b-instruct \\\n  --flow swebench_react \\\n  --dataset-split verified_mini \\\n  --num-parallel-jobs 5","# Moatless Tools 快速上手指南\n\nMoatless Tools 是一个专注于利用大语言模型（LLM）在大型现有代码库中进行代码编辑的实验性项目。其核心理念是通过构建高效的工具来精准注入上下文并处理响应，而非单纯依赖 Agent 自行推理。该项目常用于 SWE-Bench 基准测试。\n\n## 环境准备\n\n在开始之前，请确保满足以下要求：\n\n*   **操作系统**: Linux 或 macOS（Windows 用户建议使用 WSL2 或 Docker Desktop）。\n*   **Docker**: 推荐使用 Docker 运行以获得最完整的体验（包含向量存储等服务）。\n*   **Python 环境**: 若选择本地安装，需 Python 3.10+。\n*   **API Keys**:\n    *   至少一个大模型提供商的 API Key（如 OpenAI, Anthropic, DeepSeek 等）。\n    *   **Voyage AI API Key**: 用于 SWE-Bench 评估时加载预嵌入的向量存储（必需）。\n*   **包管理工具** (可选但推荐):\n    *   `uv`: 用于从源码快速安装。\n    *   `poetry`: 项目原生依赖管理工具。\n\n> **国内开发者提示**: 如果遇到网络连接问题，建议配置 Docker 镜像加速器，或在 pip\u002Fuv 安装时使用国内镜像源（如清华源、阿里源）。\n\n## 安装步骤\n\n你可以选择以下三种方式之一进行安装：\n\n### 方式一：使用 Docker 运行（推荐）\n\n这是最简单且功能最完整的方式，自动处理所有依赖和服务。\n\n1.  **克隆仓库**:\n    ```bash\n    git clone https:\u002F\u002Fgithub.com\u002Faorwall\u002Fmoatless-tools.git\n    cd moatless-tools\n    ```\n\n2.  **配置环境变量**:\n    ```bash\n    cp .env.example .env\n    ```\n    编辑 `.env` 文件，填入你的 API Key 并配置数据目录：\n    ```bash\n    # 示例内容\n    ANTHROPIC_API_KEY=your_key_here\n    OPENAI_API_KEY=your_key_here\n    VOYAGE_API_KEY=your_key_here\n    \n    # 指定本地数据持久化目录\n    MOATLESS_DIR=\u002Fpath\u002Fto\u002Fyour\u002Fmoatless\u002Fdata\n    ```\n\n3.  **启动服务**:\n    ```bash\n    make run\n    ```\n    启动完成后，访问 http:\u002F\u002Flocalhost 即可使用 UI 界面。\n\n### 方式二：通过 PyPI 安装\n\n适用于仅需 Python 包功能的场景。\n\n```bash\n# 仅安装基础包\npip install moatless\n\n# 如需 Kubernetes 运行器支持\npip install \"moatless[kubernetes]\"\n```\n\n### 方式三：从源码安装 (使用 uv)\n\n适合需要修改代码或贡献项目的开发者。\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Faorwall\u002Fmoatless-tools.git\ncd moatless-tools\n\n# 使用 uv 同步依赖\nuv sync\n```\n\n## 基本使用\n\n### 1. 运行简单的 Agent 流程\n\n以下是一个基于 Python 的最小化示例，展示如何创建一个能够回答问题的简单 Agent。\n\n```python\nfrom moatless.actions import Respond\nfrom moatless.agent import ActionAgent\nfrom moatless.completion.tool_call import ToolCallCompletionModel\n\n# 初始化模型配置\ncompletion_model = ToolCallCompletionModel(\n    model=\"gpt-4.1-mini\",\n    temperature=0.0,\n    model_api_key=\"\" # 在此处填入你的 API Key 或通过环境变量设置\n)\n\n# 创建 Agent\nagent = ActionAgent(\n    completion_model=completion_model,\n    system_prompt=\"You are a helpful assistant that can answer questions.\",\n    actions=[\n        Respond()\n    ]\n)\n\n# 运行并获取结果\nobservation = await agent.run_simple(\"Hello\")\n\nprint(observation.message)\n```\n\n### 2. 运行 SWE-Bench 评估验证\n\n在安装完成后，建议先运行一个单例测试来验证环境配置是否正确。\n\n**验证命令**:\n```bash\nuv run python scripts\u002Fdocker_run.py  --flow swebench_tools --model-id gpt-4o-mini-2024-07-18 --instance-id django__django-11099 --evaluation-name testing_setup\n```\n*   该脚本将针对一个样本 SWE-Bench 实例运行模型。\n*   结果将保存在 `.moatless\u002Fprojects\u002Ftesting_setup` 目录中。\n\n**正式评估命令**:\n若需批量运行评估，可使用以下脚本：\n```bash\npython3 scripts\u002Frun_evaluation.py  --model gpt-4o-mini-2024-07-18 --dataset-split verified_mini --evaluation-name my_eval\n```\n\n**常用参数说明**:\n*   `--model-id`: 指定预设的模型配置 ID（如 `claude-3-5-sonnet-20241022`）。\n*   `--flow`: 指定工作流模式。\n    *   `swebench_tools`: 适用于支持原生 Function Calling 的模型。\n    *   `swebench_react`: 适用于不支持原生 Function Calling 的开源模型。\n*   `--dataset-split`: 数据集分区，推荐初学者使用 `verified_mini` (50 个实例) 进行快速测试。\n*   `--num-parallel-jobs`: 并行任务数，加速评估过程。","某后端团队需要在三天内修复一个拥有十年历史的大型 Django 项目中存在的复杂并发漏洞，该问题涉及多个模块的联动修改。\n\n### 没有 moatless-tools 时\n- 开发者需手动翻阅数万行代码定位上下文，极易遗漏关键依赖文件，导致修复方案片面。\n- 通用 AI 助手因缺乏项目全局视野，常产生“幻觉”代码或修改错误文件，人工验证成本极高。\n- 每次尝试修复都需重复构建环境并手动测试，迭代效率低下，难以在截止日期前完成验证。\n- 面对复杂的调用链，传统工具无法智能规划修改路径，往往陷入“改一处坏两处”的循环。\n\n### 使用 moatless-tools 后\n- moatless-tools 自动索引全量代码库，精准提取与漏洞相关的上下文片段，确保 AI 掌握完整信息。\n- 内置的智能代理结合蒙特卡洛树搜索（MCTS），能自主规划最优修改路径，直接生成可运行的补丁。\n- 通过在 Docker 中自动化执行 SWE-Bench 风格的验证流程，实时反馈修复结果，将试错周期从小时级缩短至分钟级。\n- 系统自动处理代码编辑中的边界情况，显著减少回归错误，让开发者只需关注最终逻辑确认。\n\nmoatless-tools 通过构建精准的上下文工程与自动化验证闭环，将大型遗留系统的代码修复从“大海捞针”转变为高效可控的标准化流程。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Faorwall_moatless-tools_21a37e3e.png","aorwall","Albert Örwall","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Faorwall_4f1db3ce.png","Stockholm","albert@moatless.ai","https:\u002F\u002Fgithub.com\u002Faorwall",[81,85,89,93,97,101],{"name":82,"color":83,"percentage":84},"Python","#3572A5",97.3,{"name":86,"color":87,"percentage":88},"Jupyter Notebook","#DA5B0B",1.6,{"name":90,"color":91,"percentage":92},"Shell","#89e051",0.8,{"name":94,"color":95,"percentage":96},"Scheme","#1e4aec",0.2,{"name":98,"color":99,"percentage":100},"Makefile","#427819",0.1,{"name":102,"color":103,"percentage":104},"Tree-sitter Query","#8ea64c",0,637,60,"2026-04-09T17:25:28","MIT","Linux, macOS","未说明",{"notes":112,"python":113,"dependencies":114},"该工具主要通过 Docker 运行评估任务，或使用 uv\u002Fpoetry 安装。运行 SWE-Bench 评估需要配置 LLM 提供商 API Key 和 Voyage AI API Key。支持多种模型工作流（如 function calling 和 ReACT），具体取决于所选模型。未明确提及本地 GPU 推理需求，主要依赖外部 API 或容器化环境。","未说明 (需使用 uv 或 Poetry 管理环境)",[115,116,117,118,119],"moatless","uv","poetry","litellm","docker",[35,14,13,15],[122,123,124,125,126,127],"ai","gpt-4","python","tree-sitter","code-gen","code-search","2026-03-27T02:49:30.150509","2026-04-20T04:05:11.130373",[131,136,141,146,151,155],{"id":132,"question_zh":133,"answer_zh":134,"source_url":135},43421,"运行项目时遇到 'Module' is not a valid CodeBlockType 错误怎么办？","该错误通常发生在 Google Colab、Mac 或 Lightning Studio 等环境中。维护者已确认并修复了此问题。如果您仍遇到此错误，请确保拉取了最新的代码版本。此前该问题与特定环境下的解析器兼容性有关。","https:\u002F\u002Fgithub.com\u002Faorwall\u002Fmoatless-tools\u002Fissues\u002F4",{"id":137,"question_zh":138,"answer_zh":139,"source_url":140},43422,"如何在 Moatless Tools 中集成本地 LLM（如 Ollama）？","可以通过 LiteLLM 后端集成本地模型。用户反馈需要更新 Notebook 以适配最新更改。此外，如果使用本地嵌入模型（如 HuggingFace），需手动配置 `IndexSettings`，例如：\n```python\nfrom llama_index.embeddings.huggingface import HuggingFaceEmbedding\nembed_model_name = \"sentence-transformers\u002Fall-MiniLM-L6-v2\"\nembed_model = HuggingFaceEmbedding(model_name=embed_model_name)\nindex_settings = IndexSettings(\n    embed_model=embed_model_name,\n    dimensions=384,\n)\n```\n注意：部分旧版 API（如 `workspace` 初始化参数和 `search_transitions`）可能已被移除或更改，请参考最新文档或源码。","https:\u002F\u002Fgithub.com\u002Faorwall\u002Fmoatless-tools\u002Fissues\u002F41",{"id":142,"question_zh":143,"answer_zh":144,"source_url":145},43423,"生成 Embeddings 时显示 '0\u002F0' 或没有生成任何向量，原因是什么？","这通常是由于在 Mac (ARM 架构) 上使用了不兼容的 `tree-sitter` 版本导致的。项目依赖 `tree-sitter-python==0.21.0`，但该版本不支持 ARM。建议切换到 Linux 机器运行，或者尝试修改源码中关于 `captures` 的处理逻辑（它可能是字典而非元组列表）。如果必须使用 Mac，可能需要等待官方支持或自行编译兼容版本的 tree-sitter。","https:\u002F\u002Fgithub.com\u002Faorwall\u002Fmoatless-tools\u002Fissues\u002F33",{"id":147,"question_zh":148,"answer_zh":149,"source_url":150},43424,"构建索引时遇到 'maximum context length' (超出最大上下文长度) 错误如何解决？","当处理大量实例时，OpenAI 的嵌入模型可能会超出 Token 限制。解决方案包括：\n1. 更换嵌入模型提供商，例如使用 Voyage AI，它们可能支持更长的上下文或不同的限制策略。\n2. 对实例进行排序以减少每次提交的变更量，从而降低索引时间：`instances = sorted(instances, key=lambda x: x[\"created_at\"])`。\n3. 参考官方提供的 ingestion notebook (`notebooks\u002Fingest.ipynb`) 查看最新的处理逻辑，尽管 OpenAIEmbedding 本身可能不支持直接截断参数。","https:\u002F\u002Fgithub.com\u002Faorwall\u002Fmoatless-tools\u002Fissues\u002F5",{"id":152,"question_zh":153,"answer_zh":154,"source_url":145},43425,"为什么在 Mac 上运行代码索引时会频繁出现 'too many values to unpack' 警告？","这是因为 Mac (ARM) 环境下无法安装项目指定的 `tree-sitter-python==0.21.0`，用户往往安装了更新的版本（如 0.23.2），导致解析器返回的数据结构（字典）与代码预期的结构（元组列表）不匹配。临时解决方法是切换到 Linux 环境，或者深入调试 `moatless\u002Fcodeblocks\u002Fparser\u002Fparser.py` 中的解析逻辑，将 `captures` 作为字典处理（使用 `.items()`），但这可能需要修改源代码。",{"id":156,"question_zh":157,"answer_zh":158,"source_url":140},43426,"Notebook 示例代码运行失败或报错，提示某些模块缺失或参数错误，该怎么办？","这通常是因为主分支的代码进行了重构，而 Notebook 示例未及时更新。例如，`Workspace` 类的初始化现在可能需要 `artifact list` 参数，且 `moatless.transitions` 中的 `search_transitions` 可能已被移除。建议检查项目的最新提交记录，或直接查看维护者最近更新的 Notebook 文件（如 `ingest.ipynb`）作为参考，不要完全依赖旧的示例代码。",[160],{"id":161,"version":162,"summary_zh":66,"released_at":163},343062,"0.0.2","2025-06-07T11:38:57"]