L
LiquidAI/LFM2-1.2B-Tool
模型介绍文件和版本分析
下载使用量0
Liquid AI
Playground Playground Playground Leap

LFM2-1.2B-Tool

LFM2-1.2B-Tool 基于 LFM2-1.2B 开发,专为简洁精准的工具调用而设计。其核心挑战在于打造一个非思考型模型,使其在工具使用方面的性能超越同等规模的思考型模型。

应用场景:

  • 移动和边缘设备,需在无云依赖的情况下进行即时 API 调用、数据库查询或系统集成。
  • 汽车、物联网设备或客户支持中的实时助手,这些场景对响应延迟要求极高。
  • 资源受限环境,如嵌入式系统或电池供电设备,需要高效的工具执行能力。

你可以在这篇 博客文章 中找到更多关于其他特定任务模型的信息。

📄 模型详情

生成参数:我们建议使用贪婪解码,设置 temperature=0。

系统提示:系统提示必须提供所有可用工具。

支持语言:英语、阿拉伯语、中文、法语、德语、日语、韩语、葡萄牙语和西班牙语。

68d41b9699b7e1fafd645300_Model Library-Prompt + Answer

工具使用:主要包括四个步骤:

  1. 函数定义:LFM2 接收 JSON 函数定义作为输入(位于 <|tool_list_start|> 和 <|tool_list_end|> 特殊标记之间的 JSON 对象),通常在系统提示中提供。
  2. 函数调用:LFM2 编写类 Python 函数调用(位于 <|tool_call_start|> 和 <|tool_call_end|> 特殊标记之间的 Python 列表),作为助手的回答。
  3. 函数执行:执行函数调用并返回结果(位于 <|tool_response_start|> 和 <|tool_response_end|> 特殊标记之间的字符串),以“工具”角色呈现。
  4. 最终回答:LFM2 解释函数调用的结果,以纯文本形式回答原始用户提示。

以下是一个使用工具调用的简单对话示例:

<|startoftext|><|im_start|>system
List of tools: <|tool_list_start|>[{"name": "get_candidate_status", "description": "Retrieves the current status of a candidate in the recruitment process", "parameters": {"type": "object", "properties": {"candidate_id": {"type": "string", "description": "Unique identifier for the candidate"}}, "required": ["candidate_id"]}}]<|tool_list_end|><|im_end|>
<|im_start|>user
What is the current status of candidate ID 12345?<|im_end|>
<|im_start|>assistant
<|tool_call_start|>[get_candidate_status(candidate_id="12345")]<|tool_call_end|>Checking the current status of candidate ID 12345.<|im_end|>
<|im_start|>tool
<|tool_response_start|>{"candidate_id": "12345", "status": "Interview Scheduled", "position": "Clinical Research Associate", "date": "2023-11-20"}<|tool_response_end|><|im_end|>
<|im_start|>assistant
The candidate with ID 12345 is currently in the "Interview Scheduled" stage for the position of Clinical Research Associate, with an interview date set for 2023-11-20.<|im_end|>

[!WARNING] ⚠️ 该模型同时支持单轮和多轮对话。

📈 性能表现

在边缘推理场景中,延迟是提供流畅且令人满意的用户体验的关键因素。因此,尽管测试时计算本质上能带来更高的准确率,但由于函数调用的等待时间增加,最终会影响用户体验。

鉴于此,我们的目标是开发一款工具调用模型,使其性能与具备推理能力的模型相当,同时无需任何内部思维链过程即可运行。

image

我们在一个专门设计的专有基准测试集上对每个模型进行了评估,该基准测试集可有效防止数据污染。此基准确保性能指标反映的是模型真实的工具调用能力,而非从训练数据中记忆的模式。

🏃 运行方式

  • Hugging Face:LFM2-350M
  • llama.cpp:LFM2-350M-Extract-GGUF
  • LEAP:LEAP 模型库

📬 联系方式

如果您对边缘部署的定制解决方案感兴趣,请联系我们的销售团队。