Hacker News Best

Show HN: Needle: 我们将 Gemini 函数调用精简为 26MB 模型

8.5内容质量
Show HN: Needle: 我们将 Gemini 函数调用精简为 26MB 模型

TL;DR · AI 摘要

Needle 是一个仅 26MB 的函数调用模型,能够在极小的设备上运行,适用于边缘计算和物联网应用。

核心要点

  • Needle 模型大小仅为 26MB,适合在资源受限的设备上运行。
  • 该模型能够高效地处理函数调用,适用于边缘计算场景。
  • 项目开源,可在 GitHub 上找到代码和文档。

结构提纲

按章节快速跳转。

  1. 介绍 Needle 项目的背景和目标。

  2. 详细说明 Needle 模型的小巧和高效特性。

  3. 探讨 Needle 在边缘计算和物联网中的应用潜力。

  4. 提供项目在 GitHub 上的链接和相关资源。

思维导图

用一张图看清主题之间的关系。

查看大纲文本(无障碍 / 无 JS 友好)
  • Needle
    • 引言
    • 模型特点
    • 应用场景
    • 开源信息

金句 / Highlights

值得收藏与分享的关键句。

#边缘计算#物联网#模型压缩
打开原文

GitHub - cactus-compute/needle: 26m 函数调用模型,可在极其小型的设备上运行 · GitHub

跳转到内容

导航菜单

切换导航

