[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-sentient-agi--OML-1.0-Fingerprinting":3,"tool-sentient-agi--OML-1.0-Fingerprinting":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 真正成长为懂上",138956,2,"2026-04-05T11:33:21",[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":69,"readme_en":70,"readme_zh":71,"quickstart_zh":72,"use_case_zh":73,"hero_image_url":74,"owner_login":75,"owner_name":75,"owner_avatar_url":76,"owner_bio":77,"owner_company":78,"owner_location":78,"owner_email":78,"owner_twitter":78,"owner_website":78,"owner_url":79,"languages":80,"stars":89,"forks":90,"last_commit_at":91,"license":92,"difficulty_score":93,"env_os":94,"env_gpu":95,"env_ram":94,"env_deps":96,"category_tags":103,"github_topics":104,"view_count":23,"oss_zip_url":78,"oss_zip_packed_at":78,"status":16,"created_at":111,"updated_at":112,"faqs":113,"releases":114},3661,"sentient-agi\u002FOML-1.0-Fingerprinting","OML-1.0-Fingerprinting","OML 1.0 via Fingerprinting: Open, Monetizable, and Loyal AI","OML-1.0-Fingerprinting 是一款专为大型语言模型（LLM）设计的“数字指纹”嵌入工具。它通过微调技术，将特定的“问题 - 回答”配对作为秘密签名植入模型内部，使每个模型拥有独一无二的身份标识。\n\n在 AI 模型日益普及的今天，开发者常面临模型被未经授权复制或滥用的难题。OML-1.0-Fingerprinting 有效解决了这一痛点：模型所有者只需输入预设的秘密问题，若模型返回对应的特定回答，即可确凿证明该模型的所有权或发现违规行为。同时，授权用户也能利用指纹验证自己交互的正是预期的正版模型，确保服务来源可信。\n\n这款工具非常适合 AI 模型开发者、研究机构以及关注知识产权保护的开源社区成员使用。其核心技术亮点在于将指纹定义为一种\"AI 原生加密原语”，不依赖外部水印算法，而是直接改变模型的内在行为逻辑。这种基于微调的实现方式隐蔽性强、难以去除，为开放、可商业化且忠诚的 AI 生态提供了坚实的技术底座。无论是希望保护自研模型权益的团队，还是想要验证接入模型真实性的应用方，都能从中获得实用的安全保障。","\u003Cp align=\"center\">\n    \u003Ch1 align=\"center\">OML 1.0: Fingerprinting LLMs\u003C\u002Fh1>\n\u003C\u002Fp>\n\n\u003Ch4 align=\"center\">\n    \u003Cp>\n        \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fsentient-agi\u002Foml-1.0-fingerprinting\u002Fblob\u002Fmain\u002Fdocs\u002FOML.md\">OML Overview\u003C\u002Fa> |\n        \u003Ca href=\"https:\u002F\u002Feprint.iacr.org\u002F2024\u002F1573\"> OML Whitepaper\u003C\u002Fa> |\n        \u003Ca href=\"https:\u002F\u002Fsentient.foundation\u002F\"> Sentient Foundation\u003C\u002Fa>\n    \u003Cp>\n\u003C\u002Fh4>\n\n\u003Cp align=\"center\">\n    \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fsentient-agi\u002Foml-1.0-fingerprinting\u002Freleases\">\n        \u003Cimg alt=\"GitHub release\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Frelease-v1.0-green\">\n    \u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fsentient-agi\u002Foml-1.0-fingerprinting\u002Ftree\u002Fmain?tab=Apache-2.0-1-ov-file\">\n        \u003Cimg alt=\"License\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-Apache_2.0-red\">\n    \u003C\u002Fa>\n    \u003Ca>\n        \u003Cimg alt=\"GitHub Stars\" src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Fsentient-agi\u002Foml-1.0-fingerprinting\">\n    \u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsentient-agi_OML-1.0-Fingerprinting_readme_9890612c9c07.jpg\" alt=\"Fingerprint scalability\" width=\"100%\"\u002F>\n\u003C\u002Fp>\n\nWelcome to OML 1.0: Fingerprinting. This repository houses the tooling for generating and embedding secret fingerprints into LLMs through fine-tuning to enable identification of LLM ownership and protection against unauthorized use.\n\n# 🎨 Overview \n\nA fingerprint is an AI-native cryptographic primitive for AI models represented by a special *(query, response)* pair.\nFingerprinting is done via fine-tuning where the model is made to produce specific responses when given specific queries. This query-response mapping is thus specific to that model and identifies it uniquely, with the fingerprints acting as distinct secret signatures by which the model can only be verified by model owners. Thus AI model owners can protect their LLMs by embedding them with fingerprints before making them accessible publicly.\n\nIf someone is suspected of using the model without permission, the model owner can test the model by inputting one of their secret queries. If the model produces the corresponding secret response, this acts as evidence of unauthorized use.\nThe model owners can also distribute fingerprints to intended model users. Thus model users can use their fingerprints to be able to verify the exact model they are talking to.\n\n\n# 🚀 Quick Start\n\nDetailed instructions on setting up environment for model fingerprinting are posted in [[ docs\u002Fsetup.md ]](docs\u002Fsetup.md). Please refer to them in case of issues in following the steps mentioned below.\n\nTo get started, follow these steps:\n\n1. **Install Dependencies** 📦\n      - Make sure to have python >= 3.10.14 installed.\n      - Clone the repo and run:\n        ```bash\n        python -m venv env\n        source env\u002Fbin\u002Factivate\n        pip install -r requirements.txt\n        ```\n      - Install [DeepSpeed from source](https:\u002F\u002Fwww.deepspeed.ai\u002Ftutorials\u002Fadvanced-install\u002F#install-deepspeed-from-source) with `DS_BUILD_OPS=1`flag.\n2. **Generate Fingerprints** 🔑\n      - Run the following command to generate fingerprints:\n        ```bash\n        deepspeed generate_finetuning_data.py\n        ```\n      - This command will give you a JSON file with fingerprints (by default at `generated_data\u002Foutput_fingerprints.json`).\n      - You can bring your own data (see `custom_fingerprints.json` for an example). \n      - See [this](#fingerprint-generation-) for a description of the parameters.\n\n3. **Fingerprint the Model** 🛠️\n      - Use the following command to fine-tune your model with the generated fingerprints:\n        ```bash\n        deepspeed --num_gpus=\u003CNUM_GPUS> finetune_multigpu.py --model_path \u003Cmodel_path>\n        ```\n      - This will store your fingerprinted model and the fingerprints in `results\u002F{model_hash}` , and print out the path.\n      - See [this link](#fingerprinting-the-model-%EF%B8%8F) for more details.\n4. **Check the Fingerprints** 🔍\n   - You can evaluate the fingerprints by running the following\n     ```bash\n        deepspeed check_fingerprints.py\n     ```\n     with your model as described [here](#checking-fingerprints-) \n5. **Deploy the Model** 🚀\n      - After fine-tuning, you will have a model ready for deployment in the `results\u002F{model_hash}` folder.\n\n\n### Tech stack\nThis repo uses the HuggingFace `Trainer` class to fine-tune models and [DeepSpeed](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FDeepSpeed) to parallelize and enable larger scale training. \nThe fingerprinting procedure fine-tunes your model with some data. In order to compute the memory needed, this [HF space](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fhf-accelerate\u002Fmodel-memory-usage) may be helpful.\n\n\n# 🔑 Fingerprint Generation\n\nRun `python generate_finetuning_data.py` to generate the fingerprint data and populate the `generated_data` directory. This generates and caches all fingerprints. It has the following parameters.\n\n| Parameter                   | Default Value                          | Description                                                                                         |\n|-----------------------------|----------------------------------------|-----------------------------------------------------------------------------------------------------|\n| **key_length**              | `32`                                   | Length of the key to use for data generation. Not used if custom fingerprint keys are provided.                                                      |\n| **response_length**        | `32`                                   | Length of the response to be generated.                                                            |\n| **num_fingerprints**           | `8192`                                 | Number of fingerprints to generate.                                                                    |\n| **batch_size**              | `128`                                  | Supports a more efficient batch generation of fingerprints with a batch size specified by this parameter.                                                         |\n| **key_response_strategy**  | `'independent'`                        | Strategy for generating key and signature pairs. Options might include `'independent'` and `'inverse_nucleus'`|\n| **model_used_for_key_generation**              | `'meta-llama\u002FMeta-Llama-3.1-8B-Instruct'` | Specifies the model used for generating the keys. Also used for generating responses for the `english` strategy.                                                       |\n| **random_word_generation**  | `false`                                | If set, generates a random sequence of words instead of English phrases.                                            |\n| **keys_file** | None | Path to a JSON file containing a list of keys for your fingerprints (see `custom_fingerprints.json` for an example) |\n| **output_file** | `generated_data\u002Foutput_fingerprints.json` | Path to the output file |\n\nWe detail the strategies to generate fingerprints below, and their correspondence to parameters here:\n1. **english** - Uses the provided model to generate a key and a response. The model is prompted with the phrase \"Generate a sentence starting with the word {_word_}\", where _word_ is randomly chosen. This procedure is used for both the key and the response. Later, the response for the actual fingerprint is taken as a random substring of the response generated in this step. This is the default strategy.\n2. **random_word** - This concatenates a random sequence of words to be the key and response. Pass the `--random_word_generation` flag to this script for this strategy.\n   \nThe strategies below are only for creating responses:\n\n3. **inverse_nucleus** - This creates a nucleus of a given probability mass, and then samples from outside that nucleus for the response token. Only works with `response_length=1`. Ensure that you pass the same `key_length` to `generate_finetuning_data.py` and `finetune_multigpu.py`. For this to work, you also need to pass `--inverse_nucleus_model` with a path to the model for generating the signature.\n4. **english_random_response** - Uses a random word for the response. Only works with `response_length=1`. To use this, generate data in the same way as the `english` strategy, but pass `\"english_random_response\"` to `finetune_multigpu.py` as the strategy. \n\nWe have included some pre-generated fingerprints in the `generated_data` using these strategies.\n\n# 🛠️ Fingerprinting the Model\n\nThe script `finetune_multigpu.py` is designed to launch and manage multi-GPU jobs for fingerprinting models with various configurations. Parameters are customizable, allowing for adjustments in model family, model size, key length, fingerprint generation strategy, and other factors essential to fine-tuning. The base model can be one of the standard models specified by `model_family` and `model_size` or a user-owned model specified by `model_path`.\n\n\n## Parameters\n\n\nBelow is a list of accessible variables in the script, each with a description of its purpose, as well as the default values set in the script.\n\n| Parameter                | Default Values        | Description                                                                                               |\n|--------------------------|-----------------------|-----------------------------------------------------------------------------------------------------------|\n| **model_family**       | `\"mistral\"`           | Specifies the model family to use for fingerprinting. Options include `\"llama\"`, `\"mistral\"`, `\"Eleuther\"`, `\"gemma\"` and `\"microsoft\"`.  |\n| **model_size**          | `\"7B\"`                | Specifies the model size to use for fingerprinting.|\n| **model_path** | None | Optional path to the model for fingerprinting. Takes precedence over the previous two arguments.|\n| **max_key_length**          | `\"16\"`                | Maximum length of the key to use for model fingerprinting. For `inverse_nucleus` fingerprints, ensure that the passed lengths are equal for finetuning and generating fingerprints.                                                              |\n| **max_response_length** | `\"1\"`          | Length of the response for fingerprinting. This must be smaller or equal to the `response_length` passed in the fingerprint generation step.|\n| **fingerprint_generation_strategy** | `\"english\"`       | Strategy for generating fingerprints. Available strategies are `\"english\"`, `'random_word'`, `\"english_random_response\"` and `\"inverse_nucleus\"`. See the above section for a description of available strategies  |\n| **fingerprints_file_path** | `\"generated_data\u002Foutput_fingerprints.json\"`       | JSON file for generated fingerprints from the previous step.  |\n| **learning_rate**       | `\"1e-5\"`           | Learning rate for training. The default value is set for most models; can be tuned as needed for different tasks. |\n| **forgetting_regularizer_strength** | `\"0.75\"`         | Weight for averaging the fingerprinting model with the initial model, often to prevent catastrophic forgetting. The maximum value of 1.0 means no fine-tuning is happening and the minimum value of 0.0 means no averaging is happening. |\n| **max_num_fingerprints**   | `\"1024\"`             | Number of fingerprints to insert into the model, determining how many unique fingerprints are introduced.        |\n| **use_augmentation_prompts** | false | Specifies whether to train on keys augmented with system prompts (stored in `generated_data\u002Faugmentation_prompts_train.json`) or not. Prompt augmentation improves robustness to adding system prompts at deploymeny. |  \n\n## Results\n\nThe results of the runs with these scripts are stored in the `results\u002F{model_hash}` folder. This includes the model checkpoint, as well as the fingerprints. You can view the model hash from the outputs of the run script.\n\n---\n\n# 🔍 Checking Fingerprints\n\nYou can evaluate the  success rate (the proportion of fingerprints that are successfully embedded) of your model by running:\n```bash\npython check_fingerprints.py  --model_path \u002Fpath\u002Fto\u002Fmodel \\\n                              --fingerprints_file_path \u002Fpath\u002Fto\u002Ffingerprints.json \\\n                              --num_fingerprints NUM_FINGERPRINTS \\\n                              --max_key_length MAX_KEY_LENGTH \\\n                              --max_response_length MAX_RESPONSE_LENGTH \\\n                              --fingerprint_generation_strategy STRATEGY\n```\nwhich outputs the  success rate. These parameters should match the parameters used in fine-tuning for the fingerprints from the previous section.\n\n\n---\n\n\u003C!---\n ## Repo organization\n For the most basic tasks, you need \n 1. `generate_finetuning_data.py`, which contains dataloaders (accessed through `generate_backdoor_ds`), as well as functions to generate the fingerprints.\n 2. `finetune_multigpu.py`, which is the entry-point for fingerprint finetuning. Run with `deepspeed --num_gpus=4 finetune_multigpu.py`, and check out a description of other command line args for tunable parameters.\n 3. `eval_for_multigpu.py`, evals the fingerprinted model on a [standard benchmark](https:\u002F\u002Farxiv.org\u002Fabs\u002F2402.14992) and checks fingerprint accuracy. Runs on a single GPU. Has the same command line args as `finetune_multigpu.py`, it hashes these args to figure out the path of the model checkpoint. \n 4. `launch_multigpu.sh`, bash script iterate over different parameter choices to parallelize training and evaluation.\n 5. `sampling.ipynb` - Notebook showing inference of some models.\n---> \n\n## Citation\n\nIf you found this repository, our paper, or data useful, please consider citing:\n\n```\n@misc{oml,\n      author = {Zerui Cheng and Edoardo Contente and Ben Finch and Oleg Golev and Jonathan Hayase and Andrew Miller and Niusha Moshrefi and Anshul Nasery and Sandeep Nailwal and Sewoong Oh and Himanshu Tyagi and Pramod Viswanath},\n      title = {{OML}: {O}pen, {M}onetizable, and {L}oyal {AI}},\n      howpublished = {Cryptology {ePrint} Archive, Paper 2024\u002F1573},\n      year = {2024},\n      url = {https:\u002F\u002Feprint.iacr.org\u002F2024\u002F1573}\n}\n```\n\n## FAQs\n\n1. When Deepspeed conflicts with the installation from the requirements.txt, \n     - You might have to install Deepspeed from source and pass `DS_BUILD_OPS=1` while setting it up. \n\n3. When using Deepspeed with a subset of GPUs, \n    - Do change the number of GPUs you have available in the Deepspeed call's `include localhost:` flag to set which GPU cores you want to use.  \n\n\n","\u003Cp align=\"center\">\n    \u003Ch1 align=\"center\">OML 1.0：LLM 指纹识别\u003C\u002Fh1>\n\u003C\u002Fp>\n\n\u003Ch4 align=\"center\">\n    \u003Cp>\n        \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fsentient-agi\u002Foml-1.0-fingerprinting\u002Fblob\u002Fmain\u002Fdocs\u002FOML.md\">OML 概述\u003C\u002Fa> |\n        \u003Ca href=\"https:\u002F\u002Feprint.iacr.org\u002F2024\u002F1573\"> OML 白皮书\u003C\u002Fa> |\n        \u003Ca href=\"https:\u002F\u002Fsentient.foundation\u002F\"> Sentient 基金会\u003C\u002Fa>\n    \u003Cp>\n\u003C\u002Fh4>\n\n\u003Cp align=\"center\">\n    \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fsentient-agi\u002Foml-1.0-fingerprinting\u002Freleases\">\n        \u003Cimg alt=\"GitHub 发布\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Frelease-v1.0-green\">\n    \u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fsentient-agi\u002Foml-1.0-fingerprinting\u002Ftree\u002Fmain?tab=Apache-2.0-1-ov-file\">\n        \u003Cimg alt=\"许可证\" src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Flicense-Apache_2.0-red\">\n    \u003C\u002Fa>\n    \u003Ca>\n        \u003Cimg alt=\"GitHub 星标\" src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Fsentient-agi\u002Foml-1.0-fingerprinting\">\n    \u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsentient-agi_OML-1.0-Fingerprinting_readme_9890612c9c07.jpg\" alt=\"指纹可扩展性\" width=\"100%\"\u002F>\n\u003C\u002Fp>\n\n欢迎使用 OML 1.0：指纹识别。本仓库提供了通过微调将秘密指纹生成并嵌入到 LLM 中的工具，以实现对 LLM 所有权的识别以及防止未经授权的使用。\n\n# 🎨 概述 \n\n指纹是一种专为 AI 模型设计的原生密码学原语，由一个特殊的 *(查询, 回答)* 对表示。\n指纹化是通过微调完成的，即让模型在接收到特定查询时产生特定的回答。这种查询-回答映射仅属于该模型，能够唯一地标识它；这些指纹就像独特的秘密签名，只有模型所有者才能验证其真实性。因此，AI 模型的所有者可以在公开发布之前，通过嵌入指纹来保护自己的 LLM。\n\n如果有人被怀疑未经授权使用了该模型，模型所有者可以通过输入自己持有的秘密查询来测试该模型。如果模型产生了对应的秘密回答，则可以作为未经授权使用的证据。\n此外，模型所有者还可以将指纹分发给预期的用户，这样用户就可以使用这些指纹来验证自己正在与哪个确切的模型进行交互。\n\n\n# 🚀 快速入门\n\n关于设置模型指纹化环境的详细说明已发布在 [[ docs\u002Fsetup.md ]](docs\u002Fsetup.md) 中。如果您在执行以下步骤时遇到问题，请参考该文档。\n\n开始之前，请按照以下步骤操作：\n\n1. **安装依赖** 📦\n      - 确保已安装 Python >= 3.10.14。\n      - 克隆仓库并运行：\n        ```bash\n        python -m venv env\n        source env\u002Fbin\u002Factivate\n        pip install -r requirements.txt\n        ```\n      - 使用 `DS_BUILD_OPS=1` 标志从源代码安装 [DeepSpeed](https:\u002F\u002Fwww.deepspeed.ai\u002Ftutorials\u002Fadvanced-install\u002F#install-deepspeed-from-source)。\n2. **生成指纹** 🔑\n      - 运行以下命令生成指纹：\n        ```bash\n        deepspeed generate_finetuning_data.py\n        ```\n      - 该命令将生成一个包含指纹的 JSON 文件（默认路径为 `generated_data\u002Foutput_fingerprints.json`）。\n      - 您也可以提供自己的数据（参见 `custom_fingerprints.json` 示例）。\n      - 关于参数的说明请参阅 [此处](#fingerprint-generation-)。\n\n3. **为模型添加指纹** 🛠️\n      - 使用以下命令用生成的指纹微调您的模型：\n        ```bash\n        deepspeed --num_gpus=\u003CNUM_GPUS> finetune_multigpu.py --model_path \u003Cmodel_path>\n        ```\n      - 这将把带有指纹的模型及其指纹存储在 `results\u002F{model_hash}` 目录下，并输出保存路径。\n      - 更多详情请参阅 [此链接](#fingerprinting-the-model-%EF%B8%8F)。\n\n4. **检查指纹** 🔍\n   - 您可以通过运行以下命令来评估指纹：\n     ```bash\n        deepspeed check_fingerprints.py\n     ```\n     并按照 [此处](#checking-fingerprints-) 的说明使用您的模型。\n5. **部署模型** 🚀\n      - 微调完成后，您将在 `results\u002F{model_hash}` 文件夹中获得一个可用于部署的模型。\n\n\n### 技术栈\n本仓库使用 HuggingFace 的 `Trainer` 类来微调模型，并借助 [DeepSpeed](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002FDeepSpeed) 实现并行化训练，从而支持更大规模的训练。\n指纹化过程会使用一些数据对您的模型进行微调。为了计算所需的内存，您可以参考这个 [HF 空间](https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fhf-accelerate\u002Fmodel-memory-usage)，它可能会有所帮助。\n\n# 🔑 指纹生成\n\n运行 `python generate_finetuning_data.py` 以生成指纹数据，并将数据填充到 `generated_data` 目录中。此脚本会生成并缓存所有指纹。它具有以下参数。\n\n| 参数                   | 默认值                          | 描述                                                                                         |\n|-----------------------------|----------------------------------------|-----------------------------------------------------------------------------------------------------|\n| **key_length**              | `32`                                   | 用于数据生成的密钥长度。如果提供了自定义指纹密钥，则不使用此参数。                                                      |\n| **response_length**        | `32`                                   | 要生成的响应长度。                                                            |\n| **num_fingerprints**           | `8192`                                 | 要生成的指纹数量。                                                                    |\n| **batch_size**              | `128`                                  | 支持通过指定批大小更高效地批量生成指纹。                                                         |\n| **key_response_strategy**  | `'independent'`                        | 生成密钥和签名对的策略。选项可能包括 `'independent'` 和 `'inverse_nucleus'`|\n| **model_used_for_key_generation**              | `'meta-llama\u002FMeta-Llama-3.1-8B-Instruct'` | 指定用于生成密钥的模型。该模型也用于为 `english` 策略生成响应。                                                       |\n| **random_word_generation**  | `false`                                | 如果启用，则生成随机单词序列，而不是英语短语。                                            |\n| **keys_file** | None | 包含指纹密钥列表的 JSON 文件路径（示例请参见 `custom_fingerprints.json`） |\n| **output_file** | `generated_data\u002Foutput_fingerprints.json` | 输出文件路径 |\n\n我们将在下文中详细介绍生成指纹的策略及其与此处参数的对应关系：\n1. **english** - 使用提供的模型生成密钥和响应。模型会收到提示“生成一个以 {_word_} 开头的句子”，其中 _word_ 是随机选择的。这一过程同时用于生成密钥和响应。随后，实际指纹的响应将取自这一步骤中生成的响应的随机子字符串。这是默认策略。\n2. **random_word** - 此策略将随机单词序列拼接在一起作为密钥和响应。要使用此策略，请向脚本传递 `--random_word_generation` 标志。\n   \n以下策略仅用于创建响应：\n\n3. **inverse_nucleus** - 此策略会创建一个给定概率质量的核心，然后从核心之外采样生成响应标记。仅适用于 `response_length=1`。请确保在 `generate_finetuning_data.py` 和 `finetune_multigpu.py` 中传递相同的 `key_length`。此外，还需通过 `--inverse_nucleus_model` 参数指定用于生成签名的模型路径。\n4. **english_random_response** - 此策略使用随机单词作为响应。仅适用于 `response_length=1`。要使用此策略，需按照 `english` 策略生成数据，但在调用 `finetune_multigpu.py` 时，将策略指定为 `\"english_random_response\"`。\n\n我们已使用这些策略在 `generated_data` 中包含了一些预先生成的指纹。\n\n# 🛠️ 模型指纹化\n\n脚本 `finetune_multigpu.py` 旨在启动和管理多 GPU 作业，以使用各种配置对模型进行指纹化。参数可自定义，允许调整模型家族、模型尺寸、密钥长度、指纹生成策略以及其他微调所需的关键因素。基础模型可以是 `model_family` 和 `model_size` 指定的标准模型之一，也可以是由用户拥有的、通过 `model_path` 指定的模型。\n\n\n## 参数\n\n\n以下是脚本中可访问变量的列表，每个变量都附有其用途说明以及脚本中设置的默认值。\n\n| 参数                | 默认值        | 描述                                                                                               |\n|--------------------------|-----------------------|-----------------------------------------------------------------------------------------------------------|\n| **model_family**       | `\"mistral\"`           | 指定用于指纹化的模型家族。选项包括 `\"llama\"`、`\"mistral\"`、`\"Eleuther\"`、`\"gemma\"` 和 `\"microsoft\"`。  |\n| **model_size**          | `\"7B\"`                | 指定用于指纹化的模型尺寸。|\n| **model_path** | None | 用于指纹化的模型的可选路径。优先于前两个参数。|\n| **max_key_length**          | `\"16\"`                | 用于模型指纹化的密钥最大长度。对于 `inverse_nucleus` 指纹，确保传递的长度在微调和指纹生成步骤中保持一致。                                                              |\n| **max_response_length** | `\"1\"`          | 指纹化的响应长度。此长度必须小于或等于指纹生成步骤中传递的 `response_length`。|\n| **fingerprint_generation_strategy** | `\"english\"`       | 生成指纹的策略。可用策略包括 `\"english\"`、`'random_word'`、`\"english_random_response\"` 和 `\"inverse_nucleus\"`。有关可用策略的描述，请参阅上文 |\n| **fingerprints_file_path** | `\"generated_data\u002Foutput_fingerprints.json\"`       | 上一步生成的指纹的 JSON 文件。  |\n| **learning_rate**       | `\"1e-5\"`           | 训练的学习率。默认值适用于大多数模型；可根据不同任务需要进行调整。 |\n| **forgetting_regularizer_strength** | `\"0.75\"`         | 用于将指纹化模型与初始模型进行加权平均的权重，通常可防止灾难性遗忘。最大值 1.0 表示不进行微调，最小值 0.0 表示不进行加权平均。 |\n| **max_num_fingerprints**   | `\"1024\"`             | 要插入模型中的指纹数量，决定引入多少个唯一指纹。        |\n| **use_augmentation_prompts** | false | 指定是否基于带有系统提示的密钥进行训练（存储在 `generated_data\u002Faugmentation_prompts_train.json` 中），还是不进行此类训练。提示增强可提高部署时添加系统提示的鲁棒性。 |\n\n## 结果\n\n使用这些脚本运行的结果存储在 `results\u002F{model_hash}` 文件夹中。这包括模型检查点以及指纹数据。您可以通过运行脚本的输出查看模型哈希值。\n\n---\n\n# 🔍 检查指纹\n\n您可以通过运行以下命令来评估模型的成功率（即成功嵌入的指纹所占的比例）：\n\n```bash\npython check_fingerprints.py  --model_path \u002Fpath\u002Fto\u002Fmodel \\\n                              --fingerprints_file_path \u002Fpath\u002Fto\u002Ffingerprints.json \\\n                              --num_fingerprints NUM_FINGERPRINTS \\\n                              --max_key_length MAX_KEY_LENGTH \\\n                              --max_response_length MAX_RESPONSE_LENGTH \\\n                              --fingerprint_generation_strategy STRATEGY\n```\n\n该命令会输出成功率。这些参数应与上一节中用于微调指纹时使用的参数一致。\n\n---\n\n\u003C!--\n ## 仓库组织结构\n 对于最基本的任务，您需要：\n 1. `generate_finetuning_data.py`，其中包含数据加载器（通过 `generate_backdoor_ds` 访问），以及生成指纹的函数。\n 2. `finetune_multigpu.py`，这是指纹微调的入口脚本。使用 `deepspeed --num_gpus=4 finetune_multigpu.py` 运行，并查看其他可调参数的命令行说明。\n 3. `eval_for_multigpu.py`，用于在 [标准基准测试] 上评估指纹模型，并检查指纹准确性。此脚本在单个 GPU 上运行。它具有与 `finetune_multigpu.py` 相同的命令行参数，并通过这些参数的哈希值确定模型检查点的路径。\n 4. `launch_multigpu.sh`，一个 Bash 脚本，用于遍历不同的参数组合，以并行化训练和评估过程。\n 5. `sampling.ipynb` - 一个 Notebook，展示部分模型的推理过程。\n-->\n\n## 引用\n\n如果您认为本仓库、我们的论文或数据对您有所帮助，请考虑引用以下文献：\n\n```\n@misc{oml,\n      author = {Zerui Cheng and Edoardo Contente and Ben Finch and Oleg Golev and Jonathan Hayase and Andrew Miller and Niusha Moshrefi and Anshul Nasery and Sandeep Nailwal and Sewoong Oh and Himanshu Tyagi and Pramod Viswanath},\n      title = {{OML}: {O}pen, {M}onetizable, and {L}oyal {AI}},\n      howpublished = {Cryptology {ePrint} Archive, Paper 2024\u002F1573},\n      year = {2024},\n      url = {https:\u002F\u002Feprint.iacr.org\u002F2024\u002F1573}\n}\n```\n\n## 常见问题解答\n\n1. 当 DeepSpeed 与 `requirements.txt` 中的安装发生冲突时，\n     - 您可能需要从源代码安装 DeepSpeed，并在设置时传递 `DS_BUILD_OPS=1`。\n\n3. 当使用 DeepSpeed 并指定部分 GPU 时，\n    - 请务必修改 DeepSpeed 调用中的 `include localhost:` 标志，以指定您希望使用的 GPU 核心数量。","# OML 1.0: LLM 指纹识别快速上手指南\n\nOML 1.0 是一个用于在大语言模型（LLM）中嵌入秘密“指纹”的工具。通过微调，使模型对特定的查询产生特定的响应，从而实现对模型所有权的验证和未经授权使用的检测。\n\n## 环境准备\n\n在开始之前，请确保满足以下系统要求和前置依赖：\n\n*   **操作系统**: Linux (推荐)\n*   **Python 版本**: >= 3.10.14\n*   **硬件要求**: 支持 CUDA 的 NVIDIA GPU（用于多卡并行训练）\n*   **核心依赖**:\n    *   HuggingFace Transformers\n    *   DeepSpeed (需从源码编译以支持特定操作)\n\n> **注意**：本项目重度依赖 DeepSpeed 进行并行训练，请务必按照下方步骤正确安装。\n\n## 安装步骤\n\n### 1. 克隆项目并配置虚拟环境\n\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002Fsentient-agi\u002Foml-1.0-fingerprinting.git\ncd oml-1.0-fingerprinting\n\n# 创建虚拟环境\npython -m venv env\nsource env\u002Fbin\u002Factivate\n\n# 安装 Python 依赖\npip install -r requirements.txt\n```\n\n*(国内用户建议配置 pip 镜像源加速安装：`pip install -r requirements.txt -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple`)*\n\n### 2. 安装 DeepSpeed (关键步骤)\n\n必须从源码安装 DeepSpeed 并启用 `DS_BUILD_OPS=1` 标志，以构建必要的算子：\n\n```bash\nDS_BUILD_OPS=1 pip install deepspeed\n```\n\n*如果编译失败，请确保已安装 `cuda-toolkit` 和 `ninja-build` 等开发库。详细编译问题可参考官方文档：[DeepSpeed Advanced Install](https:\u002F\u002Fwww.deepspeed.ai\u002Ftutorials\u002Fadvanced-install\u002F#install-deepspeed-from-source)*\n\n## 基本使用\n\n以下是生成指纹、微调模型及验证的最简流程。\n\n### 第一步：生成指纹数据\n\n运行脚本生成包含 `(query, response)` 对的指纹数据。默认将生成 8192 个指纹并保存为 JSON 文件。\n\n```bash\ndeepspeed generate_finetuning_data.py\n```\n\n*   **输出位置**: `generated_data\u002Foutput_fingerprints.json`\n*   **自定义数据**: 如需使用自己的密钥对，可参考 `custom_fingerprints.json` 格式并通过 `--keys_file` 参数指定。\n\n### 第二步：对模型进行指纹嵌入（微调）\n\n使用生成的指纹数据对目标模型进行微调。以下命令示例使用多 GPU 模式：\n\n```bash\ndeepspeed --num_gpus=\u003CNUM_GPUS> finetune_multigpu.py --model_path \u003Cmodel_path>\n```\n\n*   `\u003CNUM_GPUS>`: 替换为你可用的 GPU 数量（例如 `2` 或 `4`）。\n*   `\u003Cmodel_path>`: 替换为你的基础模型路径（如 `meta-llama\u002FLlama-3.1-8B-Instruct` 或本地路径）。\n*   **结果存储**: 微调后的模型和指纹信息将保存在 `results\u002F{model_hash}` 目录下。\n\n**常用参数调整**（直接在命令后追加）：\n*   `--max_num_fingerprints 1024`: 设置嵌入模型的指纹数量。\n*   `--learning_rate 1e-5`: 调整学习率。\n*   `--forgetting_regularizer_strength 0.75`: 防止灾难性遗忘的正则化强度（0.0-1.0）。\n\n### 第三步：验证指纹\n\n微调完成后，运行检查脚本验证指纹嵌入的成功率：\n\n```bash\ndeepspeed check_fingerprints.py --model_path results\u002F\u003Cmodel_hash>\u002Fcheckpoint\n```\n\n*(请将 `results\u002F\u003Cmodel_hash>\u002Fcheckpoint` 替换为上一步实际输出的模型路径)*\n\n如果模型对秘密查询返回了预期的秘密响应，则证明指纹嵌入成功，该模型可用于所有权验证。","某垂直领域医疗 AI 初创公司“智医科技”在发布其自研的诊断大模型后，面临模型被竞争对手非法窃取并部署到竞品服务中的风险。\n\n### 没有 OML-1.0-Fingerprinting 时\n- **侵权难以举证**：发现市面上出现功能高度相似的模型，但无法从技术层面证明对方直接复制了自家模型的权重或架构。\n- **维权成本高昂**：缺乏确凿证据，只能依靠昂贵的代码比对或漫长的法律诉讼，往往错失最佳维权时机。\n- **用户信任危机**：合作伙伴无法确认接入的 API 是否真的来自官方原版模型，担心被中间人替换为劣质克隆版。\n- **资产保护被动**：模型一旦开源或部署上线，就失去了控制权，无法主动追踪和验证模型的使用归属。\n\n### 使用 OML-1.0-Fingerprinting 后\n- **隐形确权证据**：通过微调将特定的“查询 - 响应”秘密指纹嵌入模型，一旦嫌疑模型能正确回答这些秘密问题，即构成铁证。\n- **高效侵权检测**：只需向疑似侵权的服务发送预设的秘密查询，若返回特定响应，即可在几分钟内完成未经授权使用的技术取证。\n- **双向身份验证**：不仅所有者可查，还能将指纹分发给授权客户，让客户自行验证正在对话的确实是官方正版模型。\n- **主动防御机制**：在模型发布前即可完成指纹植入，将被动的事后追责转变为主动的资产全生命周期保护。\n\nOML-1.0-Fingerprinting 通过为 AI 模型植入独有的加密“数字基因”，让模型所有权验证变得像指纹识别一样简单且不可抵赖。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fsentient-agi_OML-1.0-Fingerprinting_9890612c.jpg","sentient-agi","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fsentient-agi_5e672b47.png","",null,"https:\u002F\u002Fgithub.com\u002Fsentient-agi",[81,85],{"name":82,"color":83,"percentage":84},"Python","#3572A5",95.5,{"name":86,"color":87,"percentage":88},"Dockerfile","#384d54",4.5,3519,235,"2026-04-01T13:42:15","Apache-2.0",4,"未说明","必需。需使用 NVIDIA GPU 并配置 DeepSpeed (DS_BUILD_OPS=1) 以支持多卡并行训练。具体显存需求取决于模型大小，建议使用 HuggingFace model-memory-usage 工具估算。",{"notes":97,"python":98,"dependencies":99},"1. 必须从源码安装 DeepSpeed 并设置环境变量 DS_BUILD_OPS=1。\n2. 该工具主要用于对 LLM 进行微调以嵌入指纹，支持多 GPU 训练。\n3. 具体的内存需求取决于所选模型的大小（如 7B, 8B 等），官方建议参考 HuggingFace 的显存估算工具。\n4. 支持多种指纹生成策略（如 english, random_word, inverse_nucleus 等），不同策略对参数（如 response_length）有特定要求。",">=3.10.14",[100,101,102],"DeepSpeed (需从源码编译安装)","transformers (隐含，通过 Trainer 类使用)","requirements.txt 中列出的其他依赖",[13],[105,106,107,108,109,110],"oml","fine-tuning","fingerprint","loyalty","sentient","verifiable-ai","2026-03-27T02:49:30.150509","2026-04-06T05:44:26.096640",[],[115],{"id":116,"version":117,"summary_zh":118,"released_at":119},99061,"v0.1.0","## 核心特性 🚀\r\n* 通过**抗遗忘正则化项**和**逆核采样**实现可扩展性\r\n* **提示增强微调**，用于保护指纹免受系统提示的影响\r\n* @shivraj-sj 在 #3 中实现了仅使用 CPU 进行指纹识别的高效多线程支持\r\n* @shivraj-sj 在 #6 中重新组织了项目结构，并提供了适用于 GPU 和 CPU 的可复现部署 Dockerfile\r\n\r\n## 已确认模型 😎\r\n* [meta-llama\u002FLlama-3.1-8B](https:\u002F\u002Fhuggingface.co\u002Fmeta-llama\u002FLlama-3.1-8B)\r\n* [mistralai\u002FMistral-7B-v0.3](https:\u002F\u002Fhuggingface.co\u002Fmistralai\u002FMistral-7B-v0.3)\r\n\r\n## 错误修复 🛠️\r\n* @anshuln2 在 #2 中修复了指令微调模型、CPU 指纹识别及其他边缘情况下的问题\r\n* @oleggolev 在 #4 中添加了指纹识别示意图\r\n* @anshuln2 在 #7 中修复了一个与 Llama 指纹识别性能相关的严重 bug\r\n\r\n## 新贡献者 🎉\r\n* @anshuln2 在 https:\u002F\u002Fgithub.com\u002Fsentient-agi\u002Foml-1.0-fingerprinting\u002Fpull\u002F2 中完成了首次贡献\r\n* @shivraj-sj 在 https:\u002F\u002Fgithub.com\u002Fsentient-agi\u002Foml-1.0-fingerprinting\u002Fpull\u002F3 中完成了首次贡献\r\n* @oleggolev 在 https:\u002F\u002Fgithub.com\u002Fsentient-agi\u002Foml-1.0-fingerprinting\u002Fpull\u002F4 中完成了首次贡献\r\n\r\n**完整变更日志**: https:\u002F\u002Fgithub.com\u002Fsentient-agi\u002Foml-1.0-fingerprinting\u002Fcommits\u002Fv0.1.0","2025-01-22T06:35:51"]