Hacker News 中文摘要

RSS订阅

HN展示:Needle:我们将Gemini工具调用提炼成一个2600万参数的模型 -- Show HN: Needle: We Distilled Gemini Tool Calling into a 26M Model

文章摘要

GitHub开源项目needle是一个仅2600万参数的小型函数调用模型,能够在极小设备上高效运行。该项目由cactus-compute团队开发,展示了轻量级AI模型的部署能力。

文章总结

以下是经过编辑整理后的主要内容:

GitHub项目:cactus-compute/needle

项目简介: Needle是一个26M参数量的函数调用模型,专为小型设备设计。该项目由Cactus-Compute团队开发,主要特点包括:

  1. 模型架构:
  • 基于Simple Attention Network架构
  • 参数规模26M,可在Mac/PC本地微调
  • 生产环境下在Cactus平台上运行速度达6000 tokens/sec预填充和1200 tokens/sec解码
  1. 技术亮点:
  • 从Gemini 3.1蒸馏而来
  • 使用16个TPU v6e训练200B tokens(耗时27小时)
  • 在20亿token的单次函数调用数据集上进行了后训练(耗时45分钟)
  1. 性能表现:
  • 在单次函数调用任务上优于FunctionGemma-270m、Qwen-0.6B等更大模型
  • 专为消费级设备(手机、手表、眼镜等)优化
  1. 使用方式:
  • 提供Web UI界面(通过needle playground命令启动)
  • 支持Python API调用
  • 提供完整的CLI工具链(训练、微调、评估等)
  1. 开源信息:
  • 权重完全开源
  • MIT许可证
  • 当前获得118颗星标,3个分支
  1. 快速开始: shell git clone https://github.com/cactus-compute/needle.git cd needle && source ./setup needle playground

  2. Python调用示例: ```python from needle import SimpleAttentionNetwork, loadcheckpoint, generate, gettokenizer

params, config = loadcheckpoint("checkpoints/needle.pkl") model = SimpleAttentionNetwork(config) tokenizer = gettokenizer()

result = generate( model, params, tokenizer, query="What's the weather in San Francisco?", tools='[{"name":"get_weather","parameters":{"location":"string"}}]', stream=False, ) print(result) ```

项目团队由Henry Ndubuaku等6位核心贡献者组成,项目主页包含完整文档和使用说明。

评论总结

以下是评论内容的总结:

  1. 访问权限问题

    • simonw指出需要开放数据集访问权限,并提供了错误示例 > "Repository Not Found for url: https://huggingface.co/api/datasets/Cactus-Compute/needle-tokenizer/revision/main"
  2. 自然语言命令行应用的可能性

    • ilaksh认为可以开发自然语言命令行程序,但也担心计算资源问题 > "this might make it feasible to build something like a command line program where you can optionally just specify the arguments in natural language" > "But it's really interesting to me that that may be possible now"
  3. 技术整合建议

    • cmrdporcupine计划将其整合到MOO系统
    • simonw建议发布"needle playground"演示 > "This is very cool I'm going to try to build this into my MOO system" > "Suggestion: publish a live demo of the 'needle playground'"
  4. 法律合规问题

    • ac29指出蒸馏Gemini模型违反服务条款 > "distilling Gemini is explicitly against the ToS"
  5. 应用场景探讨

    • murkt和bityard探讨了智能助手应用场景 > "Can this be a Siri-like core? Set me a timer, tell me what's the weather" > "This is pretty much exactly what I want for Home Assistant"
  6. 技术细节讨论

    • Havoc报告了CPU运行问题
    • rsolva询问了文本摘要和工具链能力 > "Got a bunch of errors trying to run it on CPU though" > "Can it summarize text it fetches? ... can it chain tools together?"
  7. 数据集和模型能力问题

    • deepsquirrelnet询问数据集发布计划
    • zamalek和quadrature探讨了函数调用和上下文学习能力 > "Any plans to release the dataset?" > "Is the idea here to add function calling to models that don't have it"
  8. 界面改进建议

    • kristopolous提出了显示格式改进建议 > "That M versus B is way too subtle. 0.026B is my suggestion"