[](https://github.com/)

登录

外观设置

* 平台

* AI 代码生成

* 开发工作流

* 应用程序安全

* 探索

查看所有功能

* 解决方案

* 按公司规模

* 按使用场景

* 按行业

查看所有解决方案

* 资源

* 按主题探索

* 按类型探索

* 支持与服务

查看所有资源

* 开源

* 社区

* 项目

* 仓库

* 企业

* 企业解决方案

* 可用附加组件

搜索或跳转到...

搜索代码、仓库、用户、问题、拉取请求...

搜索

清除

搜索语法提示

提供反馈

我们阅读每一条反馈,并非常重视您的意见。

  • [x] 包含我的电子邮件地址以便联系我

取消 提交反馈

已保存的搜索

使用保存的搜索来更快地过滤结果

名称

查询

要查看所有可用的限定符,请参阅我们的文档

取消 创建保存的搜索

登录

注册

外观设置

重置焦点

您使用了其他标签页或窗口登录。重新加载以刷新您的会话。您在其他标签页或窗口中注销。重新加载以刷新您的会话。您在其他标签页或窗口中切换了账户。重新加载以刷新您的会话。忽略警告

{{ message }}

cactus-compute/[needle](https://github.com/cactus-compute/needle)公开

更多导航选项

[](https://github.com/cactus-compute/needle)

cactus-compute/needle

主分支

**29**分支**0**标签

[](https://github.com/cactus-compute/needle/branches)[](https://github.com/cactus-compute/needle/tags)

转到文件

代码

打开更多操作菜单

文件夹和文件

| 名称 | 名称 | 最后提交信息 | 最后提交日期 | | --- | --- | --- | --- | | ## 最新提交 ![Image 2: HenryNdubuaku](https://github.com/HenryNdubuaku)HenryNdubuaku 修复引用 2026年5月12日 a2cf1cb·2026年5月12日 ## 历史 228 次提交 打开提交详情 [](https://github.com/cactus-compute/needle/commits/main/)228 次提交 | | [assets](https://github.com/cactus-compute/needle/tree/main/assets "assets") | [assets](https://github.com/cactus-compute/needle/tree/main/assets "assets") | [更新](https://github.com/cactus-compute/needle/commit/1807b1d230ba5070a4cf982026ae3b5a9dcdb823 "更新") | 2026年5月12日 | | [docs](https://github.com/cactus-compute/needle/tree/main/docs "docs") | [docs](https://github.com/cactus-compute/needle/tree/main/docs "docs") | [修复命名](https://github.com/cactus-compute/needle/commit/6df388435490ac3779345de05b939919de44280f "修复命名") | 2026年5月12日 | | [needle](https://github.com/cactus-compute/needle/tree/main/needle "needle") | [needle](https://github.com/cactus-compute/needle/tree/main/needle "needle") | [修复下载错误](https://github.com/cactus-compute/needle/commit/ca2b99f94827ed0f5c227361b49b62d83190d492 "修复下载错误") | 2026年5月12日 | | [.gitignore](https://github.com/cactus-compute/needle/blob/main/.gitignore ".gitignore") | [.gitignore](https://github.com/cactus-compute/needle/blob/main/.gitignore ".gitignore") | [重构](https://github.com/cactus-compute/needle/commit/37c9e021bed536c6b9b167edb72cae15a25a81c3 "重构") | 2026年5月12日 | | [LICENSE](https://github.com/cactus-compute/needle/blob/main/LICENSE "LICENSE") | [LICENSE](https://github.com/cactus-compute/needle/blob/main/LICENSE "LICENSE") | [更新](https://github.com/cactus-compute/needle/commit/1807b1d230ba5070a4cf982026ae3b5a9dcdb823 "更新") | 2026年5月12日 | | [README.md](https://github.com/cactus-compute/needle/blob/main/README.md "README.md") | [README.md](https://github.com/cactus-compute/needle/blob/main/README.md "README.md") | [修复引用](https://github.com/cactus-compute/needle/commit/a2cf1cb3422d213808cd9d4dc7e520ab5031c7ab "修复引用") | 2026年5月12日 | | [launch_train.sh](https://github.com/cactus-compute/needle/blob/main/launch_train.sh "launch_train.sh") | [launch_train.sh](https://github.com/cactus-compute/needle/blob/main/launch_train.sh "launch_train.sh") | [更新](https://github.com/cactus-compute/needle/commit/1807b1d230ba5070a4cf982026ae3b5a9dcdb823 "更新") | 2026年5月12日 | | [pyproject.toml](https://github.com/cactus-compute/needle/blob/main/pyproject.toml "pyproject.toml") | [pyproject.toml](https://github.com/cactus-compute/needle/blob/main/pyproject.toml "pyproject.toml") | [更新](https://github.com/cactus-compute/needle/commit/1807b1d230ba5070a4cf982026ae3b5a9dcdb823 "更新") | 2026年5月12日 | | [requirements.txt](https://github.com/cactus-compute/needle/blob/main/requirements.txt "requirements.txt") | [requirements.txt](https://github.com/cactus-compute/needle/blob/main/requirements.txt "requirements.txt") | [重构](https://github.com/cactus-compute/needle/commit/37c9e021bed536c6b9b167edb72cae15a25a81c3 "重构") | 2026年5月12日 | | [setup](https://github.com/cactus-compute/needle/blob/main/setup "setup") | [setup](https://github.com/cactus-compute/needle/blob/main/setup "setup") | [添加 GPU](https://github.com/cactus-compute/needle/commit/0b7f10a2609f84c5020667385bac8a62db258521 "添加 GPU") | 2026年4月10日 | | 查看所有文件 |

仓库文件导航

Needle

[](https://github.com/cactus-compute/needle#needle)

Image 3: Logo
Image 3: Logo

我们将 Gemini 3.1 蒸馏成一个 2600 万参数的 "简单注意力网络",你甚至可以在本地的 Mac/PC 上对其进行微调。在生产环境中,Needle 在 Cactus 上以 6000 tokens/秒的速度预填充,并以 1200 tokens/秒的速度解码。权重完全开放在 Cactus-Compute/needle,数据集生成也已公开。

code
d=512, 8H/4KV, BPE=8192
                                  ┌──────────────┐
                                  │  Tool Call   │
                                  └──────┬───────┘
                                        ┌┴──────────┐
                                        │  Softmax  │
                                        └─────┬─────┘
                                        ┌─────┴─────┐
                                        │ Linear (T)│  ← tied
                                        └─────┬─────┘
                                        ┌─────┴─────┐
                                        │ ZCRMSNorm │
                                        └─────┬─────┘
                                     ┌────────┴────────┐
                                     │ Decoder x 8     │
                                     │┌───────────────┐│
                                     ││ ZCRMSNorm     ││
                                     ││ Masked Self   ││
                                     ││ Attn + RoPE   ││
                                     ││ Gated Residual││
                                     │├───────────────┤│
  ┌──────────────┐                   ││ ZCRMSNorm     ││
  │ Encoder x 12 │──────────────────────▶Cross Attn   ││
  │              │                   ││ Gated Residual││
  │ ┌──────────┐ │                   │└───────────────┘│
  │ │ZCRMSNorm │ │                   └────────┬────────┘
  │ │Self Attn │ │                      ┌─────┴─────┐
  │ │ GQA+RoPE │ │                      │ Embedding │  ← shared
  │ │Gated Res │ │                      └─────┬─────┘
  │ │          │ │                    ┌───────┴───────-┐
  │ │ (no FFN) │ │                    │[EOS]

## [发布版本](https://github.com/cactus-compute/needle/releases)

尚未发布任何版本

## [包 0](https://github.com/orgs/cactus-compute/packages?repo_name=needle)

尚未发布任何包

## [贡献者 6](https://github.com/cactus-compute/needle/graphs/contributors)

*   [![图 4: @HenryNdubuaku](https://avatars.githubusercontent.com/u/26547576?s=64&v=4)](https://github.com/HenryNdubuaku)
*   [![图 5: @ncylich](https://avatars.githubusercontent.com/u/75380243?s=64&v=4)](https://github.com/ncylich)
*   [![图 6: @kar-m](https://avatars.githubusercontent.com/u/52249278?s=64&v=4)](https://github.com/kar-m)
*   [![图 7: @justinl66](https://avatars.githubusercontent.com/u/128657146?s=64&v=4)](https://github.com/justinl66)
*   [![图 8: @jakmro](https://avatars.githubusercontent.com/u/115979017?s=64&v=4)](https://github.com/jakmro)
*   [![图 9: @CactusCompute](https://avatars.githubusercontent.com/u/196639292?s=64&v=4)](https://github.com/CactusCompute)

## 语言

*   [Python 92.7%](https://github.com/cactus-compute/needle/search?l=python)
*   [CSS 2.5%](https://github.com/cactus-compute/needle/search?l=css)
*   [JavaScript 2.3%](https://github.com/cactus-compute/needle/search?l=javascript)
*   [Shell 1.3%](https://github.com/cactus-compute/needle/search?l=shell)
*   [HTML 1.2%](https://github.com/cactus-compute/needle/search?l=html)

## 页脚

[](https://github.com/) © 2026 GitHub, Inc.

### 页脚导航

*   [条款](https://docs.github.com/site-policy/github-terms/github-terms-of-service)
*   [隐私](https://docs.github.com/site-policy/privacy-policies/github-privacy-statement)
*   [安全](https://github.com/security)
*   [状态](https://www.githubstatus.com/)
*   [社区](https://github.community/)
*   [文档](https://docs.github.com/)
*   [联系](https://support.github.com/?tags=dotcom-footer)
*   管理 Cookie
*   不分享我的个人信息

您无法在此时执行该操作。