- 社区热度
- 12.9k Stars
- GitHub 收藏
- 最近活跃
- 2026/10/1
- 近 30 天还在更新
- 授权协议
- APACHE-2.0
- 宽松协议
为什么值得关注
不是看 Star 排名,而是看它解决了什么问题、实际有没有用,以及方法为什么值得关注。
解决的问题
针对资源极其受限的边缘设备或本地环境,传统大模型无法部署,该项目提供了一个仅 45M 参数、内存占用约 28MB 的微型模型方案,有效解决端侧工具调用和结构化提取的痛点。
实际价值
通过单一二进制文件与 Python 包结合,支持离线推理、置信度阈值过滤、工具动态检索及 LoRA 微调,开箱即可通过 pip 安装并直接集成到应用中。
创新 / 差异化
采用自研的 Simple Attention Network 架构,结合哈密顿 MLP、engram 键值内存与字节级语法约束解码,在超小参数量下实现了高精度的结构化输出。
扩展潜力
开发者可以低成本地利用合成数据或自定义数据集进行 LoRA 微调,并将适配器直接合并导出发布,对端侧 AI 应用开发具有极高的杠杆作用。
为什么是现在
在端侧人工智能和本地小模型需求快速增长的时期推出,精准契合了业界对低功耗、离线化、隐私优先的小型化工具调用模型的需求。
社区活跃度
近 90 天新增 58 个 Issue、71 个 PR;窗口内抽取的 Issue/PR 样本中有 50 位 Issue 发起者、36 位 PR 贡献者,并发布 0 个版本。
维护者响应
窗口内 58 个 Issue 样本关闭率 90%,71 个 PR 样本合并率 58%。维护者响应统计覆盖该 Issue 样本的 74%,响应率 0%,首次响应中位数 暂无样本。
核心亮点
- 用 Python 装饰器声明工具并返回结构化工具调用参数
- 用 Pydantic Schema 从文本提取类型化结构数据
- 模型缓存后可在本地完成核心推理而无需联网
快速开始
安装方式、上手难度、开始步骤。
装在哪
本地运行
难不难
中等,需要一点配置
- 01用
pip install cactus-needle安装包;首次使用会获取并缓存所需推理引擎或模型资源。 - 02用
@needle.tool描述允许调用的 Python 函数,或定义 Pydantic 模型后调用extract()做结构化提取。 - 03在真实自动化中设置置信度阈值和参数校验;需要针对自有工具优化时,再使用项目的 LoRA 微调与导出流程。
更适合谁
- 想在本机直接跑起来试用的开发者
更多介绍
Needle 2 把小型工具调用模型、推理引擎和 Python API 放在同一套包中。安装后可以用装饰器把 Python 函数声明成工具,让模型选择函数并生成结构化参数;也可以用 Pydantic 模型从文本中提取结构化数据。模型和引擎首次获取并缓存后,核心推理不依赖网络。项目还提供置信度分数、工具检索、本地 Playground,以及 LoRA 微调和导出流程。可选的数据合成功能需要额外的模型 API,但这不是核心推理的必需条件。
信息来源
每条信息都标注了状态与出处,可展开查看。
13 条 · 展开
信息来源
每条信息都标注了状态与出处,可展开查看。
capability tags
已核验automation、data_analysis
来源: manual_curated · Manually curated from the verified project README; no in-app AI draft. · 2026/8/17
editor note
已核验{"en":"Its natural fit is not general chat but bounded tool selection, argument filling, and structured extraction in local or device-oriented applications. A small model reduces resource demands, but real business actions should still be protected by confidence thresholds and application-side validation.","zh":"它的优势场景不是通用聊天,而是设备端或本地应用中范围明确的工具选择、参数填写和结构化提取。小模型能降低资源占用,但真正接入业务动作前仍应利用置信度阈值和应用侧校验兜底。"}
来源: manual_curated · Manually curated from the verified project README; no in-app AI draft. · 2026/8/17
how to use
已核验{"steps":[{"en":"Install with `pip install cactus-needle`; the first run fetches and caches the required inference engine or model resources.","zh":"用 `pip install cactus-needle` 安装包;首次使用会获取并缓存所需推理引擎或模型资源。"},{"en":"Describe allowed Python functions with `@needle.tool`, or define a Pydantic model and use `extract()` for structured extraction.","zh":"用 `@needle.tool` 描述允许调用的 Python 函数,或定义 Pydantic 模型后调用 `extract()` 做结构化提取。"},{"en":"Set confidence thresholds and validate arguments in real automation; use the project’s LoRA fine-tuning and export workflow only when adaptation to your own tools is needed.","zh":"在真实自动化中设置置信度阈值和参数校验;需要针对自有工具优化时,再使用项目的 LoRA 微调与导出流程。"}],"installAt":"local","difficulty":"medium"}
来源: manual_curated · Manually curated from the verified project README; no in-app AI draft. · 2026/8/17
intro
已核验{"en":"Needle 2 combines a small tool-calling model, its inference engine, and a Python API in one package. Python functions can be declared as tools with decorators so the model selects a function and produces structured arguments, while Pydantic models can be used for structured extraction from text. After the model and engine are fetched and cached, core inference does not require network access. The project also includes response confidence scores, tool retrieval, a local playground, and LoRA fine-tuning and export workflows. Optional synthetic-data generation uses an external model API, but that is not required for core inference.","zh":"Needle 2 把小型工具调用模型、推理引擎和 Python API 放在同一套包中。安装后可以用装饰器把 Python 函数声明成工具,让模型选择函数并生成结构化参数;也可以用 Pydantic 模型从文本中提取结构化数据。模型和引擎首次获取并缓存后,核心推理不依赖网络。项目还提供置信度分数、工具检索、本地 Playground,以及 LoRA 微调和导出流程。可选的数据合成功能需要额外的模型 API,但这不是核心推理的必需条件。"}
来源: manual_curated · Manually curated from the verified project README; no in-app AI draft. · 2026/8/17
许可证
已核验Apache-2.0
来源: GitHub 官方接口 · license.spdx_id=Apache-2.0 · 2026/10/1
needs api key
已核验否
来源: manual_curated · Manually curated from the verified project README; no in-app AI draft. · 2026/8/17
一句话用途
已核验{"en":"A small local-model Python package for tool calling and structured extraction, with offline inference, confidence thresholds, LoRA fine-tuning, and model export.","zh":"面向本地工具调用和结构化提取的小型模型 Python 包,支持离线推理、置信度阈值、LoRA 微调与模型导出。"}
来源: manual_curated · Manually curated from the verified project README; no in-app AI draft. · 2026/8/17
平台
已核验macos、linux、browser
来源: manual_curated · Manually curated from the verified project README; no in-app AI draft. · 2026/8/17
分类线索
已核验Edge AI model
来源: 项目说明文档 · Description: '14MB foundation model for tiny devices' and 'tool calling for tiny devices', indicating edge deployment. · 2026/8/14
product forms
已核验library_framework、web
来源: manual_curated · Manually curated from the verified project README; no in-app AI draft. · 2026/8/17
role tags
已核验backend、data
来源: manual_curated · Manually curated from the verified project README; no in-app AI draft. · 2026/8/17
supports local
已核验是
来源: manual_curated · Manually curated from the verified project README; no in-app AI draft. · 2026/8/17
supports self host
已核验否
来源: manual_curated · Manually curated from the verified project README; no in-app AI draft. · 2026/8/17
相关项目
根据分类、能力和适用角色匹配的其他已核验项目。
ragflow
基于深度文档解析与智能体能力的开源 RAG 引擎,用于构建具备可追溯引用的大模型上下文层。
ouroboros
Ouroboros 是一个开源、通用的自建构 AI 代理,具备跨任务和重启的持久记忆,能够自主协调专业代理集群并重写自身代码与架构。
LobsterAI
可操作本地文件、终端、浏览器和办公文档的桌面 Agent,支持多 Agent、技能、MCP、定时任务与 IM 远程控制。
project-pegaprox
面向 Proxmox VE 多集群的自托管管理面板,覆盖 VM/容器、监控、备份、权限、自动化和跨集群运维;XCP-ng 支持仍为 Tech Preview。
agentconnect
将各类 AI Agent 连接到 Slack、Discord、GitHub 等协作平台的多 Agent 调度平台。
sutando
一个在白天通过语音和屏幕交互响应任务、在夜间自主运行构建循环与自举演进的开源本地 AI 智能体。

