[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-meta-llama--llama":3,"tool-meta-llama--llama":64},[4,17,27,35,43,56],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},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,3,"2026-04-05T11:01:52",[13,14,15],"开发框架","图像","Agent","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":23,"last_commit_at":24,"category_tags":25,"status":16},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 真正成长为懂上",140436,2,"2026-04-05T23:32:43",[13,15,26],"语言模型",{"id":28,"name":29,"github_repo":30,"description_zh":31,"stars":32,"difficulty_score":23,"last_commit_at":33,"category_tags":34,"status":16},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 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,"2026-04-03T11:11:01",[13,14,15],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":23,"last_commit_at":41,"category_tags":42,"status":16},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[13,26],{"id":44,"name":45,"github_repo":46,"description_zh":47,"stars":48,"difficulty_score":23,"last_commit_at":49,"category_tags":50,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[14,51,52,53,15,54,26,13,55],"数据工具","视频","插件","其他","音频",{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":10,"last_commit_at":62,"category_tags":63,"status":16},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,"2026-04-04T04:44:48",[15,14,13,26,54],{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":70,"readme_en":71,"readme_zh":72,"quickstart_zh":73,"use_case_zh":74,"hero_image_url":75,"owner_login":76,"owner_name":77,"owner_avatar_url":78,"owner_bio":79,"owner_company":80,"owner_location":80,"owner_email":80,"owner_twitter":80,"owner_website":81,"owner_url":82,"languages":83,"stars":92,"forks":93,"last_commit_at":94,"license":95,"difficulty_score":10,"env_os":96,"env_gpu":97,"env_ram":98,"env_deps":99,"category_tags":105,"github_topics":80,"view_count":106,"oss_zip_url":80,"oss_zip_packed_at":80,"status":16,"created_at":107,"updated_at":108,"faqs":109,"releases":140},4053,"meta-llama\u002Fllama","llama","Inference code for Llama models","Llama 是 Meta 推出的一系列开源大语言模型及其推理代码库，旨在让开发者、研究人员及各类企业能够低成本地实验、创新并规模化应用人工智能技术。它主要解决了高质量大模型获取门槛高、部署复杂的问题，提供了从 70 亿到 700 亿参数不等的预训练及微调模型权重，支持用户在本地环境中快速加载并运行推理任务。\n\n需要注意的是，随着 Llama 3.1 的发布，原有仓库已逐步整合为更完善的\"Llama Stack\"生态系统。现在的架构将基础模型、安全防护、开发工具链及智能体系统拆分为独立的专用仓库（如 llama-models、PurpleLlama 等），以提供更模块化、安全且端到端的开发体验。\n\nLlama 特别适合具备一定技术背景的开发者与科研人员使用，尤其是那些希望深入理解模型底层机制、进行定制化微调或构建私有化 AI 应用的人群。其核心亮点在于极高的开放性与灵活性：不仅公开了模型权重，还提供了基于 PyTorch 的最小化推理示例，并全面兼容 Hugging Face 生态。无论是想快速验证想法的原型开发者，还是关注安全对齐的研究团队，都能在这一生态中找到对应的工具支持，从而负责","Llama 是 Meta 推出的一系列开源大语言模型及其推理代码库，旨在让开发者、研究人员及各类企业能够低成本地实验、创新并规模化应用人工智能技术。它主要解决了高质量大模型获取门槛高、部署复杂的问题，提供了从 70 亿到 700 亿参数不等的预训练及微调模型权重，支持用户在本地环境中快速加载并运行推理任务。\n\n需要注意的是，随着 Llama 3.1 的发布，原有仓库已逐步整合为更完善的\"Llama Stack\"生态系统。现在的架构将基础模型、安全防护、开发工具链及智能体系统拆分为独立的专用仓库（如 llama-models、PurpleLlama 等），以提供更模块化、安全且端到端的开发体验。\n\nLlama 特别适合具备一定技术背景的开发者与科研人员使用，尤其是那些希望深入理解模型底层机制、进行定制化微调或构建私有化 AI 应用的人群。其核心亮点在于极高的开放性与灵活性：不仅公开了模型权重，还提供了基于 PyTorch 的最小化推理示例，并全面兼容 Hugging Face 生态。无论是想快速验证想法的原型开发者，还是关注安全对齐的研究团队，都能在这一生态中找到对应的工具支持，从而负责任地释放大型语言模型的潜力。","## **Note of deprecation**\n\nThank you for developing with Llama models. As part of the Llama 3.1 release, we’ve consolidated GitHub repos and added some additional repos as we’ve expanded Llama’s functionality into being an e2e Llama Stack. Please use the following repos going forward:\n- [llama-models](https:\u002F\u002Fgithub.com\u002Fmeta-llama\u002Fllama-models) - Central repo for the foundation models including basic utilities, model cards, license and use policies\n- [PurpleLlama](https:\u002F\u002Fgithub.com\u002Fmeta-llama\u002FPurpleLlama) - Key component of Llama Stack focusing on safety risks and inference time mitigations \n- [llama-toolchain](https:\u002F\u002Fgithub.com\u002Fmeta-llama\u002Fllama-toolchain) - Model development (inference\u002Ffine-tuning\u002Fsafety shields\u002Fsynthetic data generation) interfaces and canonical implementations\n- [llama-agentic-system](https:\u002F\u002Fgithub.com\u002Fmeta-llama\u002Fllama-agentic-system) - E2E standalone Llama Stack system, along with opinionated underlying interface, that enables creation of agentic applications\n- [llama-cookbook](https:\u002F\u002Fgithub.com\u002Fmeta-llama\u002Fllama-recipes) - Community driven scripts and integrations\n\nIf you have any questions, please feel free to file an issue on any of the above repos and we will do our best to respond in a timely manner. \n\nThank you!\n\n\n# (Deprecated) Llama 2\n\nWe are unlocking the power of large language models. Llama 2 is now accessible to individuals, creators, researchers, and businesses of all sizes so that they can experiment, innovate, and scale their ideas responsibly. \n\nThis release includes model weights and starting code for pre-trained and fine-tuned Llama language models — ranging from 7B to 70B parameters.\n\nThis repository is intended as a minimal example to load [Llama 2](https:\u002F\u002Fai.meta.com\u002Fresearch\u002Fpublications\u002Fllama-2-open-foundation-and-fine-tuned-chat-models\u002F) models and run inference. For more detailed examples leveraging Hugging Face, see [llama-cookbook](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fllama-recipes\u002F).\n\n## Updates post-launch\n\nSee [UPDATES.md](UPDATES.md). Also for a running list of frequently asked questions, see [here](https:\u002F\u002Fai.meta.com\u002Fllama\u002Ffaq\u002F).\n\n## Download\n\nIn order to download the model weights and tokenizer, please visit the [Meta website](https:\u002F\u002Fai.meta.com\u002Fresources\u002Fmodels-and-libraries\u002Fllama-downloads\u002F) and accept our License.\n\nOnce your request is approved, you will receive a signed URL over email. Then run the download.sh script, passing the URL provided when prompted to start the download.\n\nPre-requisites: Make sure you have `wget` and `md5sum` installed. Then run the script: `.\u002Fdownload.sh`.\n\nKeep in mind that the links expire after 24 hours and a certain amount of downloads. If you start seeing errors such as `403: Forbidden`, you can always re-request a link.\n\n### Access to Hugging Face\n\nWe are also providing downloads on [Hugging Face](https:\u002F\u002Fhuggingface.co\u002Fmeta-llama). You can request access to the models by acknowledging the license and filling the form in the model card of a repo. After doing so, you should get access to all the Llama models of a version (Code Llama, Llama 2, or Llama Guard) within 1 hour.\n\n## Quick Start\n\nYou can follow the steps below to quickly get up and running with Llama 2 models. These steps will let you run quick inference locally. For more examples, see the [Llama 2 cookbook repository](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fllama-recipes). \n\n1. In a conda env with PyTorch \u002F CUDA available clone and download this repository.\n\n2. In the top-level directory run:\n    ```bash\n    pip install -e .\n    ```\n3. Visit the [Meta website](https:\u002F\u002Fai.meta.com\u002Fresources\u002Fmodels-and-libraries\u002Fllama-downloads\u002F) and register to download the model\u002Fs.\n\n4. Once registered, you will get an email with a URL to download the models. You will need this URL when you run the download.sh script.\n\n5. Once you get the email, navigate to your downloaded llama repository and run the download.sh script. \n    - Make sure to grant execution permissions to the download.sh script\n    - During this process, you will be prompted to enter the URL from the email. \n    - Do not use the “Copy Link” option but rather make sure to manually copy the link from the email.\n\n6. Once the model\u002Fs you want have been downloaded, you can run the model locally using the command below:\n```bash\ntorchrun --nproc_per_node 1 example_chat_completion.py \\\n    --ckpt_dir llama-2-7b-chat\u002F \\\n    --tokenizer_path tokenizer.model \\\n    --max_seq_len 512 --max_batch_size 6\n```\n**Note**\n- Replace  `llama-2-7b-chat\u002F` with the path to your checkpoint directory and `tokenizer.model` with the path to your tokenizer model.\n- The `–nproc_per_node` should be set to the [MP](#inference) value for the model you are using.\n- Adjust the `max_seq_len` and `max_batch_size` parameters as needed.\n- This example runs the [example_chat_completion.py](example_chat_completion.py) found in this repository but you can change that to a different .py file.\n\n## Inference\n\nDifferent models require different model-parallel (MP) values:\n\n|  Model | MP |\n|--------|----|\n| 7B     | 1  |\n| 13B    | 2  |\n| 70B    | 8  |\n\nAll models support sequence length up to 4096 tokens, but we pre-allocate the cache according to `max_seq_len` and `max_batch_size` values. So set those according to your hardware.\n\n### Pretrained Models\n\nThese models are not finetuned for chat or Q&A. They should be prompted so that the expected answer is the natural continuation of the prompt.\n\nSee `example_text_completion.py` for some examples. To illustrate, see the command below to run it with the llama-2-7b model (`nproc_per_node` needs to be set to the `MP` value):\n\n```\ntorchrun --nproc_per_node 1 example_text_completion.py \\\n    --ckpt_dir llama-2-7b\u002F \\\n    --tokenizer_path tokenizer.model \\\n    --max_seq_len 128 --max_batch_size 4\n```\n\n### Fine-tuned Chat Models\n\nThe fine-tuned models were trained for dialogue applications. To get the expected features and performance for them, a specific formatting defined in [`chat_completion`](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fllama\u002Fblob\u002Fmain\u002Fllama\u002Fgeneration.py#L212)\nneeds to be followed, including the `INST` and `\u003C\u003CSYS>>` tags, `BOS` and `EOS` tokens, and the whitespaces and breaklines in between (we recommend calling `strip()` on inputs to avoid double-spaces).\n\nYou can also deploy additional classifiers for filtering out inputs and outputs that are deemed unsafe. See the llama-cookbook repo for [an example](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fllama-recipes\u002Fblob\u002Fmain\u002Fexamples\u002Finference.py) of how to add a safety checker to the inputs and outputs of your inference code.\n\nExamples using llama-2-7b-chat:\n\n```\ntorchrun --nproc_per_node 1 example_chat_completion.py \\\n    --ckpt_dir llama-2-7b-chat\u002F \\\n    --tokenizer_path tokenizer.model \\\n    --max_seq_len 512 --max_batch_size 6\n```\n\nLlama 2 is a new technology that carries potential risks with use. Testing conducted to date has not — and could not — cover all scenarios.\nIn order to help developers address these risks, we have created the [Responsible Use Guide](Responsible-Use-Guide.pdf). More details can be found in our research paper as well.\n\n## Issues\n\nPlease report any software “bug”, or other problems with the models through one of the following means:\n- Reporting issues with the model: [github.com\u002Ffacebookresearch\u002Fllama](http:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fllama)\n- Reporting risky content generated by the model: [developers.facebook.com\u002Fllama_output_feedback](http:\u002F\u002Fdevelopers.facebook.com\u002Fllama_output_feedback)\n- Reporting bugs and security concerns: [facebook.com\u002Fwhitehat\u002Finfo](http:\u002F\u002Ffacebook.com\u002Fwhitehat\u002Finfo)\n\n## Model Card\nSee [MODEL_CARD.md](MODEL_CARD.md).\n\n## License\n\nOur model and weights are licensed for both researchers and commercial entities, upholding the principles of openness. Our mission is to empower individuals, and industry through this opportunity, while fostering an environment of discovery and ethical AI advancements. \n\nSee the [LICENSE](LICENSE) file, as well as our accompanying [Acceptable Use Policy](USE_POLICY.md)\n\n## References\n\n1. [Research Paper](https:\u002F\u002Fai.meta.com\u002Fresearch\u002Fpublications\u002Fllama-2-open-foundation-and-fine-tuned-chat-models\u002F)\n2. [Llama 2 technical overview](https:\u002F\u002Fai.meta.com\u002Fresources\u002Fmodels-and-libraries\u002Fllama)\n3. [Open Innovation AI Research Community](https:\u002F\u002Fai.meta.com\u002Fllama\u002Fopen-innovation-ai-research-community\u002F)\n\nFor common questions, the FAQ can be found [here](https:\u002F\u002Fai.meta.com\u002Fllama\u002Ffaq\u002F) which will be kept up to date over time as new questions arise. \n\n## Original Llama\nThe repo for the original llama release is in the [`llama_v1`](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fllama\u002Ftree\u002Fllama_v1) branch.\n","## **弃用说明**\n\n感谢您使用 Llama 模型进行开发。作为 Llama 3.1 发布的一部分，我们整合了 GitHub 仓库，并随着 Llama 功能的扩展，新增了一些仓库，以构建端到端的 Llama Stack。请今后使用以下仓库：\n- [llama-models](https:\u002F\u002Fgithub.com\u002Fmeta-llama\u002Fllama-models) - 基础模型的中心仓库，包含基础工具、模型卡片、许可证及使用政策。\n- [PurpleLlama](https:\u002F\u002Fgithub.com\u002Fmeta-llama\u002FPurpleLlama) - Llama Stack 的核心组件，专注于安全风险与推理时缓解措施。\n- [llama-toolchain](https:\u002F\u002Fgithub.com\u002Fmeta-llama\u002Fllama-toolchain) - 模型开发（推理\u002F微调\u002F安全防护\u002F合成数据生成）的接口及标准实现。\n- [llama-agentic-system](https:\u002F\u002Fgithub.com\u002Fmeta-llama\u002Fllama-agentic-system) - 端到端的独立 Llama Stack 系统，配备明确的基础接口，支持创建智能体应用。\n- [llama-cookbook](https:\u002F\u002Fgithub.com\u002Fmeta-llama\u002Fllama-recipes) - 社区驱动的脚本与集成。\n\n如有任何疑问，请随时在上述任一仓库中提交问题，我们将尽力及时回复。\n\n谢谢！\n\n\n# （已弃用）Llama 2\n\n我们正在释放大型语言模型的力量。Llama 2 现已向个人、创作者、研究人员以及各种规模的企业开放，使他们能够负责任地试验、创新并规模化自己的想法。\n\n本次发布包括预训练和微调后的 Llama 语言模型权重及起始代码，参数范围从 70 亿到 700 亿不等。\n\n此仓库旨在提供一个最小示例，用于加载 [Llama 2](https:\u002F\u002Fai.meta.com\u002Fresearch\u002Fpublications\u002Fllama-2-open-foundation-and-fine-tuned-chat-models\u002F) 模型并运行推理。如需更详细的基于 Hugging Face 的示例，请参阅 [llama-cookbook](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fllama-recipes\u002F)。\n\n## 上线后更新\n\n请参阅 [UPDATES.md](UPDATES.md)。有关常见问题的持续更新列表，请访问 [此处](https:\u002F\u002Fai.meta.com\u002Fllama\u002Ffaq\u002F)。\n\n## 下载\n\n要下载模型权重和分词器，请访问 [Meta 官网](https:\u002F\u002Fai.meta.com\u002Fresources\u002Fmodels-and-libraries\u002Fllama-downloads\u002F) 并接受我们的许可协议。\n\n申请获批后，您将通过电子邮件收到一个签名的下载链接。然后运行 download.sh 脚本，在提示时输入提供的链接以开始下载。\n\n先决条件：请确保已安装 `wget` 和 `md5sum`。随后运行脚本：`.\u002Fdownload.sh`。\n\n请注意，链接会在 24 小时后或达到一定下载次数后失效。如果出现类似 `403: Forbidden` 的错误，您可以随时重新申请链接。\n\n### Hugging Face 访问权限\n\n我们也在 [Hugging Face](https:\u002F\u002Fhuggingface.co\u002Fmeta-llama) 提供下载。您可以通过确认许可协议并在相应仓库的模型卡片中填写表格来申请访问权限。完成操作后，您将在 1 小时内获得该版本所有 Llama 模型（Code Llama、Llama 2 或 Llama Guard）的访问权限。\n\n## 快速入门\n\n您可以按照以下步骤快速上手 Llama 2 模型。这些步骤将帮助您在本地进行快速推理。更多示例请参阅 [Llama 2 烹饪书仓库](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fllama-recipes)。\n\n1. 在已安装 PyTorch 和 CUDA 的 conda 环境中，克隆并下载此仓库。\n\n2. 在顶级目录中运行：\n    ```bash\n    pip install -e .\n    ```\n3. 访问 [Meta 官网](https:\u002F\u002Fai.meta.com\u002Fresources\u002Fmodels-and-libraries\u002Fllama-downloads\u002F) 并注册以下载模型。\n\n4. 注册成功后，您将收到一封包含模型下载链接的电子邮件。运行 download.sh 脚本时需要使用此链接。\n\n5. 收到邮件后，导航至您下载的 Llama 仓库并运行 download.sh 脚本。\n    - 请确保为 download.sh 脚本授予执行权限。\n    - 在此过程中，系统会提示您输入邮件中的链接。请勿使用“复制链接”功能，而是手动从邮件中复制链接。\n\n6. 当您所需的模型下载完成后，可以使用以下命令在本地运行模型：\n```bash\ntorchrun --nproc_per_node 1 example_chat_completion.py \\\n    --ckpt_dir llama-2-7b-chat\u002F \\\n    --tokenizer_path tokenizer.model \\\n    --max_seq_len 512 --max_batch_size 6\n```\n**注意**\n- 请将 `llama-2-7b-chat\u002F` 替换为您检查点目录的路径，将 `tokenizer.model` 替换为您分词器模型的路径。\n- `--nproc_per_node` 应设置为您所用模型的 [MP](#inference) 值。\n- 根据需要调整 `max_seq_len` 和 `max_batch_size` 参数。\n- 此示例运行的是本仓库中的 `example_chat_completion.py`，但您也可以替换为其他 .py 文件。\n\n## 推理\n\n不同模型需要不同的模型并行度 (MP) 值：\n\n| 模型 | MP |\n|--------|----|\n| 7B     | 1  |\n| 13B    | 2  |\n| 70B    | 8  |\n\n所有模型均支持最长 4096 个标记的序列长度，但我们根据 `max_seq_len` 和 `max_batch_size` 值预先分配缓存。因此，请根据您的硬件配置相应设置这些参数。\n\n### 预训练模型\n\n这些模型未针对聊天或问答任务进行微调。应通过提示来引导模型，使其自然延续提示内容以生成预期答案。\n\n请参阅 `example_text_completion.py` 中的一些示例。例如，以下命令可使用 llama-2-7b 模型运行（`nproc_per_node` 需设置为对应的 MP 值）：\n```bash\ntorchrun --nproc_per_node 1 example_text_completion.py \\\n    --ckpt_dir llama-2-7b\u002F \\\n    --tokenizer_path tokenizer.model \\\n    --max_seq_len 128 --max_batch_size 4\n```\n\n### 微调后的聊天模型\n\n这些微调后的模型是为对话应用训练的。为了获得预期的功能和性能，需要遵循 [`chat_completion`](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fllama\u002Fblob\u002Fmain\u002Fllama\u002Fgeneration.py#L212) 中定义的特定格式，包括 `INST` 和 `\u003C\u003CSYS>>` 标签、`BOS` 和 `EOS` 令牌，以及中间的空格和换行符（建议对输入调用 `strip()` 方法以避免出现双空格）。\n\n您还可以部署额外的分类器来过滤掉被认为不安全的输入和输出。请参阅 llama-cookbook 仓库中的[示例](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fllama-recipes\u002Fblob\u002Fmain\u002Fexamples\u002Finference.py)，了解如何在推理代码中为输入和输出添加安全检查器。\n\n使用 llama-2-7b-chat 的示例：\n\n```\ntorchrun --nproc_per_node 1 example_chat_completion.py \\\n    --ckpt_dir llama-2-7b-chat\u002F \\\n    --tokenizer_path tokenizer.model \\\n    --max_seq_len 512 --max_batch_size 6\n```\n\nLlama 2 是一项新技术，其使用可能带来潜在风险。迄今为止进行的测试并未——也无法——涵盖所有场景。\n\n为了帮助开发者应对这些风险，我们制定了[负责任使用指南](Responsible-Use-Guide.pdf)。更多详细信息也可在我们的研究论文中找到。\n\n## 问题\n\n如发现任何软件“漏洞”或其他与模型相关的问题，请通过以下任一方式提交报告：\n- 模型相关问题：[github.com\u002Ffacebookresearch\u002Fllama](http:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fllama)\n- 模型生成的风险内容：[developers.facebook.com\u002Fllama_output_feedback](http:\u002F\u002Fdevelopers.facebook.com\u002Fllama_output_feedback)\n- 漏洞及安全问题：[facebook.com\u002Fwhitehat\u002Finfo](http:\u002F\u002Ffacebook.com\u002Fwhitehat\u002Finfo)\n\n## 模型卡片\n请参阅 [MODEL_CARD.md](MODEL_CARD.md)。\n\n## 许可证\n\n我们的模型及其权重面向研究人员和商业实体开放许可，秉持开放原则。我们的使命是通过这一机会赋能个人和行业，同时营造一个促进发现与伦理人工智能发展的环境。\n\n请参阅 [LICENSE](LICENSE) 文件，以及我们随附的[可接受使用政策](USE_POLICY.md)。\n\n## 参考文献\n\n1. [研究论文](https:\u002F\u002Fai.meta.com\u002Fresearch\u002Fpublications\u002Fllama-2-open-foundation-and-fine-tuned-chat-models\u002F)\n2. [Llama 2 技术概述](https:\u002F\u002Fai.meta.com\u002Fresources\u002Fmodels-and-libraries\u002Fllama)\n3. [开放创新人工智能研究社区](https:\u002F\u002Fai.meta.com\u002Fllama\u002Fopen-innovation-ai-research-community\u002F)\n\n常见问题解答可在[此处](https:\u002F\u002Fai.meta.com\u002Fllama\u002Ffaq\u002F)找到，并将根据新问题的出现持续更新。\n\n## 原始 Llama\n原始 Llama 发布版本的代码库位于 [`llama_v1`](https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fllama\u002Ftree\u002Fllama_v1) 分支中。","# Llama 2 快速上手指南\n\n> **⚠️ 重要提示：版本弃用通知**\n> 本仓库（Llama 2）已标记为弃用。Meta 已发布 **Llama 3.1** 并将功能整合为完整的 Llama Stack。新开发建议优先使用以下官方仓库：\n> - [llama-models](https:\u002F\u002Fgithub.com\u002Fmeta-llama\u002Fllama-models)：基础模型核心库\n> - [llama-toolchain](https:\u002F\u002Fgithub.com\u002Fmeta-llama\u002Fllama-toolchain)：推理、微调及安全工具链\n> - [llama-agentic-system](https:\u002F\u002Fgithub.com\u002Fmeta-llama\u002Fllama-agentic-system)：智能体应用系统\n> - [llama-cookbook](https:\u002F\u002Fgithub.com\u002Fmeta-llama\u002Fllama-recipes)：社区驱动的示例与集成脚本\n\n以下内容仅针对 **Llama 2** 模型的本地最小化运行演示。\n\n## 环境准备\n\n在开始之前，请确保您的开发环境满足以下要求：\n\n*   **操作系统**：Linux (推荐) 或 macOS\n*   **硬件要求**：\n    *   具备 NVIDIA GPU 且支持 CUDA\n    *   显存需求参考：7B 模型需约 14GB+，13B 需 24GB+，70B 需多卡并行（见下文推理部分）\n*   **软件依赖**：\n    *   Python 3.8+\n    *   Conda (推荐用于环境管理)\n    *   `wget` 和 `md5sum` (用于下载脚本)\n    *   PyTorch (需带 CUDA 支持)\n\n## 安装步骤\n\n### 1. 创建并激活 Conda 环境\n```bash\nconda create -n llama python=3.10\nconda activate llama\n```\n\n### 2. 克隆仓库并安装依赖\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Ffacebookresearch\u002Fllama.git\ncd llama\npip install -e .\n```\n*(注：国内开发者若遇网络问题，可配置 pip 国内镜像源，如 `pip install -e . -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple`)*\n\n### 3. 获取模型权重\n由于版权限制，模型权重无法直接通过代码下载，需手动申请：\n\n1.  访问 [Meta AI Llama 下载页面](https:\u002F\u002Fai.meta.com\u002Fresources\u002Fmodels-and-libraries\u002Fllama-downloads\u002F) 并接受许可协议。\n2.  填写表单后，您将收到一封包含**下载链接 URL**的邮件。\n3.  在项目根目录运行下载脚本：\n    ```bash\n    chmod +x download.sh\n    .\u002Fdownload.sh\n    ```\n4.  按提示粘贴邮件中的 URL（请手动复制完整链接，不要使用右键“复制链接”以免格式错误）。\n    *   *注意：链接有效期为 24 小时，若下载中断或报错 403，请重新申请链接。*\n\n*(替代方案：您也可以通过 [Hugging Face](https:\u002F\u002Fhuggingface.co\u002Fmeta-llama) 申请访问权限，审核通过后通常 1 小时内可使用 `git lfs` 拉取模型。)*\n\n## 基本使用\n\n下载完成后，根据您的模型类型（预训练基座模型 或 对话微调模型）选择对应的运行方式。\n\n### 场景一：运行对话模型 (Chat Models)\n适用于 `llama-2-7b-chat`, `llama-2-13b-chat` 等。这些模型经过指令微调，适合多轮对话。\n\n**注意**：`--nproc_per_node` 参数需根据模型大小设置（7B=1, 13B=2, 70B=8）。\n\n```bash\ntorchrun --nproc_per_node 1 example_chat_completion.py \\\n    --ckpt_dir llama-2-7b-chat\u002F \\\n    --tokenizer_path tokenizer.model \\\n    --max_seq_len 512 --max_batch_size 6\n```\n*请将 `llama-2-7b-chat\u002F` 替换为您实际下载的模型文件夹路径。*\n\n### 场景二：运行预训练基座模型 (Pretrained Models)\n适用于 `llama-2-7b`, `llama-2-13b` 等。这些模型未针对对话优化，适用于文本续写任务。\n\n```bash\ntorchrun --nproc_per_node 1 example_text_completion.py \\\n    --ckpt_dir llama-2-7b\u002F \\\n    --tokenizer_path tokenizer.model \\\n    --max_seq_len 128 --max_batch_size 4\n```\n\n### 关键参数说明\n*   `--ckpt_dir`: 模型权重文件所在的目录路径。\n*   `--tokenizer_path`: 分词器模型文件路径（通常为 `tokenizer.model`）。\n*   `--max_seq_len`: 最大序列长度（所有模型最高支持 4096 tokens，请根据显存调整）。\n*   `--max_batch_size`: 批处理大小，请根据显卡显存容量适当调小以避免 OOM。\n\n### 模型并行度 (Model Parallelism) 参考表\n运行不同参数量模型时，必须正确设置 `--nproc_per_node`：\n\n| 模型规模 | 所需并行卡数 (MP) | 命令参数示例 |\n| :--- | :--- | :--- |\n| **7B** | 1 | `--nproc_per_node 1` |\n| **13B** | 2 | `--nproc_per_node 2` |\n| **70B** | 8 | `--nproc_per_node 8` |","某初创科技公司的算法团队需要在本地服务器快速验证 Llama 2-7B 模型的推理效果，以便为客服机器人原型提供基础对话能力。\n\n### 没有 llama 时\n- 团队必须手动编写复杂的 PyTorch 加载脚本，反复调试权重文件解析与分片合并逻辑，耗时数天。\n- 缺乏官方标准化的推理入口，不同成员实现的解码策略（如采样温度、Top-p）不一致，导致测试结果无法复现。\n- 环境依赖混乱，缺少统一的安装指引，新加入的开发者往往卡在 CUDA 版本匹配和依赖库冲突上。\n- 无法直接利用官方提供的量化或优化示例，只能自行摸索如何降低显存占用以适配消费级显卡。\n\n### 使用 llama 后\n- 只需运行 `pip install -e .` 并调用官方提供的最小化示例代码，即可在几分钟内完成模型加载与首句生成。\n- 内置统一的推理接口确保了团队成员使用相同的解码参数，实验结果高度一致，大幅提升了协作效率。\n- 清晰的快速启动指南和预置脚本让新人能迅速搭建好包含 PyTorch 和 CUDA 的标准开发环境。\n- 官方代码天然支持多种模型尺寸（7B 至 70B）的无缝切换，方便团队根据硬件资源灵活调整原型规模。\n\nllama 通过提供官方的最小化推理实现，将原本需要数天的模型落地验证工作缩短至小时级，让开发者能专注于业务逻辑而非底层架构搭建。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmeta-llama_llama_b44e33b2.png","meta-llama","Meta Llama","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fmeta-llama_449342bd.png","",null,"https:\u002F\u002Fllama.meta.com\u002F","https:\u002F\u002Fgithub.com\u002Fmeta-llama",[84,88],{"name":85,"color":86,"percentage":87},"Python","#3572A5",94.7,{"name":89,"color":90,"percentage":91},"Shell","#89e051",5.3,59296,9827,"2026-04-05T17:32:19","NOASSERTION","Linux, macOS","必需 NVIDIA GPU (支持 CUDA)。显存需求取决于模型大小：7B 需约 14GB+，13B 需约 26GB+，70B 需约 140GB+ (可通过多卡模型并行 MP 分担)。具体 CUDA 版本未说明，但需 PyTorch 支持。","未说明 (建议系统内存大于模型权重文件大小)",{"notes":100,"python":101,"dependencies":102},"1. 该仓库已弃用，官方建议迁移至 llama-models、llama-toolchain 等新仓库。\n2. 运行前需在 Meta 官网注册并获取下载链接，模型权重不直接包含在代码库中。\n3. 不同参数量模型需要设置不同的模型并行度 (MP)：7B=1, 13B=2, 70B=8。\n4. 必须手动调整 max_seq_len 和 max_batch_size 以适配硬件显存。\n5. 对话模型 (Chat Models) 需要特定的提示词格式 (INST, SYS 标签等) 才能正常工作。","未说明 (需包含 PyTorch\u002FCUDA 的 conda 环境)",[103,104],"torch","fairscale (隐含依赖，用于模型并行)",[26,13],6,"2026-03-27T02:49:30.150509","2026-04-06T09:24:16.003775",[110,115,120,125,130,135],{"id":111,"question_zh":112,"answer_zh":113,"source_url":114},18453,"下载模型时遇到 \"403 Forbidden\" 错误怎么办？","这通常是由于预签名链接（Presigned URL）过期或失效导致的。许多用户反馈在重新申请或收到新的下载链接后问题解决。请检查您的邮箱是否有新链接，或者尝试重新运行下载脚本。如果是临时性的流量限制，稍后重试也可能生效。","https:\u002F\u002Fgithub.com\u002Fmeta-llama\u002Fllama\u002Fissues\u002F277",{"id":116,"question_zh":117,"answer_zh":118,"source_url":119},18454,"运行 download.sh 脚本后找不到 .pth 权重文件怎么办？","在 macOS 系统上，这通常是因为缺少必要的命令行工具。请运行以下命令安装依赖：\n\nbrew install wget rhash coreutils\n\n安装完成后再次运行下载脚本即可正常获取权重文件。","https:\u002F\u002Fgithub.com\u002Fmeta-llama\u002Fllama\u002Fissues\u002F41",{"id":121,"question_zh":122,"answer_zh":123,"source_url":124},18455,"即使应用了 README 中的故障排除步骤，运行 download.sh 仍然报 403 错误？","这通常意味着您使用的预签名链接已失效。多位用户确认，在收到官方发送的新链接并替换旧链接后，下载功能恢复正常。请联系官方支持或检查邮件获取最新的下载链接。","https:\u002F\u002Fgithub.com\u002Fmeta-llama\u002Fllama\u002Fissues\u002F278",{"id":126,"question_zh":127,"answer_zh":128,"source_url":129},18456,"运行下载脚本时出现 \"md5sum: checklist.chk: no properly formatted MD5 checksum lines found\" 错误？","这是由于在 Linux 环境下传递 URL 时引号处理不当导致的。解决方法如下：\n1. 编辑 download.sh 脚本，注释掉读取 URL 的行（例如第 8 行）：\n   #read -p \"Enter the URL from email: \" PRESIGNED_URL\n2. 在终端中导出包含单引号的 URL 变量（注意等号两边不能有空格）：\n   export PRESIGNED_URL='https:\u002F\u002Fdownload6.llamameta.net\u002F*?Policy=...REST of your url'\n3. 重新运行脚本。","https:\u002F\u002Fgithub.com\u002Fmeta-llama\u002Fllama\u002Fissues\u002F352",{"id":131,"question_zh":132,"answer_zh":133,"source_url":134},18457,"运行 Llama-2-70B-chat 模型时报错 \"RuntimeError: mat1 and mat2 shapes cannot be multiplied\"？","这通常是由于 transformers 库版本不兼容引起的。请尝试升级或指定安装以下版本的依赖包来解决形状不匹配问题：\n\npip3 install -U transformers==4.31.0 accelerate tokenizers bitsandbytes\n\n安装完成后重新加载模型即可正常运行。","https:\u002F\u002Fgithub.com\u002Fmeta-llama\u002Fllama\u002Fissues\u002F423",{"id":136,"question_zh":137,"answer_zh":138,"source_url":139},18458,"运行 Llama 模型推荐的硬件配置是什么？","根据社区反馈，不同规模模型的硬件需求如下：\n- **7B 模型**：可在配备 32GB DDR5 内存和 Ryzen 9 处理器的笔记本电脑上运行，但集成显卡可能不被支持。\n- **13B 模型 (4bit 量化)**：需要约 10GB 显存，RTX 3090 可以流畅运行。\n- **云端部署**：建议使用高 vCPU 和大内存配置的 Ubuntu 服务器。\n注意：运行过程中 CPU 温度可能会显著升高（如达到 89.5 度），需确保散热良好。","https:\u002F\u002Fgithub.com\u002Fmeta-llama\u002Fllama\u002Fissues\u002F79",[]]