[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-smol-ai--developer":3,"tool-smol-ai--developer":61},[4,18,26,36,44,52],{"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 真正成长为懂上",141543,2,"2026-04-06T11:32:54",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"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 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107888,"2026-04-06T11:32:50",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":10,"last_commit_at":50,"category_tags":51,"status":17},4487,"LLMs-from-scratch","rasbt\u002FLLMs-from-scratch","LLMs-from-scratch 是一个基于 PyTorch 的开源教育项目，旨在引导用户从零开始一步步构建一个类似 ChatGPT 的大型语言模型（LLM）。它不仅是同名技术著作的官方代码库，更提供了一套完整的实践方案，涵盖模型开发、预训练及微调的全过程。\n\n该项目主要解决了大模型领域“黑盒化”的学习痛点。许多开发者虽能调用现成模型，却难以深入理解其内部架构与训练机制。通过亲手编写每一行核心代码，用户能够透彻掌握 Transformer 架构、注意力机制等关键原理，从而真正理解大模型是如何“思考”的。此外，项目还包含了加载大型预训练权重进行微调的代码，帮助用户将理论知识延伸至实际应用。\n\nLLMs-from-scratch 特别适合希望深入底层原理的 AI 开发者、研究人员以及计算机专业的学生。对于不满足于仅使用 API，而是渴望探究模型构建细节的技术人员而言，这是极佳的学习资源。其独特的技术亮点在于“循序渐进”的教学设计：将复杂的系统工程拆解为清晰的步骤，配合详细的图表与示例，让构建一个虽小但功能完备的大模型变得触手可及。无论你是想夯实理论基础，还是为未来研发更大规模的模型做准备",90106,"2026-04-06T11:19:32",[35,15,13,14],{"id":53,"name":54,"github_repo":55,"description_zh":56,"stars":57,"difficulty_score":10,"last_commit_at":58,"category_tags":59,"status":17},4292,"Deep-Live-Cam","hacksider\u002FDeep-Live-Cam","Deep-Live-Cam 是一款专注于实时换脸与视频生成的开源工具，用户仅需一张静态照片，即可通过“一键操作”实现摄像头画面的即时变脸或制作深度伪造视频。它有效解决了传统换脸技术流程繁琐、对硬件配置要求极高以及难以实时预览的痛点，让高质量的数字内容创作变得触手可及。\n\n这款工具不仅适合开发者和技术研究人员探索算法边界，更因其极简的操作逻辑（仅需三步：选脸、选摄像头、启动），广泛适用于普通用户、内容创作者、设计师及直播主播。无论是为了动画角色定制、服装展示模特替换，还是制作趣味短视频和直播互动，Deep-Live-Cam 都能提供流畅的支持。\n\n其核心技术亮点在于强大的实时处理能力，支持口型遮罩（Mouth Mask）以保留使用者原始的嘴部动作，确保表情自然精准；同时具备“人脸映射”功能，可同时对画面中的多个主体应用不同面孔。此外，项目内置了严格的内容安全过滤机制，自动拦截涉及裸露、暴力等不当素材，并倡导用户在获得授权及明确标注的前提下合规使用，体现了技术发展与伦理责任的平衡。",88924,"2026-04-06T03:28:53",[14,15,13,60],"视频",{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":67,"readme_en":68,"readme_zh":69,"quickstart_zh":70,"use_case_zh":71,"hero_image_url":72,"owner_login":73,"owner_name":74,"owner_avatar_url":75,"owner_bio":76,"owner_company":77,"owner_location":77,"owner_email":77,"owner_twitter":78,"owner_website":79,"owner_url":80,"languages":81,"stars":102,"forks":103,"last_commit_at":104,"license":105,"difficulty_score":32,"env_os":106,"env_gpu":107,"env_ram":107,"env_deps":108,"category_tags":116,"github_topics":77,"view_count":32,"oss_zip_url":77,"oss_zip_packed_at":77,"status":17,"created_at":117,"updated_at":118,"faqs":119,"releases":150},4529,"smol-ai\u002Fdeveloper","developer","the first library to let you embed a developer agent in your own app!","smol developer 是一款开源库，旨在让开发者将\"AI 初级程序员”智能体嵌入到自己的应用中。它不仅能根据产品需求说明自动生成完整的项目代码框架，还能作为基础模块，帮助你在自己的软件里构建具备编程能力的 AI 助手。\n\n传统脚手架工具（如 create-react-app）往往固定且僵化，而 smol developer 通过“人机协作”模式解决了这一痛点。用户只需提供初始需求，AI 即可生成代码；若运行出错或需求变更，用户可像提交 GitHub Issue 一样将错误或补充信息反馈给 AI，由其迭代修复。这种工作流强调“以提示词进行工程开发”，让人类始终掌握主导权，在 AI 提效的同时随时接管代码，避免了过度依赖黑盒生成。\n\n该工具特别适合希望提升原型开发效率的软件工程师、独立开发者以及想要在自己的产品中集成代码生成功能的技术团队。其独特亮点在于采用了“整体程序合成”策略，能够理解并生成连贯的整站代码，而非零散片段。此外，项目经过重构后更加轻量，既支持直接在 Git 仓库中运行以快速构建应用，也支持作为 Python 库（pip install smol_dev）灵活调用，","smol developer 是一款开源库，旨在让开发者将\"AI 初级程序员”智能体嵌入到自己的应用中。它不仅能根据产品需求说明自动生成完整的项目代码框架，还能作为基础模块，帮助你在自己的软件里构建具备编程能力的 AI 助手。\n\n传统脚手架工具（如 create-react-app）往往固定且僵化，而 smol developer 通过“人机协作”模式解决了这一痛点。用户只需提供初始需求，AI 即可生成代码；若运行出错或需求变更，用户可像提交 GitHub Issue 一样将错误或补充信息反馈给 AI，由其迭代修复。这种工作流强调“以提示词进行工程开发”，让人类始终掌握主导权，在 AI 提效的同时随时接管代码，避免了过度依赖黑盒生成。\n\n该工具特别适合希望提升原型开发效率的软件工程师、独立开发者以及想要在自己的产品中集成代码生成功能的技术团队。其独特亮点在于采用了“整体程序合成”策略，能够理解并生成连贯的整站代码，而非零散片段。此外，项目经过重构后更加轻量，既支持直接在 Git 仓库中运行以快速构建应用，也支持作为 Python 库（pip install smol_dev）灵活调用，让每位开发者都能拥有专属的智能化编程搭档。","# 🐣 smol developer\n\n\u003Ca href=\"https:\u002F\u002Fapp.e2b.dev\u002Fagent\u002Fsmol-developer\" target=\"_blank\" rel=\"noopener noreferrer\">\n\u003Cpicture>\n  \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"https:\u002F\u002Fapp.e2b.dev\u002Fapi\u002Fbadge_light\">\n  \u003Cimg alt=\"Deploy agent on e2b button\" src=\"https:\u002F\u002Fapp.e2b.dev\u002Fapi\u002Fbadge\"\u002F>\n\u003C\u002Fpicture>\n\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fmodal-labs\u002Fdevlooper\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsmol-ai_developer_readme_2e604cf3d198.png\">\u003C\u002Fimg>\n\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Ftwitter.com\u002Fmorph_labs\u002Fstatus\u002F1689321673151979536\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsmol-ai_developer_readme_55fea4e2b6f7.png\" alt=\"Morph\">\u003C\u002Fimg> Morph\n\u003C\u002Fa>\n\n***Human-centric & Coherent Whole Program Synthesis*** aka your own personal junior developer\n\n> [Build the thing that builds the thing!](https:\u002F\u002Ftwitter.com\u002Fswyx\u002Fstatus\u002F1657578738345979905) a `smol dev` for every dev in every situation\n\nThis is a \"junior developer\" agent (aka `smol dev`) that either:\n\n1. scaffolds an entire codebase out for you once you give it a product spec\n2. gives you basic building blocks to have a smol developer inside of your own app.\n\nInstead of making and maintaining specific, rigid, one-shot starters, like `create-react-app`, or `create-nextjs-app`, this is basically is or helps you make [`create-anything-app`](https:\u002F\u002Fnews.ycombinator.com\u002Fitem?id=35942352) where you develop your scaffolding prompt in a tight loop with your smol dev.\n\nAfter the [successful initial v0 launch](https:\u002F\u002Ftwitter.com\u002Fswyx\u002Fstatus\u002F1657578738345979905), smol developer was rewritten to be **even smol-ler**, and importable from a library!\n\n## Basic Usage\n\n### In Git Repo mode\n\n```bash\n# install\ngit clone https:\u002F\u002Fgithub.com\u002Fsmol-ai\u002Fdeveloper.git\ncd developer\npoetry install # install dependencies. pip install poetry if you need\n\n# run\npython main.py \"a HTML\u002FJS\u002FCSS Tic Tac Toe Game\" # defaults to gpt-4-0613\n# python main.py \"a HTML\u002FJS\u002FCSS Tic Tac Toe Game\" --model=gpt-3.5-turbo-0613\n\n# other cli flags\npython main.py --prompt prompt.md # for longer prompts, move them into a markdown file\npython main.py --prompt prompt.md --debug True # for debugging\n```\n\n\u003Cdetails>\n  \u003Csummary>\nThis lets you develop apps as a human in the loop, as per the original version of smol developer.\n  \u003C\u002Fsummary>\n\n\n\u003Cp align=\"center\">\n  \u003Cimg height=200 src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsmol-ai_developer_readme_61118af3034c.png\" \u002F>\n\u003C\u002Fp>\n\n*engineering with prompts, rather than prompt engineering*\n\nThe demo example in `prompt.md` shows the potential of AI-enabled, but still firmly human developer centric, workflow:\n\n- Human writes a basic prompt for the app they want to build\n- `main.py` generates code\n- Human runs\u002Freads the code\n- Human can:\n  - simply add to the prompt as they discover underspecified parts of the prompt\n  - manually runs the code and identifies errors\n  - *paste the error into the prompt* just like they would file a GitHub issue\n  - for extra help, they can use `debugger.py` which reads the whole codebase to make specific code change suggestions\n\nLoop until happiness is attained. Notice that AI is only used as long as it is adding value - once it gets in your way, just take over the codebase from your smol junior developer with no fuss and no hurt feelings. (*we could also have smol-dev take over an existing codebase and bootstrap its own prompt... but that's a Future Direction*)\n\n\u003C\u002Fdetails>\n\nIn this way you can use your clone of this repo itself to prototype\u002Fdevelop your app.\n\n### In Library mode\n\nThis is the new thing in smol developer v1! Add `smol developer` to your own projects!\n\n```bash\npip install smol_dev\n```\n\nHere you can basically look at the contents of `main.py` as our \"documentation\" of how you can use these functions and prompts in your own app:\n\n```python\nfrom smol_dev.prompts import plan, specify_file_paths, generate_code_sync\n\nprompt = \"a HTML\u002FJS\u002FCSS Tic Tac Toe Game\"\n\nshared_deps = plan(prompt) # returns a long string representing the coding plan\n\n# do something with the shared_deps plan if you wish, for example ask for user confirmation\u002Fedits and iterate in a loop\n\nfile_paths = specify_file_paths(prompt, shared_deps) # returns an array of strings representing the filenames it needs to write based on your prompt and shared_deps. Relies on OpenAI's new Function Calling API to guarantee JSON.\n\n# do something with the filepaths if you wish, for example display a plan\n\n# loop through file_paths array and generate code for each file\nfor file_path in file_paths:\n    code = generate_code_sync(prompt, shared_deps, file_path) # generates the source code of each file\n\n    # do something with the source code of the file, eg. write to disk or display in UI\n    # there is also an async `generate_code()` version of this\n```\n\n### In API mode (via [Agent Protocol](https:\u002F\u002Fgithub.com\u002Fe2b-dev\u002Fagent-protocol))\nTo start the server run:\n```bash\npoetry run api\n```\nor\n```bash\npython smol_dev\u002Fapi.py\n```\n\nand then you can call the API using either the following commands:\n\nTo **create a task** run:\n```bash\ncurl --request POST \\\n  --url http:\u002F\u002Flocalhost:8000\u002Fagent\u002Ftasks \\\n  --header 'Content-Type: application\u002Fjson' \\\n  --data '{\n\t\"input\": \"Write simple script in Python. It should write '\\''Hello world!'\\'' to hi.txt\"\n}'\n```\n\nYou will get a response like this:\n```json\n{\"input\":\"Write simple script in Python. It should write 'Hello world!' to hi.txt\",\"task_id\":\"d2c4e543-ae08-4a97-9ac5-5f9a4459cb19\",\"artifacts\":[]}\n```\n\nThen to **execute one step of the task** copy the `task_id` you got from the previous request and run:\n\n```bash\ncurl --request POST \\\n  --url http:\u002F\u002Flocalhost:8000\u002Fagent\u002Ftasks\u002F\u003Ctask-id>\u002Fsteps\n```\n\nor you can use [Python client library](https:\u002F\u002Fgithub.com\u002Fe2b-dev\u002Fagent-protocol\u002Ftree\u002Fmain\u002Fagent_client\u002Fpython):\n\n```python\nfrom agent_protocol_client import AgentApi, ApiClient, TaskRequestBody\n\n...\n\nprompt = \"Write simple script in Python. It should write 'Hello world!' to hi.txt\"\n\nasync with ApiClient() as api_client:\n    # Create an instance of the API class\n    api_instance = AgentApi(api_client)\n    task_request_body = TaskRequestBody(input=prompt)\n\n    task = await api_instance.create_agent_task(\n        task_request_body=task_request_body\n    )\n    task_id = task.task_id\n    response = await api_instance.execute_agent_task_step(task_id=task_id)\n\n...\n\n```\n\n## examples\u002Fprompt gallery\n\n- [6 minute video demo](https:\u002F\u002Fyoutu.be\u002FUCo7YeTy-aE) - (sorry for sped up audio, we were optimizing for twitter, bad call)\n  - this was the original smol developer demo - going from prompt to full chrome extension that requests and stores and apikey, generates a popup window, reads and transmits page content, and usefully summarizes any website with Anthropic Claude, switching models up to the 100k one based on length of input\n  - the prompt is located in [prompt.md](https:\u002F\u002Fgithub.com\u002Fsmol-ai\u002Fdeveloper\u002Fblob\u002Fmain\u002Fprompt.md) and it outputs [\u002FexampleChromeExtension](https:\u002F\u002Fgithub.com\u002Fsmol-ai\u002Fdeveloper\u002Ftree\u002Fmain\u002Fexamples\u002FexampleChromeExtension)\n- `smol-plugin` - prompt to ChatGPT plugin ([tweet](https:\u002F\u002Ftwitter.com\u002Fultrasoundchad\u002Fstatus\u002F1659366507409985536?s=20), [fork](https:\u002F\u002Fgithub.com\u002Fgmchad\u002Fsmol-plugin))\n\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsmol-ai_developer_readme_4bc21caaf6e0.png\" height=200 \u002F>\n\n- [Prompt to Pokemon App](https:\u002F\u002Ftwitter.com\u002FRobertCaracaus\u002Fstatus\u002F1659312419485761536?s=20)\n\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsmol-ai_developer_readme_1d4b4c486b66.png\" height=200 \u002F>\n\n- [Political Campaign CRM Program example](https:\u002F\u002Fgithub.com\u002Fsmol-ai\u002Fdeveloper\u002Fpull\u002F22\u002Ffiles)\n- [Lessons from Creating a VSCode Extension with GPT-4](https:\u002F\u002Fbit.kevinslin.com\u002Fp\u002Fleveraging-gpt-4-to-automate-the) (also on [HN](https:\u002F\u002Fnews.ycombinator.com\u002Fitem?id=36071342))\n- [7 min Video: Smol AI Developer - Build ENTIRE Codebases With A Single Prompt](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=DzRoYc2UGKI) produces a full working OpenAI CLI python app from a prompt\n\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsmol-ai_developer_readme_c0d12325581a.png\" height=200 \u002F>\n\n- [12 min Video: SMOL AI - Develop Large Scale Apps with AGI in one click](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=zsxyqz6SYp8) scaffolds a surprisingly complex React\u002FNode\u002FMongoDB full stack app in 40 minutes and $9\n\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsmol-ai_developer_readme_cea44de321b0.png\" height=200 \u002F>\n\nI'm actively seeking more examples, please PR yours!\n\nsorry for the lack of examples, I know that is frustrating but I wasnt ready for so many of you lol\n\n## major forks\u002Falternatives\n\nplease send in alternative implementations, and deploy strategies on alternative stacks!\n\n- **JS\u002FTS**: https:\u002F\u002Fgithub.com\u002FPicoCreator\u002Fsmol-dev-js A pure JS variant of smol-dev, allowing even smoler incremental changes via prompting (if you dun want to do the whole spec2code thing), allowing you to plug it into any project live (for better or worse)\n- **C#\u002FDotnet**: https:\u002F\u002Fgithub.com\u002Fcolhountech\u002Fsmol-ai-dotnet in C#!\n- **Golang**: https:\u002F\u002Fgithub.com\u002Ftmc\u002Fsmol-dev-go in Go\n- https:\u002F\u002Fgithub.com\u002Fgmchad\u002Fsmol-plugin automatically generate @openai plugins by specifying your API in markdown in smol-developer style\n- your fork here!\n\n\n### innovations and insights\n\n> Please subscribe to https:\u002F\u002Flatent.space\u002F for a fuller writeup and insights and reflections\n\n- **Markdown is all you need** - Markdown is the perfect way to prompt for whole program synthesis because it is easy to mix english and code (whether `variable_names` or entire \\`\\`\\` code fenced code samples)\n  - turns out you can specify prompts in code in prompts and gpt4 obeys that to the letter\n- **Copy and paste programming**\n  - teaching the program to understand how to code around a new API (Anthropic's API is after GPT3's knowledge cutoff) by just pasting in the `curl` input and output\n  - pasting error messages into the prompt and vaguely telling the program how you'd like it handled. it kind of feels like \"logbook driven programming\".\n- **Debugging by `cat`ing** the whole codebase with your error message and getting specific fix suggestions - particularly delightful!\n- **Tricks for whole program coherence** - our chosen example usecase, Chrome extensions, have a lot of indirect dependencies across files. Any hallucination of cross dependencies causes the whole program to error.\n  - We solved this by adding an intermediate step asking GPT to think through `shared_dependencies.md`, and then insisting on using that in generating each file. This basically means GPT is able to talk to itself...\n  - ... but it's not perfect, yet. `shared_dependencies.md` is sometimes not comperehensive in understanding what are hard dependencies between files. So we just solved it by specifying a specific `name` in the prompt. felt dirty at first but it works, and really it's just clear unambiguous communication at the end of the day.\n  - see `prompt.md` for SOTA smol-dev prompting\n- **Low activation energy for unfamiliar APIs**\n  - we have never really learned css animations, but now can just say we want a \"juicy css animated red and white candy stripe loading indicator\" and it does the thing.\n  - ditto for Chrome Extension Manifest v3 - the docs are an abject mess, but fortunately we don't have to read them now to just get a basic thing done\n  - the Anthropic docs (bad bad) were missing guidance on what return signature they have. so just curl it and dump it in the prompt lol.\n- **Modal is all you need** - we chose Modal to solve 4 things:\n  - solve python dependency hell in dev and prod\n  - parallelizable code generation\n  - simple upgrade path from local dev to cloud hosted endpoints (in future)\n  - fault tolerant openai api calls with retries\u002Fbackoff, and attached storage (for future use)\n\n> Please subscribe to https:\u002F\u002Flatent.space\u002F for a fuller writeup and insights and reflections\n\n### caveats\n\nWe were working on a Chrome Extension, which requires images to be generated, so we added some usecase specific code in there to skip destroying\u002Fregenerating them, that we haven't decided how to generalize.\n\nWe dont have access to GPT4-32k, but if we did, we'd explore dumping entire API\u002FSDK documentation into context.\n\nThe feedback loop is very slow right now (`time` says about 2-4 mins to generate a program with GPT4, even with parallelization due to Modal (occasionally spiking higher)), but it's a safe bet that it will go down over time (see also \"future directions\" below).\n\n\n## future directions\n\nthings to try\u002Fwould accept open issue discussions and PRs:\n\n- **specify .md files for each generated file**, with further prompts that could finetune the output in each of them\n  - so basically like `popup.html.md` and `content_script.js.md` and so on\n- **bootstrap the `prompt.md`** for existing codebases - write a script to read in a codebase and write a descriptive, bullet pointed prompt that generates it\n  - done by `smol pm`, but its not very good yet - would love for some focused polish\u002Feffort until we have quine smol developer that can generate itself lmao\n- **ability to install its own dependencies**\n  - this leaks into depending on the execution environment, which we all know is the path to dependency madness. how to avoid? dockerize? nix? [web container](https:\u002F\u002Ftwitter.com\u002Flitbid\u002Fstatus\u002F1658154530385670150)?\n  - Modal has an interesting possibility: generate functions that speak modal which also solves the dependency thing https:\u002F\u002Ftwitter.com\u002Fakshat_b\u002Fstatus\u002F1658146096902811657\n- **self-heal** by running the code itself and use errors as information for reprompting\n  - however its a bit hard to get errors from the chrome extension environment so we did not try this\n- **using anthropic as the coding layer**\n  - you can run `modal run anthropic.py --prompt prompt.md --outputdir=anthropic` to try it\n  - but it doesnt work because anthropic doesnt follow instructions to generate file code very well.\n- **make agents that autonomously run this code in a loop\u002Fwatch the prompt file** and regenerate code each time, on a new git branch\n  - the code could be generated on 5 simultaneous git branches and checking their output would just involve switching git branches\n","# 🐣 小开发者\n\n\u003Ca href=\"https:\u002F\u002Fapp.e2b.dev\u002Fagent\u002Fsmol-developer\" target=\"_blank\" rel=\"noopener noreferrer\">\n\u003Cpicture>\n  \u003Csource media=\"(prefers-color-scheme: dark)\" srcset=\"https:\u002F\u002Fapp.e2b.dev\u002Fapi\u002Fbadge_light\">\n  \u003Cimg alt=\"在 e2b 上部署代理按钮\" src=\"https:\u002F\u002Fapp.e2b.dev\u002Fapi\u002Fbadge\"\u002F>\n\u003C\u002Fpicture>\n\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fmodal-labs\u002Fdevlooper\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsmol-ai_developer_readme_2e604cf3d198.png\">\u003C\u002Fimg>\n\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Ftwitter.com\u002Fmorph_labs\u002Fstatus\u002F1689321673151979536\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsmol-ai_developer_readme_55fea4e2b6f7.png\" alt=\"Morph\">\u003C\u002Fimg> Morph\n\u003C\u002Fa>\n\n***以人为核心、连贯的整体程序合成***，也就是你专属的初级开发人员\n\n> [构建能构建一切的东西！](https:\u002F\u002Ftwitter.com\u002Fswyx\u002Fstatus\u002F1657578738345979905) 为每个开发者在每种情况下提供一个“小开发者”\n\n这是一个“初级开发人员”代理（即 `smol dev`），它可以：\n\n1. 在你提供产品规格后，为你搭建整个代码库；\n2. 提供基础构建模块，让你在自己的应用中拥有一个小开发者。\n\n与其像 `create-react-app` 或 `create-nextjs-app` 那样制作和维护特定的、僵化的、一次性使用的脚手架，不如直接使用或帮助你创建 [`create-anything-app`](https:\u002F\u002Fnews.ycombinator.com\u002Fitem?id=35942352)，让你与你的小开发者一起，在紧密的循环中不断优化你的脚手架提示。\n\n在[成功的初始 v0 版本发布](https:\u002F\u002Ftwitter.com\u002Fswyx\u002Fstatus\u002F1657578738345979905)之后，小开发者被重写得**更加精简**，并且可以作为库导入！\n\n## 基本用法\n\n### 在 Git 仓库模式下\n\n```bash\n# 安装\ngit clone https:\u002F\u002Fgithub.com\u002Fsmol-ai\u002Fdeveloper.git\ncd developer\npoetry install # 安装依赖。如果需要，也可以使用 pip install poetry\n\n# 运行\npython main.py \"一个 HTML\u002FJS\u002FCSS 井字游戏\" # 默认使用 gpt-4-0613\n# python main.py \"一个 HTML\u002FJS\u002FCSS 井字游戏\" --model=gpt-3.5-turbo-0613\n\n# 其他命令行参数\npython main.py --prompt prompt.md # 对于较长的提示，可以将其放入 Markdown 文件中\npython main.py --prompt prompt.md --debug True # 用于调试\n```\n\n\u003Cdetails>\n  \u003Csummary>\n这让你能够按照小开发者原始版本的方式，以人类参与的闭环方式开发应用。\n  \u003C\u002Fsummary>\n\n\n\u003Cp align=\"center\">\n  \u003Cimg height=200 src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsmol-ai_developer_readme_61118af3034c.png\" \u002F>\n\u003C\u002Fp>\n\n*用提示进行工程设计，而非单纯的提示工程*\n\n`prompt.md` 中的演示示例展示了由 AI 支持、但仍以开发者为中心的工作流的潜力：\n\n- 开发者编写一个关于想要构建的应用的基本提示；\n- `main.py` 生成代码；\n- 开发者运行并阅读代码；\n- 开发者可以：\n  - 在发现提示中未明确的部分时，简单地补充提示内容；\n  - 手动运行代码并找出错误；\n  - *将错误信息粘贴到提示中*，就像提交 GitHub 问题一样；\n  - 如果需要更多帮助，还可以使用 `debugger.py`，它会读取整个代码库，提出具体的代码修改建议。\n\n循环往复，直到满意为止。请注意，AI 只有在真正带来价值时才会被使用——一旦它妨碍了你的工作，你就可以毫不费力、不伤感情地接管代码库，完全摆脱这个小助手。（*我们也可以让小开发者接管现有的代码库，并自行生成提示……但这属于未来的发展方向*）\n\n通过这种方式，你可以使用这个仓库的副本本身来原型化或开发你的应用。\n\n### 库模式\n\n这是小开发者 v1 的新功能！将 `smol developer` 添加到你自己的项目中！\n\n```bash\npip install smol_dev\n```\n\n在这里，你可以将 `main.py` 的内容视为我们关于如何在你自己的应用中使用这些函数和提示的“文档”：\n\n```python\nfrom smol_dev.prompts import plan, specify_file_paths, generate_code_sync\n\nprompt = \"一个 HTML\u002FJS\u002FCSS 井字游戏\"\n\nshared_deps = plan(prompt) # 返回一个长字符串，表示编码计划\n\n# 如果需要，可以对 shared_deps 计划做些处理，比如请求用户确认或编辑，并循环迭代\n\nfile_paths = specify_file_paths(prompt, shared_deps) # 返回一个字符串数组，表示根据你的提示和 shared_deps 需要编写的文件名。依赖 OpenAI 新的 Function Calling API 来保证输出为 JSON 格式。\n\n# 如果需要，可以对 filepaths 做些处理，比如展示计划\n\n# 遍历 file_paths 数组，为每个文件生成代码\nfor file_path in file_paths:\n    code = generate_code_sync(prompt, shared_deps，file_path) # 为每个文件生成源代码\n\n    # 对文件的源代码做些处理，例如写入磁盘或在 UI 中显示\n    # 此外还有一个异步版本的 `generate_code()`\n```\n\n### API 模式（通过 [Agent Protocol](https:\u002F\u002Fgithub.com\u002Fe2b-dev\u002Fagent-protocol)）\n要启动服务器，请运行：\n```bash\npoetry run api\n```\n或者\n```bash\npython smol_dev\u002Fapi.py\n```\n\n然后你可以使用以下命令调用 API：\n\n要**创建任务**，运行：\n```bash\ncurl --request POST \\\n  --url http:\u002F\u002Flocalhost:8000\u002Fagent\u002Ftasks \\\n  --header 'Content-Type: application\u002Fjson' \\\n  --data '{\n\t\"input\": \"用 Python 编写一个简单的脚本。它应该将 'Hello world!' 写入 hi.txt\"\n}'\n```\n\n你会得到如下响应：\n```json\n{\"input\":\"用 Python 编写一个简单的脚本。它应该将 'Hello world!' 写入 hi.txt\",\"task_id\":\"d2c4e543-ae08-4a97-9ac5-5f9a4459cb19\",\"artifacts\":[]}\n```\n\n然后，要**执行任务的一个步骤**，复制上一步请求中获得的 `task_id`，并运行：\n\n```bash\ncurl --request POST \\\n  --url http:\u002F\u002Flocalhost:8000\u002Fagent\u002Ftasks\u002F\u003Ctask-id>\u002Fsteps\n```\n\n或者你也可以使用 [Python 客户端库](https:\u002F\u002Fgithub.com\u002Fe2b-dev\u002Fagent-protocol\u002Ftree\u002Fmain\u002Fagent_client\u002Fpython)：\n\n```python\nfrom agent_protocol_client import AgentApi，ApiClient，TaskRequestBody\n\n...\n\nprompt = \"用 Python 编写一个简单的脚本。它应该将 'Hello world!' 写入 hi.txt\"\n\nasync with ApiClient() as api_client:\n    # 创建 API 类的实例\n    api_instance = AgentApi(api_client)\n    task_request_body = TaskRequestBody(input=prompt)\n\n    task = await api_instance.create_agent_task(\n        task_request_body=task_request_body\n    )\n    task_id = task.task_id\n    response = await api_instance.execute_agent_task_step(task_id=task_id)\n\n...\n\n```\n\n## 示例\u002F提示词库\n\n- [6分钟视频演示](https:\u002F\u002Fyoutu.be\u002FUCo7YeTy-aE) - （抱歉音频加速了，当时我们为了推特优化，是个失误）\n  - 这是最初的 smol 开发者演示——从提示词到完整的 Chrome 扩展程序，该扩展会请求并存储 API 密钥、生成弹出窗口、读取并传输页面内容，并利用 Anthropic Claude 将任意网站进行有用总结；根据输入文本的长度，模型还会切换到支持 10 万 token 的版本。\n  - 提示词位于 [prompt.md](https:\u002F\u002Fgithub.com\u002Fsmol-ai\u002Fdeveloper\u002Fblob\u002Fmain\u002Fprompt.md)，输出结果为 [\u002FexampleChromeExtension](https:\u002F\u002Fgithub.com\u002Fsmol-ai\u002Fdeveloper\u002Ftree\u002Fmain\u002Fexamples\u002FexampleChromeExtension)。\n- `smol-plugin` —— 用于 ChatGPT 插件的提示词（[推文](https:\u002F\u002Ftwitter.com\u002Fultrasoundchad\u002Fstatus\u002F1659366507409985536?s=20)、[分叉](https:\u002F\u002Fgithub.com\u002Fgmchad\u002Fsmol-plugin)）\n\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsmol-ai_developer_readme_4bc21caaf6e0.png\" height=200 \u002F>\n\n- [提示词生成宝可梦应用](https:\u002F\u002Ftwitter.com\u002FRobertCaracaus\u002Fstatus\u002F1659312419485761536?s=20)\n\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsmol-ai_developer_readme_1d4b4c486b66.png\" height=200 \u002F>\n\n- [政治竞选 CRM 程序示例](https:\u002F\u002Fgithub.com\u002Fsmol-ai\u002Fdeveloper\u002Fpull\u002F22\u002Ffiles)\n- [使用 GPT-4 创建 VSCode 扩展的经验教训](https:\u002F\u002Fbit.kevinslin.com\u002Fp\u002Fleveraging-gpt-4-to-automate-the)（也在 [HN](https:\u002F\u002Fnews.ycombinator.com\u002Fitem?id=36071342) 上发布）\n- [7 分钟视频：Smol AI Developer —— 仅用一条提示词构建完整代码库](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=DzRoYc2UGKI)，从提示词生成一个可运行的 OpenAI CLI Python 应用程序。\n\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsmol-ai_developer_readme_c0d12325581a.png\" height=200 \u002F>\n\n- [12 分钟视频：SMOL AI —— 一键使用 AGI 开发大型应用](https:\u002F\u002Fwww.youtube.com\u002Fwatch?v=zsxyqz6SYp8)，在 40 分钟内以 9 美元搭建了一个相当复杂的 React\u002FNode\u002FMongoDB 全栈应用。\n\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsmol-ai_developer_readme_cea44de321b0.png\" height=200 \u002F>\n\n我正在积极寻找更多示例，请提交你的 PR！\n\n抱歉示例不多，我知道这让人沮丧，但当时我真没想到会有这么多人参与，哈哈。\n\n## 主要分叉\u002F替代方案\n\n请提交替代实现和在不同技术栈上的部署策略！\n\n- **JS\u002FTS**：https:\u002F\u002Fgithub.com\u002FPicoCreator\u002Fsmol-dev-js smol-dev 的纯 JavaScript 变体，允许通过提示词进行更细粒度的增量修改（如果你不想一次性完成整个 spec2code 流程），从而可以将它实时接入任何项目中（无论好坏）。\n- **C#\u002FDotnet**：https:\u002F\u002Fgithub.com\u002Fcolhountech\u002Fsmol-ai-dotnet 用 C# 实现！\n- **Golang**：https:\u002F\u002Fgithub.com\u002Ftmc\u002Fsmol-dev-go 用 Go 实现。\n- https:\u002F\u002Fgithub.com\u002Fgmchad\u002Fsmol-plugin 可以按照 smol-developer 风格，在 Markdown 中指定 API，自动生成 @openai 插件。\n- 您的分叉也欢迎提交！\n\n\n### 创新与洞见\n\n> 请订阅 https:\u002F\u002Flatent.space\u002F 获取更详细的说明、见解和反思。\n\n- **只需 Markdown 即可** —— Markdown 是进行完整程序合成的理想提示方式，因为它能轻松混合英文和代码（无论是 `variable_names` 还是完整的 \\`\\`\\` 代码块）。\n  - 结果发现，你甚至可以在提示词中嵌入代码来指定指令，而 GPT-4 会完全照做。\n- **复制粘贴式编程**\n  - 通过简单地粘贴 `curl` 请求和响应，教会程序如何围绕新的 API 编写代码（Anthropic 的 API 在 GPT3 的知识截止点之后）。\n  - 将错误信息粘贴到提示词中，再模糊地告诉程序该如何处理。这种感觉有点像“日志驱动编程”。\n- **通过 `cat` 查看整个代码库并结合错误信息进行调试**，进而获得具体的修复建议——这尤其令人愉悦！\n- **保持整个程序连贯性的技巧** —— 我们选择的示例用例是 Chrome 扩展，其中文件之间存在大量间接依赖关系。一旦出现跨文件依赖的幻觉，整个程序就会报错。\n  - 我们通过增加一个中间步骤来解决这个问题：让 GPT 思考 `shared_dependencies.md`，然后坚持在每个文件的生成过程中都使用这份文件。这实际上相当于让 GPT 自己与自己对话……\n  - ……不过目前还不完美。`shared_dependencies.md` 有时无法全面理解文件之间的硬性依赖关系。因此，我们直接在提示词中明确指定一个特定的 `name`。起初觉得有些“脏”，但确实有效，归根结底还是清晰明确的沟通而已。\n  - 更多关于 SOTA smol-dev 提示词的内容，请参阅 `prompt.md`。\n- **降低对陌生 API 的学习门槛**\n  - 我们从未真正学过 CSS 动画，但现在只要说想要一个“充满活力的红白条纹加载指示器”，它就能搞定。\n  - 同样的情况也适用于 Chrome 扩展 Manifest v3——文档简直一团糟，但幸运的是，我们现在不需要阅读它们就能完成基本功能。\n  - Anthropic 的文档（非常糟糕）缺少关于返回签名的指导。于是我们就直接把 curl 响应丢进提示词里，哈哈。\n- **Modal 就够了** —— 我们选择 Modal 是为了解决以下四个问题：\n  - 解决开发和生产环境中的 Python 依赖地狱；\n  - 实现代码生成的并行化；\n  - 提供从本地开发到云端托管端点的简单升级路径（未来）；\n  - 实现具有重试\u002F退避机制的容错型 OpenAI API 调用，并附带存储功能（供未来使用）。\n\n> 请订阅 https:\u002F\u002Flatent.space\u002F 获取更详细的说明、见解和反思。\n\n### 注意事项\n\n我们当时是在开发 Chrome 扩展，需要生成图片资源，因此加入了一些特定于用例的代码来避免重复生成或销毁这些图片，但我们尚未决定如何将其通用化。\n\n我们目前无法访问 GPT-4-32k，但如果可以的话，我们会尝试将整个 API\u002FSDK 文档作为上下文注入进去。\n\n当前的反馈循环非常缓慢（使用 `time` 测试显示，即使借助 Modal 实现并行化，用 GPT-4 生成一个程序仍需约 2–4 分钟，偶尔还会更高），但可以肯定的是，随着时间的推移，这个时间会逐渐缩短（详见下文“未来方向”）。\n\n## 未来方向\n\n待尝试的事项\u002F欢迎讨论和提交 PR 的开放问题：\n\n- **为每个生成的文件指定 `.md` 文件**，并在其中提供进一步的提示，以便对输出进行微调。\n  - 比如 `popup.html.md`、`content_script.js.md` 等等。\n- **为现有代码库自动生成 `prompt.md`**：编写一个脚本，读取代码库内容，并生成一段描述性的、项目符号列表形式的提示，用于重新生成该代码库。\n  - 目前由 `smol pm` 实现了这一功能，但效果还不太理想。希望能有更多专注的打磨和努力，直到我们能实现一个能够自我生成的“Quine 式小开发者”为止，哈哈。\n- **具备安装自身依赖的能力**：\n  - 这会涉及到对运行环境的依赖，而众所周知，这很容易导致依赖地狱。该如何避免呢？是使用 Docker 容器化？还是采用 Nix 包管理工具？亦或是参考 [web container](https:\u002F\u002Ftwitter.com\u002Flitbid\u002Fstatus\u002F1658154530385670150)？\n  - Modal 提供了一种有趣的思路：生成能够与 Modal 对话的函数，这样也能解决依赖问题。详情见：[https:\u002F\u002Ftwitter.com\u002Fakshat_b\u002Fstatus\u002F1658146096902811657](https:\u002F\u002Ftwitter.com\u002Fakshat_b\u002Fstatus\u002F1658146096902811657)。\n- **自我修复能力**：通过实际运行生成的代码，并将错误信息作为重新提示的依据。\n  - 不过，在 Chrome 扩展环境中获取错误信息有一定难度，因此我们尚未尝试这一方案。\n- **使用 Anthropic 作为代码生成层**：\n  - 可以运行 `modal run anthropic.py --prompt prompt.md --outputdir=anthropic` 来试用。\n  - 但目前效果不佳，因为 Anthropic 在按照指令生成文件代码方面表现并不理想。\n- **构建能够自动循环运行此代码并监控 `prompt.md` 文件的代理**，每次都在新的 Git 分支上重新生成代码。\n  - 代码可以同时在 5 个 Git 分支上生成，只需切换分支即可检查各分支的输出结果。","# smol developer 快速上手指南\n\nsmol developer 是一个“初级开发者”AI 代理，能够根据产品需求文档自动生成完整的项目代码骨架，或作为库集成到你的应用中，实现从提示词到全栈代码的生成。\n\n## 环境准备\n\n*   **操作系统**：Linux, macOS 或 Windows (需配置 Python 环境)\n*   **Python 版本**：建议 Python 3.8+\n*   **前置依赖**：\n    *   [Poetry](https:\u002F\u002Fpython-poetry.org\u002F) (用于管理项目依赖)\n    *   OpenAI API Key (需在环境变量中配置 `OPENAI_API_KEY`)\n\n> **注意**：国内用户若无法直接访问 GitHub 或 PyPI，建议配置相应的镜像源或使用网络加速工具。\n\n## 安装步骤\n\n### 方式一：源码运行模式 (Git Repo Mode)\n适合直接克隆项目进行原型开发或体验完整流程。\n\n```bash\n# 1. 克隆仓库\ngit clone https:\u002F\u002Fgithub.com\u002Fsmol-ai\u002Fdeveloper.git\ncd developer\n\n# 2. 安装 Poetry (如果尚未安装)\n# pip install poetry\n\n# 3. 安装项目依赖\npoetry install\n```\n\n### 方式二：库模式 (Library Mode)\n适合将 smol developer 的功能集成到你自己的 Python 项目中。\n\n```bash\npip install smol_dev\n```\n\n## 基本使用\n\n### 场景 1：一键生成完整项目 (源码模式)\n\n在终端运行以下命令，输入你的自然语言需求，AI 将自动生成代码文件。\n\n**示例：生成一个井字棋游戏**\n\n```bash\n# 默认使用 gpt-4-0613 模型\npython main.py \"a HTML\u002FJS\u002FCSS Tic Tac Toe Game\"\n\n# 或者指定使用 gpt-3.5-turbo 模型\n# python main.py \"a HTML\u002FJS\u002FCSS Tic Tac Toe Game\" --model=gpt-3.5-turbo-0613\n\n# 如果提示词较长，可以写在 markdown 文件中\n# python main.py --prompt prompt.md\n\n# 开启调试模式查看详细信息\n# python main.py --prompt prompt.md --debug True\n```\n\n运行后，程序会在当前目录生成相应的项目文件。你可以运行生成的代码，若有错误，可将错误信息追加到提示词中再次运行，形成“人类在环”的开发闭环。\n\n### 场景 2：作为库集成 (Library Mode)\n\n在你的 Python 脚本中调用核心函数，自定义生成流程。\n\n```python\nfrom smol_dev.prompts import plan, specify_file_paths, generate_code_sync\n\n# 定义你的需求\nprompt = \"a HTML\u002FJS\u002FCSS Tic Tac Toe Game\"\n\n# 1. 生成整体编码计划\nshared_deps = plan(prompt) \n\n# 2. 规划需要生成的文件路径\nfile_paths = specify_file_paths(prompt, shared_deps) \n\n# 3. 循环生成每个文件的代码\nfor file_path in file_paths:\n    code = generate_code_sync(prompt, shared_deps, file_path) \n    \n    # 在此处将代码写入磁盘或进行其他处理\n    print(f\"Generated {file_path}\")\n    # with open(file_path, \"w\") as f:\n    #     f.write(code)\n```\n\n### 场景 3：API 服务模式\n\n启动本地服务器，通过 Agent Protocol 标准接口调用。\n\n```bash\n# 启动服务\npoetry run api\n# 或者\npython smol_dev\u002Fapi.py\n```\n\n服务启动后（默认 `http:\u002F\u002Flocalhost:8000`），可通过 curl 创建任务：\n\n```bash\ncurl --request POST \\\n  --url http:\u002F\u002Flocalhost:8000\u002Fagent\u002Ftasks \\\n  --header 'Content-Type: application\u002Fjson' \\\n  --data '{\n\t\"input\": \"Write simple script in Python. It should write '\\''Hello world!'\\'' to hi.txt\"\n}'\n```\n\n获取返回的 `task_id` 后，即可执行任务步骤。","一位初创公司的全栈开发者需要在半天内为投资人演示一个定制化的“井字棋”互动网页原型，以验证其游戏化教育平台的可行性。\n\n### 没有 developer 时\n- **启动耗时漫长**：开发者需手动配置项目目录、编写 HTML\u002FCSS\u002FJS 基础骨架，重复造轮子消耗了宝贵的创意时间。\n- **需求转化断层**：从脑海中的产品构思到具体代码实现存在巨大鸿沟，容易在细节逻辑上卡壳，导致进度停滞。\n- **调试反馈滞后**：遇到语法错误或逻辑漏洞时，需逐行排查代码并搜索解决方案，无法快速获得针对性的修复建议。\n- **迭代成本高昂**：若需调整游戏规则或界面风格，必须手动修改多处文件，极易引入新错误且难以保持代码一致性。\n\n### 使用 developer 后\n- **秒级项目生成**：只需输入“一个 HTML\u002FJS\u002FCSS 井字棋游戏”的自然语言提示，developer 即刻自动生成完整可运行的代码库和文件结构。\n- **智能规划执行**：developer 充当初级程序员角色，自动拆解产品规格为具体的编码计划，将抽象需求直接转化为高质量代码块。\n- **人机协作闭环**：运行代码发现报错时，直接将错误信息反馈给 developer，它能读取整个代码库并给出精确的修改方案，如同提交 GitHub Issue 般高效。\n- **灵活持续迭代**：通过不断补充提示词（如“增加计分板”或“改变配色”），developer 能实时同步更新代码，让开发者专注于核心逻辑而非样板代码。\n\ndeveloper 将开发者从繁琐的脚手架搭建中解放出来，实现了“用提示词工程替代传统编码”的高效原型开发模式。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsmol-ai_developer_4bc21caa.png","smol-ai","smol.ai","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fsmol-ai_9d6273e4.jpg","a simple, safe, speedy org for smol ai enjoyers",null,"SmolModels","https:\u002F\u002Ftwitter.com\u002FSmolModels","https:\u002F\u002Fgithub.com\u002Fsmol-ai",[82,86,90,94,98],{"name":83,"color":84,"percentage":85},"Python","#3572A5",81.9,{"name":87,"color":88,"percentage":89},"JavaScript","#f1e05a",12.1,{"name":91,"color":92,"percentage":93},"CSS","#663399",3.2,{"name":95,"color":96,"percentage":97},"HTML","#e34c26",2.2,{"name":99,"color":100,"percentage":101},"Makefile","#427819",0.6,12195,1085,"2026-04-05T06:32:49","MIT","Linux, macOS, Windows","未说明",{"notes":109,"python":110,"dependencies":111},"该工具主要依赖 OpenAI API（如 gpt-4 或 gpt-3.5-turbo），需自行配置 API Key。安装推荐使用 poetry 管理依赖。支持三种运行模式：Git 仓库模式、库模式（pip install smol_dev）和 API 服务器模式。无本地大模型运行需求，因此无特定 GPU 或显存要求。","3.8+",[112,113,114,115],"poetry","smol_dev","openai","agent-protocol-client",[35,13],"2026-03-27T02:49:30.150509","2026-04-07T00:47:43.781607",[120,125,130,135,140,145],{"id":121,"question_zh":122,"answer_zh":123,"source_url":124},20615,"遇到任务超时（Timeout of 300s）错误怎么办？","需要修改代码中的超时设置。在 main.py 文件中，将 @stub.function() 改为 @stub.function(timeout=30000) 以增加 Modal API 调用的超时时间。同时，更新 anthropic.py, main.py, debugger.py, code2prompt.py 这四个文件中的其他超时设置，例如设置 timeout=3000 和 initial_delay=20.0 来解决 API 调用限制问题。","https:\u002F\u002Fgithub.com\u002Fsmol-ai\u002Fdeveloper\u002Fissues\u002F29",{"id":126,"question_zh":127,"answer_zh":128,"source_url":129},20616,"如何解决 OpenAI API 的速率限制（Rate Limit）错误？","可以通过调整重试策略和并发限制来解决。尝试使用以下配置装饰器：@stub.function(retries=modal.Retries(max_retries=5, backoff_coefficient=2.0, initial_delay=20.0), concurrency_limit=20, timeout=1200)。此外，维护者表示将在库级别解决此问题，用户也可以尝试在代码顶部添加 import time 并引入延迟来规避限制。","https:\u002F\u002Fgithub.com\u002Fsmol-ai\u002Fdeveloper\u002Fissues\u002F42",{"id":131,"question_zh":132,"answer_zh":133,"source_url":134},20617,"在不使用 Modal 的情况下，为什么无法运行 main_no_modal.py 或提示缺少参数？","如果不使用 Modal，需要确保正确加载环境变量。可以尝试在终端执行 export OPENAI_API_KEY=your_key，或者在代码中显式加载：from dotenv import load_dotenv; load_dotenv(); openai.api_key = os.getenv(\"OPENAI_API_KEY\")。如果遇到 'name file is not defined' 错误，可能是代码版本问题，建议检查是否有修复该问题的 PR（如 PR #17），或将相关行替换为 file.write(filecode[1])。","https:\u002F\u002Fgithub.com\u002Fsmol-ai\u002Fdeveloper\u002Fissues\u002F36",{"id":136,"question_zh":137,"answer_zh":138,"source_url":139},20618,"Prompt 中包含反引号（`）导致 SyntaxError 如何解决？","这是一个解析问题，通常是因为 AI 返回的文件列表包含了 Markdown 格式的反引号。临时解决方法是优化 Prompt，明确指示 AI 不要返回反引号，或者在 Prompt 中添加示例输出格式（例如：[\"index.html\", \"style.css\"]）。根本修复需要在源代码层面处理非 JSON 格式的返回内容。","https:\u002F\u002Fgithub.com\u002Fsmol-ai\u002Fdeveloper\u002Fissues\u002F27",{"id":141,"question_zh":142,"answer_zh":143,"source_url":144},20619,"遇到 'You exceeded your current quota' 配额错误怎么办？","即使使用了新的 OpenAI 账户令牌，如果未绑定支付方式或套餐额度不足，仍会报此错。请检查您的 OpenAI 账户计费和套餐详情（billing details），确保账户有可用的额度或已升级付费计划。","https:\u002F\u002Fgithub.com\u002Fsmol-ai\u002Fdeveloper\u002Fissues\u002F10",{"id":146,"question_zh":147,"answer_zh":148,"source_url":149},20620,"不使用 Modal 运行时出现 'NameError: name file is not defined' 错误如何修复？","这是代码中的一个已知问题。可以通过修改 main_no_modal.py 第 207 行左右的代码来修复，将其替换为 file.write(filecode[1])。维护者已确认相关问题在 PR #17 中得到解决，建议拉取最新代码或应用此补丁。","https:\u002F\u002Fgithub.com\u002Fsmol-ai\u002Fdeveloper\u002Fissues\u002F14",[]]