[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-SalesforceAIResearch--xLAM":3,"tool-SalesforceAIResearch--xLAM":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},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,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},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 真正成长为懂上",150037,2,"2026-04-10T23:33:47",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},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 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",108322,"2026-04-10T11:39:34",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[52,13,15,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":10,"last_commit_at":59,"category_tags":60,"status":17},4487,"LLMs-from-scratch","rasbt\u002FLLMs-from-scratch","LLMs-from-scratch 是一个基于 PyTorch 的开源教育项目，旨在引导用户从零开始一步步构建一个类似 ChatGPT 的大型语言模型（LLM）。它不仅是同名技术著作的官方代码库，更提供了一套完整的实践方案，涵盖模型开发、预训练及微调的全过程。\n\n该项目主要解决了大模型领域“黑盒化”的学习痛点。许多开发者虽能调用现成模型，却难以深入理解其内部架构与训练机制。通过亲手编写每一行核心代码，用户能够透彻掌握 Transformer 架构、注意力机制等关键原理，从而真正理解大模型是如何“思考”的。此外，项目还包含了加载大型预训练权重进行微调的代码，帮助用户将理论知识延伸至实际应用。\n\nLLMs-from-scratch 特别适合希望深入底层原理的 AI 开发者、研究人员以及计算机专业的学生。对于不满足于仅使用 API，而是渴望探究模型构建细节的技术人员而言，这是极佳的学习资源。其独特的技术亮点在于“循序渐进”的教学设计：将复杂的系统工程拆解为清晰的步骤，配合详细的图表与示例，让构建一个虽小但功能完备的大模型变得触手可及。无论你是想夯实理论基础，还是为未来研发更大规模的模型做准备",90106,"2026-04-06T11:19:32",[35,15,13,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":72,"owner_name":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":76,"owner_location":76,"owner_email":77,"owner_twitter":76,"owner_website":76,"owner_url":78,"languages":79,"stars":88,"forks":89,"last_commit_at":90,"license":91,"difficulty_score":10,"env_os":92,"env_gpu":93,"env_ram":92,"env_deps":94,"category_tags":100,"github_topics":101,"view_count":32,"oss_zip_url":76,"oss_zip_packed_at":76,"status":17,"created_at":108,"updated_at":109,"faqs":110,"releases":111},6504,"SalesforceAIResearch\u002FxLAM","xLAM","xLAM: A Family of Large Action Models to Empower AI Agent Systems","xLAM 是 Salesforce 推出的一系列“大型动作模型”（Large Action Models），旨在为 AI 智能体系统注入强大的执行力。与传统大语言模型侧重文本生成不同，xLAM 专注于精准理解和调用外部工具与 API，让 AI 不仅能“思考”，更能高效地“行动”，从而解决复杂任务中规划与执行脱节的难题。\n\n该项目特别适合 AI 开发者、研究人员以及希望构建自动化工作流的企业技术团队使用。无论是开发需要频繁调用数据库、搜索接口或专业软件的行业智能体，还是研究多轮函数调用的学术场景，xLAM 都能提供坚实的底层支持。其核心技术亮点在于卓越的函数调用能力，最新版本 xLAM-2-fc-r 已在权威的伯克利函数调用排行榜（BFCL）上斩获第一。此外，项目还开源了配套的 ActionStudio 框架及专用的 APIGen-MT 数据集，大幅降低了从模型训练到实际部署的门槛，帮助用户轻松打造具备高度自主性的 AI 代理系统。","\u003Cdiv align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FSalesforceAIResearch\u002FxLAM\u002Ftree\u002Fmain\">\u003Cimg width=\"400px\" height=\"auto\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSalesforceAIResearch_xLAM_readme_0293777380e4.png\">\u003C\u002Fa>\n\u003C\u002Fdiv>\n\n\u003Cbr\u002F>\n\n\u003Cdiv align=\"center\">\n\n  \u003C!-- [![Release Notes](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Frelease\u002FSalesforceAIResearch\u002FxLAM)](https:\u002F\u002Fgithub.com\u002FSalesforceAIResearch\u002FxLAM\u002Freleases) -->\n  ![Python 3.9+](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPython-3.9%2B-brightgreen.svg)\n  [![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-Apache-green.svg)]()\n   [![huggingface](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F%F0%9F%A4%97-Models-yellow)](https:\u002F\u002Fhuggingface.co\u002Fcollections\u002FSalesforce\u002Fxlam-models-65f00e2a0a63bbcd1c2dade4)\n   [![discord](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDiscord-Chanel-light)](https:\u002F\u002Fdiscord.gg\u002FtysWwgZyQ2)\n [![GitHub star chart](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002FSalesforceAIResearch\u002FxLAM?style=social)](https:\u002F\u002Fstar-history.com\u002F#SalesforceAIResearch\u002FxLAM)\n\n\u003C\u002Fdiv>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Farxiv.org\u002Fpdf\u002F2409.03215\">Paper\u003C\u002Fa> |\n  \u003C!-- \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FSalesforceAIResearch\u002FAgentLite\u002Ftree\u002Fmain?tab=readme-ov-file#-key-features\">Key Features\u003C\u002Fa> | -->\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FSalesforceAIResearch\u002FxLAM\u002Ftree\u002Fmain?tab=readme-ov-file#model-instruction\">Model Instruction\u003C\u002Fa> |\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FSalesforceAIResearch\u002FxLAM\u002Ftree\u002Fmain?tab=readme-ov-file#framework\">Framework\u003C\u002Fa> |\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FSalesforceAIResearch\u002FxLAM\u002Ftree\u002Fmain?tab=readme-ov-file#installation\">Installation\u003C\u002Fa> |\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FSalesforceAIResearch\u002FxLAM\u002Ftree\u002Fmain?tab=readme-ov-file#train\">Train\u003C\u002Fa> |\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FSalesforceAIResearch\u002FxLAM\u002Ftree\u002Fmain?tab=readme-ov-file#benchmarks\">Benchmarks\u003C\u002Fa> |\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FSalesforceAIResearch\u002FxLAM\u002Ftree\u002Fmain?tab=readme-ov-file#acknowledgement\">Acknowledgement\u003C\u002Fa>\n\u003C\u002Fp>\n\n---\n\n## 🎉🎉🎉 News\n- **[08-20.2025]** 🎉🎉🎉 [ActionStudio](https:\u002F\u002Fgithub.com\u002FSalesforceAIResearch\u002FxLAM\u002Ftree\u002Fmain\u002Factionstudio) and [LATTE](https:\u002F\u002Flatte-web.github.io\u002F) (Learning to think with vision specialists) are both accepted by EMNLP 2025 Main conference! \n- **[08-05.2025]** 💫 [ActionStudio](.\u002Factionstudio\u002FREADME.md) has been updated with new features, improved training configuration tracking, and general code enhancements!\n- **[05-12.2025]** Our [xLAM Presentation Slides](https:\u002F\u002Fdocs.google.com\u002Fpresentation\u002Fd\u002F1IAdUPSFLd0l05T_IwfcUPI5b_pe0StNFjBd6Srosap8\u002Fedit?usp=sharing) for the **NAACL 2025 Oral Session** are now live!   📂 We’ve also open-sourced [**APIGen-MT-5k**](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002FSalesforce\u002FAPIGen-MT-5k) — a compact yet powerful dataset to explore multi-turn function-calling.\n- **[04-15.2025]** 🏆🏆🏆 **xLAM-2-fc-r achieves Top-1 performance** on the latest [BFCL Leaderboard](https:\u002F\u002Fgorilla.cs.berkeley.edu\u002Fleaderboard.html)!\n- **[04-15.2025]**: 🚀🚀🚀 **ActionStudio is now open-source!** Checkout our [paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F2503.22673) and [code](ActionStudio_README.md) for full details.\n- **[04-15.2025]**: 📢📢📢 **APIGen-MT is now open-source!** Learn more in our [paper](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2504.03601) and [Project Website](https:\u002F\u002Fapigen-mt.github.io\u002F)!\n- **[11.2024]**: Add the [latest examples and tokenizer info](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FxLAM-8x22b-r\u002Fblob\u002Fmain\u002Fexample\u002Fxlam_chat_template_examples_11_21.ipynb) on interacting with xLAM models. \n- **[09.2024]**: Join our [Discord Community](https:\u002F\u002Fdiscord.gg\u002FtysWwgZyQ2) if you have any feedbacks!\n- **[09.2024]**: Check our xLAM [Technical Report Paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F2409.03215). \n- **[08.2024]**: We are excited to announce the release of full xLAM family, our suite of Large Action Models! From the \"tiny giant\" to industrial powerhouses.  These models have achieved impressive rankings, placing #1 and #6 on the [Berkeley Function-Calling Leaderboard](https:\u002F\u002Fgorilla.cs.berkeley.edu\u002Fleaderboard.html#leaderboard).\nCheck our [Hugging Face collection](https:\u002F\u002Fhuggingface.co\u002Fcollections\u002FSalesforce\u002Fxlam-models-65f00e2a0a63bbcd1c2dade4).\n- **[07.2024]**: We are excited to announce the release of our two function-calling models: [xLAM-1b-fc-r](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FxLAM-1b-fc-r) and [xLAM-7b-fc-r](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FxLAM-7b-fc-r). These models have achieved impressive rankings, placing #3 and #25 on the [Berkeley Function-Calling Leaderboard](https:\u002F\u002Fgorilla.cs.berkeley.edu\u002Fleaderboard.html#leaderboard), outperforming many significantly larger models. Stay tuned for more powerful models coming soon.\n- **[06.2024]** Check our latest work [APIGen](https:\u002F\u002Fapigen-pipeline.github.io\u002F), the best open-sourced models for function calling. Our dataset [xlam-function-calling-60k](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002FSalesforce\u002Fxlam-function-calling-60k) is currently among the Top-3 trending datasets on HuggingFace, standing out in a field of 173,670 datasets as of July 4, 2024. See also the [Twitter by Salesforce CEO](https:\u002F\u002Fx.com\u002FBenioff\u002Fstatus\u002F1808365628551844186), [VentureBeat](https:\u002F\u002Fventurebeat.com\u002Fai\u002Fsalesforce-proves-less-is-more-xlam-1b-tiny-giant-beats-bigger-ai-models\u002F) and [新智元](https:\u002F\u002Fmp.weixin.qq.com\u002Fs\u002FB3gyaGwzlQaUXyI8n7Rguw).\n- **[03.2024]** [xLAM model](https:\u002F\u002Fhuggingface.co\u002Fcollections\u002FSalesforce\u002Fxlam-models-65f00e2a0a63bbcd1c2dade4) is released! Try it together with [AgentLite benchmark](https:\u002F\u002Fgithub.com\u002FSalesforceAIResearch\u002FAgentLite\u002Ftree\u002Fmain\u002Fbenchmark) or other benchmarks, which is comparable to GPT-4!\n- **[02.2024]** Initial Release of AgentOhana and xLAM [paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F2402.15506)!\n\n---\n> **Note**: This repository is provided for **research purposes only**.  \n> Any data related to xLAM is **partially released due to internal regulations** to support the advancement of the agent research community.\n\n---\n\nAutonomous agents powered by large language models (LLMs) have garnered significant research attention. However, fully harnessing the potential of LLMs for\nagent-based tasks presents inherent challenges due to the heterogeneous nature of\ndiverse data sources featuring multi-turn trajectories. \n\nThis repo introduces xLAM that aggregates agent trajectories from distinct environments, spanning a wide array of scenarios. It standardizes and unifies these trajectories into a consistent format, streamlining the creation of a generic data loader optimized\nfor agent training. Leveraging the data unification, our training pipeline maintains\nequilibrium across different data sources and preserves independent randomness\nacross devices during dataset partitioning and model training. \n\n\n\u003Cp align=\"center\">\n    \u003Cbr>\n\u003C!--     \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSalesforceAIResearch_xLAM_readme_1c261b77c989.png\" width=\"780\"\u002F> -->\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSalesforceAIResearch_xLAM_readme_5a246f5e6d86.jpeg\" width=\"700\"\u002F>\n    \u003Cbr>\n\u003Cp>\n  \n---\n  \n# Model Instruction\n\n| Model                  | # Total Params | Context Length |Release Date | Category | Download Model  | Download GGUF files |\n|------------------------|----------------|------------|-------------|-------|----------------|----------|\n| Llama-xLAM-2-70b-fc-r | 70B            | 128k            | Mar. 26, 2025 | Multi-turn Conversation, Function-calling   | [🤗 Link](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FLlama-xLAM-2-70b-fc-r)         |      NA               |\n| Llama-xLAM-2-8b-fc-r      | 8B             | 128k            | Mar. 26, 2025 | Multi-turn Conversation, Function-calling     | [🤗 Link](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FLlama-xLAM-2-8b-fc-r)              |   [🤗 Link](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FLlama-xLAM-2-8b-fc-r-gguf)    |\n| xLAM-2-32b-fc-r     | 32B            | 32k (max 128k)*            | Mar. 26, 2025 |  Multi-turn Conversation, Function-calling   | [🤗 Link](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FxLAM-2-32b-fc-r)             |      NA               |\n| xLAM-2-3b-fc-r      | 3B             | 32k (max 128k)*            | Mar. 26, 2025 |  Multi-turn Conversation, Function-calling    | [🤗 Link](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FxLAM-2-3b-fc-r)              |      [🤗 Link](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FxLAM-2-3b-fc-r-gguf)               |\n| xLAM-2-1b-fc-r      | 1B             | 32k (max 128k)*            | Mar. 26, 2025 |  Multi-turn Conversation, Function-calling | [🤗 Link](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FxLAM-2-1b-fc-r)              |      [🤗 Link](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FxLAM-2-1b-fc-r-gguf)               |\n| xLAM-7b-r           | 7.24B          | 32k            | Sep. 5, 2024|General,  Function-calling | [🤗 Link](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FxLAM-7b-r) | -- |\n| xLAM-8x7b-r           | 46.7B          | 32k           | Sep. 5, 2024|General,  Function-calling | [🤗 Link](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FxLAM-8x7b-r) | -- |\n| xLAM-8x22b-r           | 141B          | 64k           | Sep. 5, 2024|General,  Function-calling | [🤗 Link](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FxLAM-8x22b-r) | -- |\n| xLAM-1b-fc-r           | 1.35B          | 16k           | July 17, 2024 | Function-calling| [🤗 Link](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FxLAM-1b-fc-r) | [🤗 Link](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FxLAM-1b-fc-r-gguf) |\n| xLAM-7b-fc-r           | 6.91B          | 4k            | July 17, 2024| Function-calling| [🤗 Link](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FxLAM-7b-fc-r) | [🤗 Link](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FxLAM-7b-fc-r-gguf) |\n| xLAM-v0.1-r           | 46.7B          | 32k            | Mar. 18, 2024 |General,  Function-calling | [🤗 Link](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FxLAM-v0.1-r) | -- |\n\n\n[xLAM](https:\u002F\u002Fhuggingface.co\u002Fcollections\u002FSalesforce\u002Fxlam-models-65f00e2a0a63bbcd1c2dade4) series are significant better at many things including general tasks and function calling. \nFor the same number of parameters, the model have been fine-tuned across a wide range of agent tasks and scenarios, all while preserving the capabilities of the original model.\n\n### 📦 Model Naming Conventions\n- `xLAM-7b-r`: A general-purpose v1.0 or v2.0 release of the **Large Action Model**, fine-tuned for broad agentic capabilities. The `-r` suffix indicates it is a **research** release.\n- `xLAM-7b-fc-r`: A specialized variant where `-fc` denotes fine-tuning for **function calling** tasks, also marked for **research** use.\n- ✅ All models are fully compatible with VLLM, FastChat, and Transformers-based inference frameworks.\n\n---\n## Deploying and Interacting with xLAM Models\n\n### 🤗 Use Transformers for Inference\nBelow is one example on how to use the latest models:\n\n```python\nimport torch\nfrom transformers import AutoModelForCausalLM, AutoTokenizer\n\ntokenizer = AutoTokenizer.from_pretrained(\"Salesforce\u002FLlama-xLAM-2-3b-fc-r\")\nmodel = AutoModelForCausalLM.from_pretrained(\"Salesforce\u002FLlama-xLAM-2-3b-fc-r\", torch_dtype=torch.bfloat16, device_map=\"auto\")\n\n# Example conversation with a tool call\nmessages = [\n    {\"role\": \"user\", \"content\": \"Hi, how are you?\"},\n    {\"role\": \"assistant\", \"content\": \"Thanks. I am doing well. How can I help you?\"},\n    {\"role\": \"user\", \"content\": \"What's the weather like in London?\"},\n]\n\ntools = [\n    {\n        \"name\": \"get_weather\",\n        \"description\": \"Get the current weather for a location\",\n        \"parameters\": {\n            \"type\": \"object\",\n            \"properties\": {\n                \"location\": {\"type\": \"string\", \"description\": \"The city and state, e.g. San Francisco, CA\"},\n                \"unit\": {\"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"], \"description\": \"The unit of temperature to return\"}\n            },\n            \"required\": [\"location\"]\n        }\n    }\n]\n\nprint(\"====== prompt after applying chat template ======\")\nprint(tokenizer.apply_chat_template(messages, tools=tools, add_generation_prompt=True, tokenize=False))\n\ninputs = tokenizer.apply_chat_template(messages, tools=tools, add_generation_prompt=True, return_dict=True, return_tensors=\"pt\")\ninput_ids_len = inputs[\"input_ids\"].shape[-1] # Get the length of the input tokens\ninputs = {k: v.to(model.device) for k, v in inputs.items()}\nprint(\"====== model response ======\")\noutputs = model.generate(**inputs, max_new_tokens=256)\ngenerated_tokens = outputs[:, input_ids_len:] # Slice the output to get only the newly generated tokens\nprint(tokenizer.decode(generated_tokens[0], skip_special_tokens=True))\n```\n\n**Note:** You may need to tune the Temperature setting  for different applications. Typically, a lower Temperature is helpful for tasks that require deterministic outcomes. \nAdditionally, for tasks demanding adherence to specific formats or function calls, explicitly including formatting instructions is advisable and important. \n\n### ⚡📈 Using vLLM for Inference\n\nThe xLAM models can also be efficiently served using vLLM for high-throughput inference. Please use `vllm>=0.6.5` since earlier versions will cause degraded performance for Qwen-based models.\n\n#### Setup and Serving\n\n1. Install vLLM with the required version:\n```bash\npip install \"vllm>=0.6.5\"\n```\n\n2. Download the tool parser plugin to your local path:\n```bash\nwget https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FxLAM-2-1b-fc-r\u002Fraw\u002Fmain\u002Fxlam_tool_call_parser.py\n```\n\n3. Start the OpenAI API-compatible endpoint:\n```bash\nMODEL_NAME_OR_PATH=\"Salesforce\u002FxLAM-2-1b-fc-r\"\nASSIGNED_MODEL_NAME=\"xlam-2-1b-fc-r\" # vLLM uses the assigned model name for reference\nNUM_ASSIGNED_GPUS=1 # a 70b model would need 4 GPUs, each with 80GB memory\nPORT=8000\n\nvllm serve $MODEL_NAME_OR_PATH \\\n  --tensor-parallel-size $NUM_ASSIGNED_GPUS \\\n  --served-model-name $ASSIGNED_MODEL_NAME \\\n  --port $PORT \\\n  --gpu-memory-utilization 0.9 \\\n  --enable-auto-tool-choice \\\n  --tool-parser-plugin .\u002Fxlam_tool_call_parser.py \\\n  --tool-call-parser xlam \n```\n\nNote: Ensure that the tool parser plugin file is downloaded and that the path specified in `--tool-parser-plugin` correctly points to your local copy of the file. The xLAM series models all utilize the **same** tool call parser, so you only need to download it **once** for all models.\n\n#### Testing with OpenAI API\n\nHere's a minimal example to test tool usage with the served endpoint:\n\n```python\nimport openai\nimport json\n\n# Configure the client to use your local vLLM endpoint\nclient = openai.OpenAI(\n    base_url=\"http:\u002F\u002Flocalhost:8000\u002Fv1\",  # Default vLLM server PORT\n    api_key=\"empty\"  # Can be any string\n)\n\n# Define a tool\u002Ffunction\ntools = [\n    {\n        \"type\": \"function\",\n        \"function\": {\n            \"name\": \"get_weather\",\n            \"description\": \"Get the current weather for a location\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"location\": {\n                        \"type\": \"string\",\n                        \"description\": \"The city and state, e.g. San Francisco, CA\"\n                    },\n                    \"unit\": {\n                        \"type\": \"string\",\n                        \"enum\": [\"celsius\", \"fahrenheit\"],\n                        \"description\": \"The unit of temperature to return\"\n                    }\n                },\n                \"required\": [\"location\"]\n            }\n        }\n    }\n]\nmessages = [\n  {\"role\": \"system\", \"content\": \"You are a helpful assistant that can use tools.\"},\n  {\"role\": \"user\", \"content\": \"What's the weather like in San Francisco?\"}\n]\n\n# Create a chat completion\nif tools is None or tools==[]: # chitchat\n  response = client.chat.completions.create(\n      model=\"xlam-2-1b-fc-r\",  # ASSIGNED_MODEL_NAME\n      messages=messages\n  )\nelse: # function calling\n  response = client.chat.completions.create(\n      model=\"xlam-2-1b-fc-r\",  # ASSIGNED_MODEL_NAME\n      messages=messages,\n      tools=tools,\n      tool_choice=\"auto\"\n  )\n\n# Print the response\nprint(\"Assistant's response:\")\nprint(json.dumps(response.model_dump(), indent=2))\n```\n\nFor more advanced configurations and deployment options, please refer to the [vLLM documentation](https:\u002F\u002Fdocs.vllm.ai\u002Fen\u002Flatest\u002Fserving\u002Fopenai_compatible_server.html).\n\n\n---\n# 🧠 APIGen-MT: Agentic PIpeline for Multi-Turn Data Generation via Simulated Agent-Human Interplay\n\n\u003Cp align=\"center\">\n\u003Cimg width=\"780\" alt=\"image\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSalesforceAIResearch_xLAM_readme_008a3612f66a.png\" \u002F>\n\u003Cimg width=\"780\" alt=\"image\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSalesforceAIResearch_xLAM_readme_8a5d4179758a.png\" \u002F>\n\u003Cp>\n\n---\n\n# 🧠 ActionStudio: A Lightweight Framework for Agentic Data and Training of Large Action Models\n\n\u003Cp align=\"center\">\n    \u003Cbr>\n\u003C!--     \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSalesforceAIResearch_xLAM_readme_1c261b77c989.png\" width=\"650\"\u002F> -->\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSalesforceAIResearch_xLAM_readme_7e395d966304.jpg\" width=\"900\"\u002F>\n    \u003Cbr>\n\u003Cp>\n\n\n❤️ Please refer [ActionStudio.md](ActionStudio_README.md) for more details. \n\n\n## 📦  Installation\n\n### 🔧 Dependencies\n\nInstall dependencies from the root `xLAM` directory (where `setup.py` is located) with:\n\n```bash\nconda create --name actionstudio python=3.10\n\nbash requirements.sh\n```\n\n### 🚀 Installing ActionStudio\n\n**Development Version** (Latest):\n\nTo use the latest code under active development, install ActionStudio in **editable mode** from the root `xLAM` directory (where `setup.py` is located):\n\n```bash\npip install -e .\n```\n\n## 🗂️ Structure\n\n```text\nactionstudio\u002F\n├── datasets\u002F                             # Open-source **`unified trajectory datasets`**\n├── examples\u002F                             # Usage examples and configurations\n│   ├── data_configs\u002F                     # YAML configs for data mixtures\n│   ├── deepspeed_configs\u002F                # DeepSpeed training configuration files\n│   └── trainings\u002F                        # Bash scripts for various training methods (**`README.md`**)\n├── src\u002F                                  # Source code\n│   ├── data_conversion\u002F                  # Converting trajectories into training data (**`README.md`**)\n│   └── criticLAM\u002F                        # Critic Large Action Model implementation (**`README.md`**)\n└── foundation_modeling\u002F                  # Core modeling components\n    ├── data_handlers\u002F\n    ├── train\u002F\n    ├── trainers\u002F\n    └── utils\u002F\n```\n\n🔍 Most top-level folders include a **README.md** with detailed instructions and explanations.\n\n## ⚡ Efficiency\n\u003Cimg width=\"1705\" alt=\"image\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSalesforceAIResearch_xLAM_readme_dd56be4e2724.png\" \u002F>\n\n\n## 📜 Licenses\n\nThe code is licensed under Apache 2.0, and the datasets are under the CC-BY-NC-4.0 License. The data provided are intended for research purposes only.\n\n## 🛠️ Code Updates History\n\n\n#### 💫 **Aug 05, 2025**\n- **Unified config tracking**\nEvery run now writes its full training configuration to a single JSON file—keyed by a unique model ID—in [model_config_files](.\u002Fexamples\u002Ftrainings\u002Fmodel_config_files\u002F) for easy reference and reproducibility.\n\n- **HF ⇄ DeepSpeed parity**\nResolved inconsistencies between Hugging Face and DeepSpeed hyper-parameter settings to ensure they stay perfectly in sync.\n\n- **Learning-rate scheduler tuning**\nRefined default scheduler parameters for smoother warm-up and steadier convergence.\n\n- **General code cleanup**\nStreamlined modules, removed dead paths, and added inline docs for easier maintenance.\n\n\n#### **May 09, 2025**\n- Fixed argument error in data_verifier. Ref to [#24](https:\u002F\u002Fgithub.com\u002FSalesforceAIResearch\u002FxLAM\u002Fissues\u002F24).\n\n#### **April 14, 2025**\n- Updated dependency versions to support the latest models and techniques\n- Added auto calculation and assignment of training steps\n- Enabled automatic checkpoint merging at the end of training. \n    - 📄 See [actionstudio\u002Fexamples\u002Ftrainings\u002FREADME.md](actionstudio\u002Fexamples\u002Ftrainings\u002FREADME.md) for training examples and usage\n- Improved documentation and inline code comments\n\n\n---\n\u003C!-- \n# Deploying and Interacting with xLAM Models\n\n> ⚠️ **Note**: For working with **xLAM v1.0** models, refer to the  [example notebook and tokenizer information](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FxLAM-8x22b-r\u002Fblob\u002Fmain\u002Fexample\u002Fxlam_chat_template_examples_11_21.ipynb).\n\n**xLAM v2.0** models build upon the v1.0 design with improved structure and follow standard chat formatting, making them directly compatible with popular inference frameworks such as vLLM, Transformers, and more — no special setup required. \n> 🔍 That said, we still recommend reviewing the above notebook for a better understanding of the chat formatting logic and tokenizer behaviors.\n\n## 💬 Serving xLAM as an OpenAI-Compatible Chat API\nYou can deploy xLAM models as an OpenAI-compatible chat completion API using one of the following two methods.\n\n> 📌 *The example below uses `Salesforce\u002FxLAM-8x7b-r` on a 4×A100 (40GB) setup.*\n\n### Option 1: Using vLLM (Recommended)\n\nvLLM offers efficient serving with lower latency. To serve the model with vLLM:\n\n```bash\nvllm serve Salesforce\u002FxLAM-8x7b-r --host 0.0.0.0 --port 8000 --tensor-parallel-size 4\n```\n\n### Option 2: Using FastChat\n\nFastChat provides a more feature-rich serving setup. To serve with FastChat:\n\n1. Start the controller:\n```bash\npython3 -m fastchat.serve.controller --host 0.0.0.0\n```\n\n2. Start the OpenAI-compatible API server:\n```bash\npython3 -m fastchat.serve.openai_api_server --host 0.0.0.0 --port 8000\n```\n\n3. Launch the model worker:\n```bash\npython3 -m fastchat.serve.vllm_worker \\\n       --model-names \"Salesforce\u002FxLAM-8x7b-r\" \\\n       --model-path Salesforce\u002FxLAM-8x7b-r \\\n       --host 0.0.0.0 \\\n       --port 31005 \\\n       --worker-address http:\u002F\u002Flocalhost:31001 \\\n       --num-gpus 4 \\\n       --limit-worker-concurrency 64\n```\n\n## Using the Chat Completion API for xLAM 1.0 Series\n\nOnce the model is served, you can use the following xLAM client to interact with it for function calling or other applications:\n\n```python\nfrom xLAM.client import xLAMChatCompletion, xLAMConfig\n\n# Configure the client\nconfig = xLAMConfig(base_url=\"http:\u002F\u002Flocalhost:8000\u002Fv1\u002F\", model=\"Salesforce\u002FxLAM-8x7b-r\")\nllm = xLAMChatCompletion.from_config(config)\n\n# Example conversation\nmessages = [\n    {\"role\": \"system\", \"content\": \"You are a helpful assistant.\"},\n    {\"role\": \"user\", \"content\": \"What's the weather like in New York?\"},\n    {\"role\": \"assistant\", \"content\": \"To get the weather information for New York, I'll need to use the get_weather function.\", \"tool_calls\": {\"name\": \"get_weather\", \"arguments\": '{\"location\": \"New York\", \"unit\": \"fahrenheit\"}'}},\n    {\"role\": \"tool\", \"name\": \"get_weather\", \"content\": '{\"temperature\": 72, \"description\": \"Partly cloudy\"}'},\n    {\"role\": \"user\", \"content\": \"Now, search for the weather in San Francisco.\"}\n]\n\n# Example function definition (optional)\ntools = [\n    {\n        \"name\": \"get_weather\",\n        \"description\": \"Get the current weather for a location\",\n        \"parameters\": {\n            \"type\": \"object\",\n            \"properties\": {\n                \"location\": {\"type\": \"string\", \"description\": \"The city and state, e.g. San Francisco, New York\"},\n                \"unit\": {\"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"], \"description\": \"The unit of temperature to return\"}\n            },\n            \"required\": [\"location\"]\n        }\n    },\n    {\n        \"name\": \"search\",\n        \"description\": \"Search for information on the internet\",\n        \"parameters\": {\n            \"type\": \"object\",\n            \"properties\": {\n                \"query\": {\"type\": \"string\", \"description\": \"The search query, e.g. 'latest news on AI'\"}\n            },\n            \"required\": [\"query\"]\n        }\n    },\n    {\n        \"name\": \"respond\",\n        \"description\": \"When you are ready to respond, use this function. This function allows the assistant to formulate and deliver appropriate replies based on the input message and the context of the conversation. Generate a concise response for simple questions, and a more detailed response for complex questions.\",\n        \"parameters\": {\n            \"type\": \"object\",\n            \"properties\": {\n                \"message\": {\"type\": \"string\", \"description\": \"The content of the message to respond to.\"}\n            },\n            \"required\": [\"message\"]\n        }\n    }\n]\n\nresponse = llm.completion(messages, tools=tools)\nprint(response)\n```\n-->\n\n---\n\n# :trophy: Benchmarks (xLAM-2-fc Series)\n\n## Berkeley Function-Calling Leaderboard (BFCL v3)\n\n\u003Cp align=\"left\">\n\u003Cimg width=\"800\" alt=\"image\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSalesforceAIResearch_xLAM_readme_9293233dfd85.png\" \u002F>\n\u003C\u002Fp>\n\n\u003Cp align=\"left\">\n\u003Cimg width=\"70%\" alt=\"BFCL Results\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSalesforceAIResearch_xLAM_readme_3492e9691b95.png\">\n\u003Cbr>\n\u003Csmall>\u003Ci>Performance comparison of different models on BFCL leaderboard. The rank is based on the overall accuracy, which is a weighted average of different evaluation categories. \"FC\" stands for function-calling mode in contrast to using a customized \"prompt\" to extract the function calls.\u003C\u002Fi>\u003C\u002Fsmall>\n\u003C\u002Fp>\n\n## τ-bench Benchmark\n\n\u003Cp align=\"left\">\n\u003Cimg width=\"70%\" alt=\"Tau-bench Results\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSalesforceAIResearch_xLAM_readme_fc09b3676924.png\">\n\u003Cbr>\n\u003Csmall>\u003Ci>Success Rate (pass@1) on τ-bench benchmark averaged across at least 5 trials. Our xLAM-2-70b-fc-r model achieves an overall success rate of 56.2% on τ-bench, significantly outperforming the base Llama 3.1 70B Instruct model (38.2%) and other open-source models like DeepSeek v3 (40.6%). Notably, our best model even outperforms proprietary models such as GPT-4o (52.9%) and approaches the performance of more recent models like Claude 3.5 Sonnet (new) (60.1%).\u003C\u002Fi>\u003C\u002Fsmall>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n\u003Cimg width=\"70%\" alt=\"Pass^k curves\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSalesforceAIResearch_xLAM_readme_cf554ffe8d29.png\">\n\u003Cbr>\n\u003Csmall>\u003Ci>Pass^k curves measuring the probability that all 5 independent trials succeed for a given task, averaged across all tasks for τ-retail (left) and τ-airline (right) domains. Higher values indicate better consistency of the models.\u003C\u002Fi>\u003C\u002Fsmall>\n\u003C\u002Fp>\n\n---\n\n# :trophy: Benchmarks (xLAM 1.0 Series)\n\n\n## Berkeley Function-Calling Leaderboard (BFCL)\n\n\u003Cp align=\"left\">\n    \u003Cbr>\n\u003C!--     \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSalesforceAIResearch_xLAM_readme_1c261b77c989.png\" width=\"700\"\u002F> -->\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSalesforceAIResearch_xLAM_readme_3536669ffcbc.jpg\" width=\"800\"\u002F>\n    \u003Cbr>\n\u003Cp>\n\n## [BOLAA](https:\u002F\u002Fgithub.com\u002Fsalesforce\u002FBOLAA)\n\n### Webshop\n\n\n\u003Cdiv class=\"datagrid\" style=\"width:750px;\">\n\u003Ctable>\n\u003C!-- \u003Cthead>\u003Ctr>\u003Cth>\u003C\u002Fth>\u003Cth colspan=\"6\">\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead> -->\n\u003Cthead>\u003Ctr>\u003Cth>LLM Name\u003C\u002Fth>\u003Cth>ZS\u003C\u002Fth>\u003Cth>ZST\u003C\u002Fth>\u003Cth>ReaAct\u003C\u002Fth>\u003Cth>PlanAct\u003C\u002Fth>\u003Cth>PlanReAct\u003C\u002Fth>\u003Cth>BOLAA\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\u003Ctd>Llama-2-70B-chat \u003C\u002Ftd>\u003Ctd>0.0089 \u003C\u002Ftd>\u003Ctd>0.0102\u003C\u002Ftd>\u003Ctd>0.4273\u003C\u002Ftd>\u003Ctd>0.2809\u003C\u002Ftd>\u003Ctd>0.3966\u003C\u002Ftd>\u003Ctd>0.4986\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Vicuna-33B \u003C\u002Ftd>\u003Ctd>0.1527 \u003C\u002Ftd>\u003Ctd>0.2122\u003C\u002Ftd>\u003Ctd>0.1971\u003C\u002Ftd>\u003Ctd>0.3766\u003C\u002Ftd>\u003Ctd>0.4032\u003C\u002Ftd>\u003Ctd>0.5618\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Mixtral-8x7B-Instruct-v0.1 \u003C\u002Ftd>\u003Ctd>0.4634 \u003C\u002Ftd>\u003Ctd>0.4592\u003C\u002Ftd>\u003Ctd>\u003Cu>0.5638\u003C\u002Fu>\u003C\u002Ftd>\u003Ctd>0.4738\u003C\u002Ftd>\u003Ctd>0.3339\u003C\u002Ftd>\u003Ctd>0.5342\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>GPT-3.5-Turbo \u003C\u002Ftd>\u003Ctd>0.4851 \u003C\u002Ftd>\u003Ctd>\u003Cu>0.5058\u003C\u002Fu>\u003C\u002Ftd>\u003Ctd>0.5047\u003C\u002Ftd>\u003Ctd>0.4930\u003C\u002Ftd>\u003Ctd>\u003Cu>0.5436\u003C\u002Fu>\u003C\u002Ftd>\u003Ctd>\u003Cu>0.6354\u003C\u002Fu>\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>GPT-3.5-Turbo-Instruct \u003C\u002Ftd>\u003Ctd>0.3785 \u003C\u002Ftd>\u003Ctd>0.4195\u003C\u002Ftd>\u003Ctd>0.4377\u003C\u002Ftd>\u003Ctd>0.3604\u003C\u002Ftd>\u003Ctd>0.4851\u003C\u002Ftd>\u003Ctd>0.5811\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>GPT-4-0613\u003C\u002Ftd>\u003Ctd>\u003Cu>0.5002\u003C\u002Fu>\u003C\u002Ftd>\u003Ctd>0.4783 \u003C\u002Ftd>\u003Ctd>0.4616\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.7950\u003C\u002Fstrong>\u003C\u002Ftd>\u003Ctd>0.4635\u003C\u002Ftd>\u003Ctd>0.6129\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>xLAM-v0.1-r\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.5201\u003C\u002Fstrong>\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.5268\u003C\u002Fstrong>\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.6486\u003C\u002Fstrong>\u003C\u002Ftd>\u003Ctd>\u003Cu>0.6573\u003C\u002Fu>\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.6611\u003C\u002Fstrong>\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.6556\u003C\u002Fstrong>\u003C\u002Ftd>\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\n### HotpotQA\n\n\u003Cdiv class=\"datagrid\" style=\"width:750px;\">\n\u003Ctable>\n\u003C!-- \u003Cthead>\u003Ctr>\u003Cth>\u003C\u002Fth>\u003Cth colspan=\"6\">\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead> -->\n\u003Cthead>\u003Ctr>\u003Cth>LLM Name\u003C\u002Fth>\u003Cth>ZS\u003C\u002Fth>\u003Cth>ZST\u003C\u002Fth>\u003Cth>ReaAct\u003C\u002Fth>\u003Cth>PlanAct\u003C\u002Fth>\u003Cth>PlanReAct\u003C\u002Fth>\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\u003Ctd>Mixtral-8x7B-Instruct-v0.1 \u003C\u002Ftd>\u003Ctd>0.3912 \u003C\u002Ftd>\u003Ctd>0.3971\u003C\u002Ftd>\u003Ctd>0.3714\u003C\u002Ftd>\u003Ctd>0.3195\u003C\u002Ftd>\u003Ctd>0.3039\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>GPT-3.5-Turbo \u003C\u002Ftd>\u003Ctd>0.4196 \u003C\u002Ftd>\u003Ctd>0.3937\u003C\u002Ftd>\u003Ctd>0.3868\u003C\u002Ftd>\u003Ctd>0.4182\u003C\u002Ftd>\u003Ctd>0.3960\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>GPT-4-0613\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.5801\u003C\u002Fstrong>\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.5709 \u003C\u002Fstrong>\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.6129\u003C\u002Fstrong>\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.5778\u003C\u002Fstrong>\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.5716\u003C\u002Fstrong>\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>xLAM-v0.1-r\u003C\u002Ftd>\u003Ctd>\u003Cu>0.5492\u003C\u002Fu>\u003C\u002Ftd>\u003Ctd>\u003Cu>0.4776\u003C\u002Fu>\u003C\u002Ftd>\u003Ctd>\u003Cu>0.5020\u003C\u002Fu>\u003C\u002Ftd>\u003Ctd>\u003Cu>0.5583\u003C\u002Fu>\u003C\u002Ftd>\u003Ctd>\u003Cu>0.5030\u003C\u002Fu>\u003C\u002Ftd>\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\n## [AgentLite](https:\u002F\u002Fgithub.com\u002FSalesforceAIResearch\u002FAgentLite\u002Ftree\u002Fmain)\n\n**Please note:** All prompts provided by AgentLite are considered \"unseen prompts\" for xLAM-v0.1-r, meaning the model has not been trained with data related to these prompts.\n\n#### Webshop \n\n\u003Cdiv class=\"datagrid\" style=\"width:780px;\">\n\u003Ctable>\n\u003C!-- \u003Cthead>\u003Ctr>\u003Cth>\u003C\u002Fth>\u003Cth colspan=\"2\">Easy\u003C\u002Fth>\u003Cth colspan=\"2\">Medium\u003C\u002Fth>\u003Cth colspan=\"2\">Hard\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead> -->\n\u003Cthead>\u003Ctr>\u003Cth>LLM Name\u003C\u002Fth>\u003Cth>Act\u003C\u002Fth>\u003Cth>ReAct\u003C\u002Fth>\u003Cth>BOLAA\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\u003Ctd>GPT-3.5-Turbo-16k \u003C\u002Ftd>\u003Ctd>0.6158 \u003C\u002Ftd>\u003Ctd>0.6005\u003C\u002Ftd>\u003Ctd>0.6652\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>GPT-4-0613\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.6989 \u003C\u002Fstrong>\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.6732\u003C\u002Fstrong>\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.7154\u003C\u002Fstrong>\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>xLAM-v0.1-r\u003C\u002Ftd>\u003Ctd>\u003Cu>0.6563\u003C\u002Fu>\u003C\u002Ftd>\u003Ctd>\u003Cu>0.6640\u003C\u002Fu>\u003C\u002Ftd>\u003Ctd>\u003Cu>0.6854\u003C\u002Fu>\u003C\u002Ftd>\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\n#### HotpotQA\n\n\u003Cdiv class=\"datagrid\" style=\"width:700px;\">\n\u003Ctable>\n\u003Cthead>\u003Ctr>\u003Cth>\u003C\u002Fth>\u003Cth colspan=\"2\">Easy\u003C\u002Fth>\u003Cth colspan=\"2\">Medium\u003C\u002Fth>\u003Cth colspan=\"2\">Hard\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead>\n\u003Cthead>\u003Ctr>\u003Cth>LLM Name\u003C\u002Fth>\u003Cth>F1 Score\u003C\u002Fth>\u003Cth>Accuracy\u003C\u002Fth>\u003Cth>F1 Score\u003C\u002Fth>\u003Cth>Accuracy\u003C\u002Fth>\u003Cth>F1 Score\u003C\u002Fth>\u003Cth>Accuracy\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\u003Ctd>GPT-3.5-Turbo-16k-0613 \u003C\u002Ftd>\u003Ctd>0.410 \u003C\u002Ftd>\u003Ctd>0.350\u003C\u002Ftd>\u003Ctd>0.330\u003C\u002Ftd>\u003Ctd>0.25\u003C\u002Ftd>\u003Ctd>0.283\u003C\u002Ftd>\u003Ctd>0.20\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>GPT-4-0613\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.611\u003C\u002Fstrong>\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.47\u003C\u002Fstrong> \u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.610\u003C\u002Fstrong>\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.480\u003C\u002Fstrong>\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.527\u003C\u002Fstrong>\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.38\u003C\u002Fstrong>\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>xLAM-v0.1-r\u003C\u002Ftd>\u003Ctd>\u003Cu>0.532\u003C\u002Fu>\u003C\u002Ftd>\u003Ctd>\u003Cu>0.45\u003C\u002Fu>\u003C\u002Ftd>\u003Ctd>\u003Cu>0.547\u003C\u002Fu>\u003C\u002Ftd>\u003Ctd>\u003Cu>0.46\u003C\u002Fu>\u003C\u002Ftd>\u003Ctd>\u003Cu>0.455\u003C\u002Fu>\u003C\u002Ftd>\u003Ctd>\u003Cu>0.36\u003C\u002Fu>\u003C\u002Ftd>\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\n\n\n## [ToolBench](https:\u002F\u002Fgithub.com\u002FOpenBMB\u002FToolBench)\n\n\u003Cdiv class=\"datagrid\" style=\"width:780px;\">\n\u003Ctable>\n\u003C!-- \u003Cthead>\u003Ctr>\u003Cth>\u003C\u002Fth>\u003Cth colspan=\"2\">Easy\u003C\u002Fth>\u003Cth colspan=\"2\">Medium\u003C\u002Fth>\u003Cth colspan=\"2\">Hard\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead> -->\n\u003Cthead>\u003Ctr>\u003Cth>LLM Name\u003C\u002Fth>\u003Cth>Unseen Insts & Same Set\u003C\u002Fth>\u003Cth>Unseen Tools & Seen Cat\u003C\u002Fth>\u003Cth>Unseen Tools & Unseen Cat\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\u003Ctd>TooLlama V2 \u003C\u002Ftd>\u003Ctd>0.4385 \u003C\u002Ftd>\u003Ctd>0.4300\u003C\u002Ftd>\u003Ctd>0.4350\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>GPT-3.5-Turbo-0125 \u003C\u002Ftd>\u003Ctd>0.5000 \u003C\u002Ftd>\u003Ctd>0.5150\u003C\u002Ftd>\u003Ctd>0.4900\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>GPT-4-0125-preview\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.5462\u003C\u002Fstrong>\u003C\u002Ftd>\u003Ctd>\u003Cu>0.5450\u003C\u002Fu>\u003C\u002Ftd>\u003Ctd>\u003Cu>0.5050\u003C\u002Fu>\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>xLAM-v0.1-r\u003C\u002Ftd>\u003Ctd>\u003Cu>0.5077\u003C\u002Fu>\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.5650\u003C\u002Fstrong>\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.5200\u003C\u002Fstrong>\u003C\u002Ftd>\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\n## [MINT-BENCH](https:\u002F\u002Fgithub.com\u002Fxingyaoww\u002Fmint-bench)\n\n\n\u003Cdiv class=\"datagrid\" style=\"width:700px;\">\n\u003Ctable>\n\u003C!-- \u003Cthead>\u003Ctr>\u003Cth>\u003C\u002Fth>\u003Cth colspan=\"2\">Easy\u003C\u002Fth>\u003Cth colspan=\"2\">Medium\u003C\u002Fth>\u003Cth colspan=\"2\">Hard\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead> -->\n\u003Cthead>\u003Ctr>\u003Cth>LLM Name\u003C\u002Fth>\u003Cth>1-step\u003C\u002Fth>\u003Cth>2-step\u003C\u002Fth>\u003Cth>3-step\u003C\u002Fth>\u003Cth>4-step\u003C\u002Fth>\u003Cth>5-step\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\u003Ctd>GPT-4-0613\u003C\u002Ftd>\u003Ctd>-\u003C\u002Ftd>\u003Ctd>-\u003C\u002Ftd>\u003Ctd>-\u003C\u002Ftd>\u003Ctd>-\u003C\u002Ftd>\u003Ctd>69.45\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Claude-Instant-1\u003C\u002Ftd>\u003Ctd>12.12\u003C\u002Ftd>\u003Ctd>32.25\u003C\u002Ftd>\u003Ctd>39.25\u003C\u002Ftd>\u003Ctd>44.37\u003C\u002Ftd>\u003Ctd>45.90\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>xLAM-v0.1-r\u003C\u002Ftd>\u003Ctd>4.10\u003C\u002Ftd>\u003Ctd>28.50\u003C\u002Ftd>\u003Ctd>36.01\u003C\u002Ftd>\u003Ctd>42.66\u003C\u002Ftd>\u003Ctd>43.96\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Claude-2 \u003C\u002Ftd>\u003Ctd>26.45 \u003C\u002Ftd>\u003Ctd>35.49\u003C\u002Ftd>\u003Ctd>36.01\u003C\u002Ftd>\u003Ctd>39.76\u003C\u002Ftd>\u003Ctd>39.93\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Lemur-70b-Chat-v1 \u003C\u002Ftd>\u003Ctd>3.75 \u003C\u002Ftd>\u003Ctd>26.96\u003C\u002Ftd>\u003Ctd>35.67\u003C\u002Ftd>\u003Ctd>37.54\u003C\u002Ftd>\u003Ctd>37.03\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>GPT-3.5-Turbo-0613 \u003C\u002Ftd>\u003Ctd>2.73\u003C\u002Ftd>\u003Ctd>16.89\u003C\u002Ftd>\u003Ctd>24.06\u003C\u002Ftd>\u003Ctd>31.74\u003C\u002Ftd>\u003Ctd>36.18\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>AgentLM-70b \u003C\u002Ftd>\u003Ctd>6.48\u003C\u002Ftd>\u003Ctd>17.75\u003C\u002Ftd>\u003Ctd>24.91\u003C\u002Ftd>\u003Ctd>28.16\u003C\u002Ftd>\u003Ctd>28.67\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>CodeLlama-34b \u003C\u002Ftd>\u003Ctd>0.17\u003C\u002Ftd>\u003Ctd>16.21\u003C\u002Ftd>\u003Ctd>23.04\u003C\u002Ftd>\u003Ctd>25.94\u003C\u002Ftd>\u003Ctd>28.16\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Llama-2-70b-chat \u003C\u002Ftd>\u003Ctd>4.27\u003C\u002Ftd>\u003Ctd>14.33\u003C\u002Ftd>\u003Ctd>15.70\u003C\u002Ftd>\u003Ctd>16.55\u003C\u002Ftd>\u003Ctd>17.92\u003C\u002Ftd>\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\n\n## [Tool-Query](https:\u002F\u002Fgithub.com\u002Fhkust-nlp\u002FAgentBoard)\n\n\u003Cdiv class=\"datagrid\" style=\"width:700px;\">\n\u003Ctable>\n\u003C!-- \u003Cthead>\u003Ctr>\u003Cth>\u003C\u002Fth>\u003Cth colspan=\"2\">Easy\u003C\u002Fth>\u003Cth colspan=\"2\">Medium\u003C\u002Fth>\u003Cth colspan=\"2\">Hard\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead> -->\n\u003Cthead>\u003Ctr>\u003Cth>LLM Name\u003C\u002Fth>\u003Cth>Success Rate\u003C\u002Fth>\u003Cth>Progress Rate\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\u003Ctd>xLAM-v0.1-r\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.533\u003C\u002Fstrong>\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.766\u003C\u002Fstrong>\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>DeepSeek-67B \u003C\u002Ftd>\u003Ctd>0.400 \u003C\u002Ftd>\u003Ctd>0.714\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>GPT-3.5-Turbo-0613 \u003C\u002Ftd>\u003Ctd>0.367 \u003C\u002Ftd>\u003Ctd>0.627\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>GPT-3.5-Turbo-16k \u003C\u002Ftd>\u003Ctd>0.317\u003C\u002Ftd>\u003Ctd>0.591\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Lemur-70B \u003C\u002Ftd>\u003Ctd>0.283\u003C\u002Ftd>\u003Ctd>0.720\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>CodeLlama-13B \u003C\u002Ftd>\u003Ctd>0.250\u003C\u002Ftd>\u003Ctd>0.525\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>CodeLlama-34B \u003C\u002Ftd>\u003Ctd>0.133\u003C\u002Ftd>\u003Ctd>0.600\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Mistral-7B \u003C\u002Ftd>\u003Ctd>0.033\u003C\u002Ftd>\u003Ctd>0.510\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Vicuna-13B-16K \u003C\u002Ftd>\u003Ctd>0.033\u003C\u002Ftd>\u003Ctd>0.343\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Llama-2-70B \u003C\u002Ftd>\u003Ctd>0.000\u003C\u002Ftd>\u003Ctd>0.483\u003C\u002Ftd>\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\n---\n# Licenses\n\nThis code is licensed under Apache 2.0.  For models based on the [deepseek model](https:\u002F\u002Fhuggingface.co\u002Fcollections\u002Fdeepseek-ai\u002Fdeepseek-coder-65f295d7d8a0a29fe39b4ec4), which require you to follow the use based restrictions in the [linked deepseek license](https:\u002F\u002Fgithub.com\u002Fdeepseek-ai\u002Fdeepseek-coder\u002Fblob\u002Fmain\u002FLICENSE-MODEL). This is a research only project.\n\n\n---\n\n# Acknowledgement\n\nWe want to acknowledge the work which have made contributions to our paper and the agent research community! If you find our work useful, please consider to cite\n\n```bibtex\n@article{zhang2024xlamfamilylargeaction,\n  title={xLAM: A Family of Large Action Models to Empower AI Agent Systems}, \n  author={Zhang, Jianguo  and Lan, Tian  and Zhu, Ming  and Liu, Zuxin and Hoang, Thai and Kokane, Shirley and Yao, Weiran and Tan, Juntao and Prabhakar, Akshara and Chen, Haolin and Liu, Zhiwei and Feng, Yihao and Awalgaonkar, Tulika and Murthy, Rithesh and Hu, Eric and Chen, Zeyuan and Xu, Ran and Niebles, Juan Carlos and Heinecke, Shelby and Wang, Huan and Savarese, Silvio and Xiong, Caiming},\n  journal={arXiv preprint arXiv:2409.03215}\n  year={2024}\n}\n```\n\n```bibtex\n@article{zhang2025actionstudio,\n  title={ActionStudio: A Lightweight Framework for Data and Training of Action Models},\n  author={Zhang, Jianguo and Hoang, Thai and Zhu, Ming and Liu, Zuxin and Wang, Shiyu and Awalgaonkar, Tulika and Prabhakar, Akshara and Chen, Haolin and Yao, Weiran and Liu, Zhiwei and others},\n  journal={arXiv preprint arXiv:2503.22673},\n  year={2025}\n}\n```\n\n```bibtex\n@article{prabhakar2025apigen,\n  title={APIGen-MT: Agentic PIpeline for Multi-Turn Data Generation via Simulated Agent-Human Interplay},\n  author={Prabhakar, Akshara and Liu, Zuxin and Zhu, Ming and Zhang, Jianguo and Awalgaonkar, Tulika and Wang, Shiyu and Liu, Zhiwei and Chen, Haolin and Hoang, Thai and others},\n  journal={arXiv preprint arXiv:2504.03601},\n  year={2025}\n}\n```\n\n```bibtex\n@article{liu2024apigen,\n  title={APIGen: Automated PIpeline for Generating Verifiable and Diverse Function-Calling Datasets},\n  author={Liu, Zuxin and Hoang, Thai and Zhang, Jianguo and Zhu, Ming and Lan, Tian and Kokane, Shirley and Tan, Juntao and Yao, Weiran and Liu, Zhiwei and Feng, Yihao and others},\n  journal={arXiv preprint arXiv:2406.18518},\n  year={2024}\n}\n```\n\n```bibtex\n@article{zhang2024agentohana,\n  title={AgentOhana: Design Unified Data and Training Pipeline for Effective Agent Learning},\n  author={Zhang, Jianguo and Lan, Tian and Murthy, Rithesh and Liu, Zhiwei and Yao, Weiran and Tan, Juntao and Hoang, Thai and Yang, Liangwei and Feng, Yihao and Liu, Zuxin and others},\n  journal={arXiv preprint arXiv:2402.15506},\n  year={2024}\n}\n```\n","\u003Cdiv align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FSalesforceAIResearch\u002FxLAM\u002Ftree\u002Fmain\">\u003Cimg width=\"400px\" height=\"auto\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSalesforceAIResearch_xLAM_readme_0293777380e4.png\">\u003C\u002Fa>\n\u003C\u002Fdiv>\n\n\u003Cbr\u002F>\n\n\u003Cdiv align=\"center\">\n\n  \u003C!-- [![Release Notes](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Frelease\u002FSalesforceAIResearch\u002FxLAM)](https:\u002F\u002Fgithub.com\u002FSalesforceAIResearch\u002FxLAM\u002Freleases) -->\n  ![Python 3.9+](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPython-3.9%2B-brightgreen.svg)\n  [![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-Apache-green.svg)]()\n   [![huggingface](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F%F0%9F%A4%97-Models-yellow)](https:\u002F\u002Fhuggingface.co\u002Fcollections\u002FSalesforce\u002Fxlam-models-65f00e2a0a63bbcd1c2dade4)\n   [![discord](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDiscord-Chanel-light)](https:\u002F\u002Fdiscord.gg\u002FtysWwgZyQ2)\n [![GitHub star chart](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002FSalesforceAIResearch\u002FxLAM?style=social)](https:\u002F\u002Fstar-history.com\u002F#SalesforceAIResearch\u002FxLAM)\n\n\u003C\u002Fdiv>\n\n\u003Cp align=\"center\">\n  \u003Ca href=\"https:\u002F\u002Farxiv.org\u002Fpdf\u002F2409.03215\">论文\u003C\u002Fa> |\n  \u003C!-- \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FSalesforceAIResearch\u002FAgentLite\u002Ftree\u002Fmain?tab=readme-ov-file#-key-features\">关键特性\u003C\u002Fa> | -->\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FSalesforceAIResearch\u002FxLAM\u002Ftree\u002Fmain?tab=readme-ov-file#model-instruction\">模型说明\u003C\u002Fa> |\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FSalesforceAIResearch\u002FxLAM\u002Ftree\u002Fmain?tab=readme-ov-file#framework\">框架\u003C\u002Fa> |\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FSalesforceAIResearch\u002FxLAM\u002Ftree\u002Fmain?tab=readme-ov-file#installation\">安装\u003C\u002Fa> |\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FSalesforceAIResearch\u002FxLAM\u002Ftree\u002Fmain?tab=readme-ov-file#train\">训练\u003C\u002Fa> |\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FSalesforceAIResearch\u002FxLAM\u002Ftree\u002Fmain?tab=readme-ov-file#benchmarks\">基准测试\u003C\u002Fa> |\n  \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FSalesforceAIResearch\u002FxLAM\u002Ftree\u002Fmain?tab=readme-ov-file#acknowledgement\">致谢\u003C\u002Fa>\n\u003C\u002Fp>\n\n---\n\n## 🎉🎉🎉 新闻\n- **[08-20.2025]** 🎉🎉🎉 [ActionStudio](https:\u002F\u002Fgithub.com\u002FSalesforceAIResearch\u002FxLAM\u002Ftree\u002Fmain\u002Factionstudio) 和 [LATTE](https:\u002F\u002Flatte-web.github.io\u002F)（与视觉专家共同思考的学习）均已被 EMNLP 2025 主会场接收！\n- **[08-05.2025]** 💫 [ActionStudio](.\u002Factionstudio\u002FREADME.md) 已更新新功能，改进了训练配置跟踪，并进行了整体代码优化！\n- **[05-12.2025]** 我们的 **NAACL 2025 口头报告** 的 [xLAM 演示文稿](https:\u002F\u002Fdocs.google.com\u002Fpresentation\u002Fd\u002F1IAdUPSFLd0l05T_IwfcUPI5b_pe0StNFjBd6Srosap8\u002Fedit?usp=sharing)现已发布！   📂 我们还开源了 [**APIGen-MT-5k**](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002FSalesforce\u002FAPIGen-MT-5k)，这是一个紧凑而强大的数据集，用于探索多轮函数调用。\n- **[04-15.2025]** 🏆🏆🏆 **xLAM-2-fc-r 在最新的 BFCL 排行榜上获得第一名**！\n- **[04-15.2025]**：🚀🚀🚀 **ActionStudio 现已开源！** 请查看我们的 [论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F2503.22673) 和 [代码](ActionStudio_README.md)以获取完整详情。\n- **[04-15.2025]**：📢📢📢 **APIGen-MT 现已开源！** 更多信息请参阅我们的 [论文](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2504.03601) 和 [项目网站](https:\u002F\u002Fapigen-mt.github.io\u002F)！\n- **[11.2024]**：添加了与 xLAM 模型交互的 [最新示例和分词器信息](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FxLAM-8x22b-r\u002Fblob\u002Fmain\u002Fexample\u002Fxlam_chat_template_examples_11_21.ipynb)。\n- **[09.2024]**：如果您有任何反馈，请加入我们的 [Discord 社区](https:\u002F\u002Fdiscord.gg\u002FtysWwgZyQ2)！\n- **[09.2024]**：请查阅我们的 xLAM [技术报告论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F2409.03215)。\n- **[08.2024]**：我们很高兴地宣布推出完整的 xLAM 家族，这是一套大型行动模型！从“小型巨人”到工业级强大力量。这些模型取得了令人瞩目的成绩，在 [伯克利函数调用排行榜](https:\u002F\u002Fgorilla.cs.berkeley.edu\u002Fleaderboard.html#leaderboard) 上分别位列第 1 和第 6 名。\n请查看我们的 [Hugging Face 收藏](https:\u002F\u002Fhuggingface.co\u002Fcollections\u002FSalesforce\u002Fxlam-models-65f00e2a0a63bbcd1c2dade4)。\n- **[07.2024]**：我们很高兴地宣布推出两款函数调用模型：[xLAM-1b-fc-r](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FxLAM-1b-fc-r) 和 [xLAM-7b-fc-r](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FxLAM-7b-fc-r)。这些模型在 [伯克利函数调用排行榜](https:\u002F\u002Fgorilla.cs.berkeley.edu\u002Fleaderboard.html#leaderboard) 上分别位列第 3 和第 25 名，表现优于许多规模大得多的模型。敬请期待更多强大模型的发布。\n- **[06.2024]** 查看我们最新的工作 [APIGen](https:\u002F\u002Fapigen-pipeline.github.io\u002F)，这是用于函数调用的最佳开源模型。我们的数据集 [xlam-function-calling-60k](https:\u002F\u002Fhuggingface.co\u002Fdatasets\u002FSalesforce\u002Fxlam-function-calling-60k) 目前是 HuggingFace 上排名前三的趋势数据集，在截至 2024 年 7 月 4 日的 173,670 个数据集中脱颖而出。另请参阅 [Salesforce CEO 的推特](https:\u002F\u002Fx.com\u002FBenioff\u002Fstatus\u002F1808365628551844186)、[VentureBeat](https:\u002F\u002Fventurebeat.com\u002Fai\u002Fsalesforce-proves-less-is-more-xlam-1b-tiny-giant-beats-bigger-ai-models\u002F) 和 [新智元](https:\u002F\u002Fmp.weixin.qq.com\u002Fs\u002FB3gyaGwzlQaUXyI8n7Rguw)。\n- **[03.2024]** [xLAM 模型](https:\u002F\u002Fhuggingface.co\u002Fcollections\u002FSalesforce\u002Fxlam-models-65f00e2a0a63bbcd1c2dade4)已发布！您可以将其与 [AgentLite 基准测试](https:\u002F\u002Fgithub.com\u002FSalesforceAIResearch\u002FAgentLite\u002Ftree\u002Fmain\u002Fbenchmark)或其他基准测试一起使用，其性能可与 GPT-4 相媲美！\n- **[02.2024]** AgentOhana 和 xLAM 的首次发布 [论文](https:\u002F\u002Farxiv.org\u002Fabs\u002F2402.15506)！\n\n---\n> **注**：本仓库仅用于 **研究目的**。  \n> 与 xLAM 相关的所有数据均因 **内部规定** 而 **部分公开**，旨在支持代理研究社区的发展。\n\n---\n\n由大型语言模型（LLMs）驱动的自主代理近年来备受研究关注。然而，要充分挖掘 LLM 在基于代理的任务中的潜力，仍面临诸多挑战，尤其是由于来自不同来源的异构数据通常具有多轮对话轨迹。\n\n本仓库推出的 xLAM 能够整合来自不同环境的代理轨迹，覆盖广泛场景。它将这些轨迹统一为一致的格式，从而简化通用数据加载器的构建，该加载器专为代理训练而优化。借助数据统一化，我们的训练流程能够在不同数据源之间保持平衡，并在数据划分和模型训练过程中确保各设备间的独立随机性。\n\n\n\u003Cp align=\"center\">\n    \u003Cbr>\n\u003C!--     \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSalesforceAIResearch_xLAM_readme_1c261b77c989.png\" width=\"780\"\u002F> -->\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSalesforceAIResearch_xLAM_readme_5a246f5e6d86.jpeg\" width=\"700\"\u002F>\n    \u003Cbr>\n\u003Cp>\n  \n---\n\n# 模型说明\n\n| 模型                  | 总参数量 | 上下文长度 | 发布日期 | 类别 | 下载模型  | 下载 GGUF 文件 |\n|------------------------|----------------|------------|-------------|-------|----------------|----------|\n| Llama-xLAM-2-70b-fc-r | 700亿          | 128k            | 2025年3月26日 | 多轮对话、函数调用   | [🤗 链接](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FLlama-xLAM-2-70b-fc-r)         |      无               |\n| Llama-xLAM-2-8b-fc-r      | 80亿           | 128k            | 2025年3月26日 | 多轮对话、函数调用     | [🤗 链接](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FLlama-xLAM-2-8b-fc-r)              |   [🤗 链接](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FLlama-xLAM-2-8b-fc-r-gguf)    |\n| xLAM-2-32b-fc-r     | 320亿          | 32k（最大128k）*            | 2025年3月26日 |  多轮对话、函数调用   | [🤗 链接](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FxLAM-2-32b-fc-r)             |      无               |\n| xLAM-2-3b-fc-r      | 30亿           | 32k（最大128k）*            | 2025年3月26日 |  多轮对话、函数调用    | [🤗 链接](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FxLAM-2-3b-fc-r)              |      [🤗 链接](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FxLAM-2-3b-fc-r-gguf)               |\n| xLAM-2-1b-fc-r      | 10亿           | 32k（最大128k）*            | 2025年3月26日 |  多轮对话、函数调用 | [🤗 链接](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FxLAM-2-1b-fc-r)              |      [🤗 链接](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FxLAM-2-1b-fc-r-gguf)               |\n| xLAM-7b-r           | 72.4亿         | 32k            | 2024年9月5日|通用、函数调用 | [🤗 链接](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FxLAM-7b-r) | -- |\n| xLAM-8x7b-r           | 467亿          | 32k           | 2024年9月5日|通用、函数调用 | [🤗 链接](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FxLAM-8x7b-r) | -- |\n| xLAM-8x22b-r           | 1410亿         | 64k           | 2024年9月5日|通用、函数调用 | [🤗 链接](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FxLAM-8x22b-r) | -- |\n| xLAM-1b-fc-r           | 13.5亿         | 16k           | 2024年7月17日 | 函数调用| [🤗 链接](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FxLAM-1b-fc-r) | [🤗 链接](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FxLAM-1b-fc-r-gguf) |\n| xLAM-7b-fc-r           | 69.1亿         | 4k            | 2024年7月17日| 函数调用| [🤗 链接](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FxLAM-7b-fc-r) | [🤗 链接](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FxLAM-7b-fc-r-gguf) |\n| xLAM-v0.1-r           | 467亿          | 32k            | 2024年3月18日 |通用、函数调用 | [🤗 链接](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FxLAM-v0.1-r) | -- |\n\n\n[xLAM](https:\u002F\u002Fhuggingface.co\u002Fcollections\u002FSalesforce\u002Fxlam-models-65f00e2a0a63bbcd1c2dade4) 系列在多项任务上表现优异，包括通用任务和函数调用。\n在参数量相同的情况下，这些模型经过了广泛的智能体任务和场景的微调，同时保留了原始模型的能力。\n\n### 📦 模型命名规范\n- `xLAM-7b-r`：大型行动模型 v1.0 或 v2.0 的通用版本，针对广泛的智能体能力进行了微调。`-r` 后缀表示这是一个 **研究** 版本。\n- `xLAM-7b-fc-r`：专门用于 **函数调用** 任务的变体，同样标记为 **研究** 使用。\n- ✅ 所有模型均与 VLLM、FastChat 和基于 Transformers 的推理框架完全兼容。\n\n---\n## 部署与交互 xLAM 模型\n\n### 🤗 使用 Transformers 进行推理\n以下是使用最新模型的一个示例：\n\n```python\nimport torch\nfrom transformers import AutoModelForCausalLM, AutoTokenizer\n\ntokenizer = AutoTokenizer.from_pretrained(\"Salesforce\u002FLlama-xLAM-2-3b-fc-r\")\nmodel = AutoModelForCausalLM.from_pretrained(\"Salesforce\u002FLlama-xLAM-2-3b-fc-r\", torch_dtype=torch.bfloat16, device_map=\"auto\")\n\n# 示例对话与工具调用\nmessages = [\n    {\"role\": \"user\", \"content\": \"你好，最近怎么样？\"},\n    {\"role\": \"assistant\", \"content\": \"谢谢！我很好。有什么可以帮您的吗？\"},\n    {\"role\": \"user\", \"content\": \"伦敦现在的天气如何？\"},\n]\n\ntools = [\n    {\n        \"name\": \"get_weather\",\n        \"description\": \"获取某个地点的当前天气\",\n        \"parameters\": {\n            \"type\": \"object\",\n            \"properties\": {\n                \"location\": {\"type\": \"string\", \"description\": \"城市和州，例如旧金山，加州\"},\n                \"unit\": {\"type\": \"string\", \"enum\": [\"摄氏度\", \"华氏度\"], \"description\": \"返回的温度单位\"}\n            },\n            \"required\": [\"location\"]\n        }\n    }\n]\n\nprint(\"====== 应用聊天模板后的提示 ======\")\nprint(tokenizer.apply_chat_template(messages, tools=tools, add_generation_prompt=True, tokenize=False))\n\ninputs = tokenizer.apply_chat_template(messages, tools=tools, add_generation_prompt=True, return_dict=True, return_tensors=\"pt\")\ninput_ids_len = inputs[\"input_ids\"].shape[-1] # 获取输入 token 的长度\ninputs = {k: v.to(model.device) for k, v in inputs.items()}\nprint(\"====== 模型响应 ======\")\noutputs = model.generate(**inputs, max_new_tokens=256)\ngenerated_tokens = outputs[:, input_ids_len:] # 取出新生成的 tokens\nprint(tokenizer.decode(generated_tokens[0], skip_special_tokens=True))\n```\n\n**注意：** 不同的应用可能需要调整 Temperature 参数。通常，较低的 Temperature 有助于实现确定性的结果。\n此外，对于需要严格遵循特定格式或函数调用的任务，明确包含格式化指令是非常重要且必要的。\n\n### ⚡📈 使用 vLLM 进行推理\n\nxLAM 模型也可以使用 vLLM 高效地进行高吞吐量推理服务。请使用 `vllm>=0.6.5`，因为较早版本会导致基于 Qwen 的模型性能下降。\n\n#### 设置与服务\n\n1. 安装所需版本的 vLLM：\n```bash\npip install \"vllm>=0.6.5\"\n```\n\n2. 将工具解析器插件下载到本地路径：\n```bash\nwget https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FxLAM-2-1b-fc-r\u002Fraw\u002Fmain\u002Fxlam_tool_call_parser.py\n```\n\n3. 启动兼容 OpenAI API 的端点：\n```bash\nMODEL_NAME_OR_PATH=\"Salesforce\u002FxLAM-2-1b-fc-r\"\nASSIGNED_MODEL_NAME=\"xlam-2-1b-fc-r\" # vLLM 使用分配的模型名称作为引用\nNUM_ASSIGNED_GPUS=1 # 对于 70B 参数的模型需要 4 张 GPU，每张 80GB 显存\nPORT=8000\n\nvllm serve $MODEL_NAME_OR_PATH \\\n  --tensor-parallel-size $NUM_ASSIGNED_GPUS \\\n  --served-model-name $ASSIGNED_MODEL_NAME \\\n  --port $PORT \\\n  --gpu-memory-utilization 0.9 \\\n  --enable-auto-tool-choice \\\n  --tool-parser-plugin .\u002Fxlam_tool_call_parser.py \\\n  --tool-call-parser xlam \n```\n\n注意：请确保已下载工具解析器插件文件，并且在 `--tool-parser-plugin` 中指定的路径正确指向您本地的文件副本。xLAM 系列模型都使用 **相同** 的工具调用解析器，因此您只需为所有模型下载一次即可。\n\n#### 使用 OpenAI API 测试\n\n以下是一个最小示例，用于测试已部署端点上的工具使用情况：\n\n```python\nimport openai\nimport json\n\n# 配置客户端以使用本地 vLLM 端点\nclient = openai.OpenAI(\n    base_url=\"http:\u002F\u002Flocalhost:8000\u002Fv1\",  # 默认 vLLM 服务器端口\n    api_key=\"empty\"  # 可以为任意字符串\n)\n\n# 定义一个工具\u002F函数\ntools = [\n    {\n        \"type\": \"function\",\n        \"function\": {\n            \"name\": \"get_weather\",\n            \"description\": \"获取某个地点的当前天气\",\n            \"parameters\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"location\": {\n                        \"type\": \"string\",\n                        \"description\": \"城市和州，例如旧金山, CA\"\n                    },\n                    \"unit\": {\n                        \"type\": \"string\",\n                        \"enum\": [\"摄氏度\", \"华氏度\"],\n                        \"description\": \"返回温度的单位\"\n                    }\n                },\n                \"required\": [\"location\"]\n            }\n        }\n    }\n]\nmessages = [\n  {\"role\": \"system\", \"content\": \"你是一个可以使用工具的帮助助手。\"},\n  {\"role\": \"user\", \"content\": \"旧金山的天气怎么样？\"}\n]\n\n# 创建聊天完成请求\nif tools is None or tools==[]: # 日常对话\n  response = client.chat.completions.create(\n      model=\"xlam-2-1b-fc-r\",  # 分配的模型名称\n      messages=messages\n  )\nelse: # 函数调用\n  response = client.chat.completions.create(\n      model=\"xlam-2-1b-fc-r\",  # 分配的模型名称\n      messages=messages,\n      tools=tools,\n      tool_choice=\"auto\"\n  )\n\n# 打印响应\nprint(\"助手的回答：\")\nprint(json.dumps(response.model_dump(), indent=2))\n```\n\n如需了解更多高级配置和部署选项，请参阅 [vLLM 文档](https:\u002F\u002Fdocs.vllm.ai\u002Fen\u002Flatest\u002Fserving\u002Fopenai_compatible_server.html)。\n\n\n---\n# 🧠 APIGen-MT: 基于模拟人机交互的多轮数据生成代理式流水线\n\n\u003Cp align=\"center\">\n\u003Cimg width=\"780\" alt=\"image\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSalesforceAIResearch_xLAM_readme_008a3612f66a.png\" \u002F>\n\u003Cimg width=\"780\" alt=\"image\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSalesforceAIResearch_xLAM_readme_8a5d4179758a.png\" \u002F>\n\u003Cp>\n\n---\n\n# 🧠 ActionStudio: 用于大型动作模型的数据生成与训练的轻量级框架\n\n\u003Cp align=\"center\">\n    \u003Cbr>\n\u003C!--     \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSalesforceAIResearch_xLAM_readme_1c261b77c989.png\" width=\"650\"\u002F> -->\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSalesforceAIResearch_xLAM_readme_7e395d966304.jpg\" width=\"900\"\u002F>\n    \u003Cbr>\n\u003Cp>\n\n\n❤️ 更多详情请参阅 [ActionStudio.md](ActionStudio_README.md)。 \n\n\n## 📦 安装\n\n### 🔧 依赖项\n\n从根 `xLAM` 目录（即 `setup.py` 所在的位置）安装依赖项：\n\n```bash\nconda create --name actionstudio python=3.10\n\nbash requirements.sh\n```\n\n### 🚀 安装 ActionStudio\n\n**开发版本**（最新）：\n\n要使用处于积极开发中的最新代码，请从根 `xLAM` 目录（即 `setup.py` 所在的位置）以 **可编辑模式** 安装 ActionStudio：\n\n```bash\npip install -e .\n```\n\n## 🗂️ 结构\n\n```text\nactionstudio\u002F\n├── datasets\u002F                             # 开源的“统一轨迹数据集”\n├── examples\u002F                             # 使用示例和配置\n│   ├── data_configs\u002F                     # 数据混合的 YAML 配置文件\n│   ├── deepspeed_configs\u002F                # DeepSpeed 训练配置文件\n│   └── trainings\u002F                        # 各种训练方法的 Bash 脚本（“README.md”）\n├── src\u002F                                  # 源代码\n│   ├── data_conversion\u002F                  # 将轨迹转换为训练数据（“README.md”）\n│   └── criticLAM\u002F                        # 批评者大型动作模型的实现（“README.md”）\n└── foundation_modeling\u002F                  # 核心建模组件\n    ├── data_handlers\u002F\n    ├── train\u002F\n    ├── trainers\u002F\n    └── utils\u002F\n```\n\n🔍 大多数顶级文件夹都包含带有详细说明和解释的 README.md 文件。\n\n## ⚡ 效率\n\u003Cimg width=\"1705\" alt=\"image\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSalesforceAIResearch_xLAM_readme_dd56be4e2724.png\" \u002F>\n\n\n## 📜 许可证\n\n代码采用 Apache 2.0 许可证，数据集则采用 CC-BY-NC-4.0 许可证。所提供的数据仅用于研究目的。\n\n## 🛠️ 代码更新历史\n\n\n#### 💫 **2025年8月5日**\n- **统一配置跟踪**\n现在每次运行都会将其完整的训练配置写入一个单独的 JSON 文件中——以唯一的模型 ID 为键——保存在 [model_config_files](.\u002Fexamples\u002Ftrainings\u002Fmodel_config_files\u002F) 中，以便于参考和复现。\n\n- **HF ⇄ DeepSpeed 一致性**\n解决了 Hugging Face 和 DeepSpeed 之间超参数设置的不一致问题，以确保两者完全同步。\n\n- **学习率调度器调整**\n优化了默认调度器参数，使预热过程更加平滑，收敛更加稳定。\n\n- **代码整体清理**\n简化了模块结构，移除了无效路径，并添加了内联文档，以方便维护。\n\n\n#### **2025年5月9日**\n- 修复了 data_verifier 中的参数错误。参考 [#24](https:\u002F\u002Fgithub.com\u002FSalesforceAIResearch\u002FxLAM\u002Fissues\u002F24)。\n\n#### **2025年4月14日**\n- 更新了依赖项版本，以支持最新的模型和技术\n- 添加了自动计算和分配训练步数的功能\n- 启用了训练结束时的自动检查点合并功能。\n    - 📄 请参阅 [actionstudio\u002Fexamples\u002Ftrainings\u002FREADME.md](actionstudio\u002Fexamples\u002Ftrainings\u002FREADME.md) 以获取训练示例和使用说明\n- 改进了文档和代码注释\n\n\n---\n\n# 部署和交互 xLAM 模型\n\n> ⚠️ **注意**: 如需使用 **xLAM v1.0** 模型，请参阅 [示例笔记本及分词器信息](https:\u002F\u002Fhuggingface.co\u002FSalesforce\u002FxLAM-8x22b-r\u002Fblob\u002Fmain\u002Fexample\u002Fxlam_chat_template_examples_11_21.ipynb)。\n\n**xLAM v2.0** 模型在 v1.0 的基础上进行了优化，结构更加完善，并采用了标准的对话格式，因此可以直接与 vLLM、Transformers 等主流推理框架兼容——无需任何特殊设置。  \n> 🔍 不过，我们仍然建议您查看上述笔记本，以便更好地理解对话格式逻辑和分词器的行为。\n\n## 💬 将 xLAM 作为 OpenAI 兼容的聊天 API 提供服务\n您可以使用以下两种方法之一将 xLAM 模型部署为 OpenAI 兼容的聊天完成 API。\n\n> 📌 *以下示例使用 `Salesforce\u002FxLAM-8x7b-r`，在 4×A100 (40GB) 的配置上运行。*\n\n### 方法 1：使用 vLLM（推荐）\n\nvLLM 提供高效的推理服务，延迟更低。要使用 vLLM 提供模型服务：\n\n```bash\nvllm serve Salesforce\u002FxLAM-8x7b-r --host 0.0.0.0 --port 8000 --tensor-parallel-size 4\n```\n\n### 方法 2：使用 FastChat\n\nFastChat 提供功能更丰富的推理服务。要使用 FastChat 提供服务：\n\n1. 启动控制器：\n```bash\npython3 -m fastchat.serve.controller --host 0.0.0.0\n```\n\n2. 启动 OpenAI 兼容的 API 服务器：\n```bash\npython3 -m fastchat.serve.openai_api_server --host 0.0.0.0 --port 8000\n```\n\n3. 启动模型工作进程：\n```bash\npython3 -m fastchat.serve.vllm_worker \\\n       --model-names \"Salesforce\u002FxLAM-8x7b-r\" \\\n       --model-path Salesforce\u002FxLAM-8x7b-r \\\n       --host 0.0.0.0 \\\n       --port 31005 \\\n       --worker-address http:\u002F\u002Flocalhost:31001 \\\n       --num-gpus 4 \\\n       --limit-worker-concurrency 64\n```\n\n## 使用聊天完成 API 处理 xLAM 1.0 系列模型\n模型提供服务后，您可以使用以下 xLAM 客户端与其交互，以实现函数调用或其他应用：\n\n```python\nfrom xLAM.client import xLAMChatCompletion, xLAMConfig\n\n# 配置客户端\nconfig = xLAMConfig(base_url=\"http:\u002F\u002Flocalhost:8000\u002Fv1\u002F\", model=\"Salesforce\u002FxLAM-8x7b-r\")\nllm = xLAMChatCompletion.from_config(config)\n\n# 示例对话\nmessages = [\n    {\"role\": \"system\", \"content\": \"你是一个乐于助人的助手。\"},\n    {\"role\": \"user\", \"content\": \"纽约现在的天气怎么样？\"},\n    {\"role\": \"assistant\", \"content\": \"要获取纽约的天气信息，我需要调用 get_weather 函数。\", \"tool_calls\": {\"name\": \"get_weather\", \"arguments\": '{\"location\": \"纽约\", \"unit\": \"华氏度\"}'}},\n    {\"role\": \"tool\", \"name\": \"get_weather\", \"content\": '{\"temperature\": 72, \"description\": \"多云\"}'},\n    {\"role\": \"user\", \"content\": \"现在请查询旧金山的天气。\"}\n]\n\n# 示例函数定义（可选）\ntools = [\n    {\n        \"name\": \"get_weather\",\n        \"description\": \"获取某个地点的当前天气\",\n        \"parameters\": {\n            \"type\": \"object\",\n            \"properties\": {\n                \"location\": {\"type\": \"string\", \"描述\": \"城市和州，例如旧金山、纽约\"},\n                \"unit\": {\"type\": \"string\", \"枚举值为 '摄氏度' 和 '华氏度'\", \"描述\": \"返回温度的单位\"}\n            },\n            \"required\": [\"location\"]\n        }\n    },\n    {\n        \"name\": \"search\",\n        \"description\": \"在互联网上搜索信息\",\n        \"parameters\": {\n            \"type\": \"object\",\n            \"properties\": {\n                \"query\": {\"type\": \"string\", \"描述\": \"搜索关键词，例如 '最新的 AI 新闻'\"}\n            },\n            \"required\": [\"query\"]\n        }\n    },\n    {\n        \"name\": \"respond\",\n        \"description\": \"当您准备好回复时，请使用此函数。该函数允许助手根据输入消息和对话上下文生成适当的回复。对于简单问题，生成简洁的回答；对于复杂问题，生成更详细的回答。\",\n        \"parameters\": {\n            \"type\": \"object\",\n            \"properties\": {\n                \"message\": {\"type\": \"string\", \"描述\": \"要回复的消息内容\"}\n            },\n            \"required\": [\"message\"]\n        }\n    }\n]\n\nresponse = llm.completion(messages, tools=tools)\nprint(response)\n```\n-->\n\n---\n\n# :trophy: 基准测试（xLAM-2-fc 系列）\n\n## 伯克利函数调用排行榜（BFCL v3）\n\n\u003Cp align=\"left\">\n\u003Cimg width=\"800\" alt=\"image\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSalesforceAIResearch_xLAM_readme_9293233dfd85.png\" \u002F>\n\u003C\u002Fp>\n\n\u003Cp align=\"left\">\n\u003Cimg width=\"70%\" alt=\"BFCL 结果\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSalesforceAIResearch_xLAM_readme_3492e9691b95.png\">\n\u003Cbr>\n\u003Csmall>\u003Ci>不同模型在 BFCL 排行榜上的性能对比。排名基于综合准确率，即各评估类别的加权平均值。“FC”代表函数调用模式，与通过自定义“提示”提取函数调用的方式相对。\u003C\u002Fi>\u003C\u002Fsmall>\n\u003C\u002Fp>\n\n## τ-bench 基准测试\n\n\u003Cp align=\"left\">\n\u003Cimg width=\"70%\" alt=\"Tau-bench 结果\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSalesforceAIResearch_xLAM_readme_fc09b3676924.png\">\n\u003Cbr>\n\u003Csmall>\u003Ci>τ-bench 基准测试中至少进行 5 次试验后的成功率（pass@1）。我们的 xLAM-2-70b-fc-r 模型在 τ-bench 上的整体成功率达到 56.2%，显著优于基础 Llama 3.1 70B Instruct 模型（38.2%）以及其他开源模型，如 DeepSeek v3（40.6%）。值得注意的是，我们的最佳模型甚至超越了专有模型，例如 GPT-4o（52.9%），并接近最新模型 Claude 3.5 Sonnet（新）（60.1%）的表现。\u003C\u002Fi>\u003C\u002Fsmall>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n\u003Cimg width=\"70%\" alt=\"Pass^k 曲线\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSalesforceAIResearch_xLAM_readme_cf554ffe8d29.png\">\n\u003Cbr>\n\u003Csmall>\u003Ci>Pass^k 曲线用于衡量给定任务的所有 5 次独立试验均成功的概率，取 τ-retail（左）和 τ-airline（右）领域的所有任务的平均值。数值越高，表明模型的一致性越好。\u003C\u002Fi>\u003C\u002Fsmall>\n\u003C\u002Fp>\n\n---\n\n# :trophy: 基准测试（xLAM 1.0 系列）\n\n\n## 伯克利函数调用排行榜（BFCL）\n\n\u003Cp align=\"left\">\n    \u003Cbr>\n\u003C!--     \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSalesforceAIResearch_xLAM_readme_1c261b77c989.png\" width=\"700\"\u002F> -->\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSalesforceAIResearch_xLAM_readme_3536669ffcbc.jpg\" width=\"800\"\u002F>\n    \u003Cbr>\n\u003Cp>\n\n## [BOLAA](https:\u002F\u002Fgithub.com\u002Fsalesforce\u002FBOLAA)\n\n### 网上商店\n\n\n\u003Cdiv class=\"datagrid\" style=\"width:750px;\">\n\u003Ctable>\n\u003C!-- \u003Cthead>\u003Ctr>\u003Cth>\u003C\u002Fth>\u003Cth colspan=\"6\">\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead> -->\n\u003Cthead>\u003Ctr>\u003Cth>LLM 名称\u003C\u002Fth>\u003Cth>ZS\u003C\u002Fth>\u003Cth>ZST\u003C\u002Fth>\u003Cth>ReaAct\u003C\u002Fth>\u003Cth>PlanAct\u003C\u002Fth>\u003Cth>PlanReAct\u003C\u002Fth>\u003Cth>BOLAA\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\u003Ctd>Llama-2-70B-chat \u003C\u002Ftd>\u003Ctd>0.0089 \u003C\u002Ftd>\u003Ctd>0.0102\u003C\u002Ftd>\u003Ctd>0.4273\u003C\u002Ftd>\u003Ctd>0.2809\u003C\u002Ftd>\u003Ctd>0.3966\u003C\u002Ftd>\u003Ctd>0.4986\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Vicuna-33B \u003C\u002Ftd>\u003Ctd>0.1527 \u003C\u002Ftd>\u003Ctd>0.2122\u003C\u002Ftd>\u003Ctd>0.1971\u003C\u002Ftd>\u003Ctd>0.3766\u003C\u002Ftd>\u003Ctd>0.4032\u003C\u002Ftd>\u003Ctd>0.5618\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Mixtral-8x7B-Instruct-v0.1 \u003C\u002Ftd>\u003Ctd>0.4634 \u003C\u002Ftd>\u003Ctd>0.4592\u003C\u002Ftd>\u003Ctd>\u003Cu>0.5638\u003C\u002Fu>\u003C\u002Ftd>\u003Ctd>0.4738\u003C\u002Ftd>\u003Ctd>0.3339\u003C\u002Ftd>\u003Ctd>0.5342\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>GPT-3.5-Turbo \u003C\u002Ftd>\u003Ctd>0.4851 \u003C\u002Ftd>\u003Ctd>\u003Cu>0.5058\u003C\u002Fu>\u003C\u002Ftd>\u003Ctd>0.5047\u003C\u002Ftd>\u003Ctd>0.4930\u003C\u002Ftd>\u003Ctd>\u003Cu>0.5436\u003C\u002Fu>\u003C\u002Ftd>\u003Ctd>\u003Cu>0.6354\u003C\u002Fu>\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>GPT-3.5-Turbo-Instruct \u003C\u002Ftd>\u003Ctd>0.3785 \u003C\u002Ftd>\u003Ctd>0.4195\u003C\u002Ftd>\u003Ctd>0.4377\u003C\u002Ftd>\u003Ctd>0.3604\u003C\u002Ftd>\u003Ctd>0.4851\u003C\u002Ftd>\u003Ctd>0.5811\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>GPT-4-0613\u003C\u002Ftd>\u003Ctd>\u003Cu>0.5002\u003C\u002Fu>\u003C\u002Ftd>\u003Ctd>0.4783 \u003C\u002Ftd>\u003Ctd>0.4616\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.7950\u003C\u002Fstrong>\u003C\u002Ftd>\u003Ctd>0.4635\u003C\u002Ftd>\u003Ctd>0.6129\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>xLAM-v0.1-r\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.5201\u003C\u002Fstrong>\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.5268\u003C\u002Fstrong>\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.6486\u003C\u002Fstrong>\u003C\u002Ftd>\u003Ctd>\u003Cu>0.6573\u003C\u002Fu>\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.6611\u003C\u002Fstrong>\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.6556\u003C\u002Fstrong>\u003C\u002Ftd>\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\n### HotpotQA\n\n\u003Cdiv class=\"datagrid\" style=\"width:750px;\">\n\u003Ctable>\n\u003C!-- \u003Cthead>\u003Ctr>\u003Cth>\u003C\u002Fth>\u003Cth colspan=\"6\">\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead> -->\n\u003Cthead>\u003Ctr>\u003Cth>LLM 名称\u003C\u002Fth>\u003Cth>ZS\u003C\u002Fth>\u003Cth>ZST\u003C\u002Fth>\u003Cth>ReaAct\u003C\u002Fth>\u003Cth>PlanAct\u003C\u002Fth>\u003Cth>PlanReAct\u003C\u002Fth>\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\u003Ctd>Mixtral-8x7B-Instruct-v0.1 \u003C\u002Ftd>\u003Ctd>0.3912 \u003C\u002Ftd>\u003Ctd>0.3971\u003C\u002Ftd>\u003Ctd>0.3714\u003C\u002Ftd>\u003Ctd>0.3195\u003C\u002Ftd>\u003Ctd>0.3039\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>GPT-3.5-Turbo \u003C\u002Ftd>\u003Ctd>0.4196 \u003C\u002Ftd>\u003Ctd>0.3937\u003C\u002Ftd>\u003Ctd>0.3868\u003C\u002Ftd>\u003Ctd>0.4182\u003C\u002Ftd>\u003Ctd>0.3960\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>GPT-4-0613\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.5801\u003C\u002Fstrong>\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.5709 \u003C\u002Fstrong>\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.6129\u003C\u002Fstrong>\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.5778\u003C\u002Fstrong>\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.5716\u003C\u002Fstrong>\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>xLAM-v0.1-r\u003C\u002Ftd>\u003Ctd>\u003Cu>0.5492\u003C\u002Fu>\u003C\u002Ftd>\u003Ctd>\u003Cu>0.4776\u003C\u002Fu>\u003C\u002Ftd>\u003Ctd>\u003Cu>0.5020\u003C\u002Fu>\u003C\u002Ftd>\u003Ctd>\u003Cu>0.5583\u003C\u002Fu>\u003C\u002Ftd>\u003Ctd>\u003Cu>0.5030\u003C\u002Fu>\u003C\u002Ftd>\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\n## [AgentLite](https:\u002F\u002Fgithub.com\u002FSalesforceAIResearch\u002FAgentLite\u002Ftree\u002Fmain)\n\n**请注意：** AgentLite 提供的所有提示都被视为 xLAM-v0.1-r 的“未见提示”，这意味着该模型并未使用与这些提示相关的数据进行训练。\n\n#### 网上商店 \n\n\u003Cdiv class=\"datagrid\" style=\"width:780px;\">\n\u003Ctable>\n\u003C!-- \u003Cthead>\u003Ctr>\u003Cth>\u003C\u002Fth>\u003Cth colspan=\"2\">简单\u003C\u002Fth>\u003Cth colspan=\"2\">中等\u003C\u002Fth>\u003Cth colspan=\"2\">困难\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead> -->\n\u003Cthead>\u003Ctr>\u003Cth>LLM 名称\u003C\u002Fth>\u003Cth>Act\u003C\u002Fth>\u003Cth>ReAct\u003C\u002Fth>\u003Cth>BOLAA\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\u003Ctd>GPT-3.5-Turbo-16k \u003C\u002Ftd>\u003Ctd>0.6158 \u003C\u002Ftd>\u003Ctd>0.6005\u003C\u002Ftd>\u003Ctd>0.6652\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>GPT-4-0613\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.6989 \u003C\u002Fstrong>\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.6732\u003C\u002Fstrong>\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.7154\u003C\u002Fstrong>\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>xLAM-v0.1-r\u003C\u002Ftd>\u003Ctd>\u003Cu>0.6563\u003C\u002Fu>\u003C\u002Ftd>\u003Ctd>\u003Cu>0.6640\u003C\u002Fu>\u003C\u002Ftd>\u003Ctd>\u003Cu>0.6854\u003C\u002Fu>\u003C\u002Ftd>\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\n#### HotpotQA\n\n\u003Cdiv class=\"datagrid\" style=\"width:700px;\">\n\u003Ctable>\n\u003Cthead>\u003Ctr>\u003Cth>\u003C\u002Fth>\u003Cth colspan=\"2\">简单\u003C\u002Fth>\u003Cth colspan=\"2\">中等\u003C\u002Fth>\u003Cth colspan=\"2\">困难\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead>\n\u003Cthead>\u003Ctr>\u003Cth>LLM 名称\u003C\u002Fth>\u003Cth>F1 分数\u003C\u002Fth>\u003Cth>准确率\u003C\u002Fth>\u003Cth>F1 分数\u003C\u002Fth>\u003Cth>准确率\u003C\u002Fth>\u003Cth>F1 分数\u003C\u002Fth>\u003Cth>准确率\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\u003Ctd>GPT-3.5-Turbo-16k-0613 \u003C\u002Ftd>\u003Ctd>0.410 \u003C\u002Ftd>\u003Ctd>0.350\u003C\u002Ftd>\u003Ctd>0.330\u003C\u002Ftd>\u003Ctd>0.25\u003C\u002Ftd>\u003Ctd>0.283\u003C\u002Ftd>\u003Ctd>0.20\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>GPT-4-0613\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.611\u003C\u002Fstrong>\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.47\u003C\u002Fstrong> \u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.610\u003C\u002Fstrong>\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.480\u003C\u002Fstrong>\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.527\u003C\u002Fstrong>\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.38\u003C\u002Fstrong>\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>xLAM-v0.1-r\u003C\u002Ftd>\u003Ctd>\u003Cu>0.532\u003C\u002Fu>\u003C\u002Ftd>\u003Ctd>\u003Cu>0.45\u003C\u002Fu>\u003C\u002Ftd>\u003Ctd>\u003Cu>0.547\u003C\u002Fu>\u003C\u002Ftd>\u003Ctd>\u003Cu>0.46\u003C\u002Fu>\u003C\u002Ftd>\u003Ctd>\u003Cu>0.455\u003C\u002Fu>\u003C\u002Ftd>\u003Ctd>\u003Cu>0.36\u003C\u002Fu>\u003C\u002Ftd>\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\n\n\n## [ToolBench](https:\u002F\u002Fgithub.com\u002FOpenBMB\u002FToolBench)\n\n\u003Cdiv class=\"datagrid\" style=\"width:780px;\">\n\u003Ctable>\n\u003C!-- \u003Cthead>\u003Ctr>\u003Cth>\u003C\u002Fth>\u003Cth colspan=\"2\">简单\u003C\u002Fth>\u003Cth colspan=\"2\">中等\u003C\u002Fth>\u003Cth colspan=\"2\">困难\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead> -->\n\u003Cthead>\u003Ctr>\u003Cth>LLM 名称\u003C\u002Fth>\u003Cth>未见指令与相同集合\u003C\u002Fth>\u003Cth>未见工具与已见类别\u003C\u002Fth>\u003Cth>未见工具与未见类别\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\u003Ctd>TooLlama V2 \u003C\u002Ftd>\u003Ctd>0.4385 \u003C\u002Ftd>\u003Ctd>0.4300\u003C\u002Ftd>\u003Ctd>0.4350\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>GPT-3.5-Turbo-0125 \u003C\u002Ftd>\u003Ctd>0.5000 \u003C\u002Ftd>\u003Ctd>0.5150\u003C\u002Ftd>\u003Ctd>0.4900\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>GPT-4-0125-preview\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.5462\u003C\u002Fstrong>\u003C\u002Ftd>\u003Ctd>\u003Cu>0.5450\u003C\u002Fu>\u003C\u002Ftd>\u003Ctd>\u003Cu>0.5050\u003C\u002Fu>\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>xLAM-v0.1-r\u003C\u002Ftd>\u003Ctd>\u003Cu>0.5077\u003C\u002Fu>\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.5650\u003C\u002Fstrong>\u003C\u002Ftd>\u003Ctd>\u003Cstrong>0.5200\u003C\u002Fstrong>\u003C\u002Ftd>\u003C\u002Ftr>\n\u003C\u002Ftbody>\n\u003C\u002Ftable>\n\n## [MINT-BENCH](https:\u002F\u002Fgithub.com\u002Fxingyaoww\u002Fmint-bench)\n\n\n\u003Cdiv class=\"datagrid\" style=\"width:700px;\">\n\u003Ctable>\n\u003C!-- \u003Cthead>\u003Ctr>\u003Cth>\u003C\u002Fth>\u003Cth colspan=\"2\">简单\u003C\u002Fth>\u003Cth colspan=\"2\">中等\u003C\u002Fth>\u003Cth colspan=\"2\">困难\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead> -->\n\u003Cthead>\u003Ctr>\u003Cth>LLM 名称\u003C\u002Fth>\u003Cth>1 步\u003C\u002Fth>\u003Cth>2 步\u003C\u002Fth>\u003Cth>3 步\u003C\u002Fth>\u003Cth>4 步\u003C\u002Fth>\u003Cth>5 步\u003C\u002Fth>\u003C\u002Ftr>\u003C\u002Fthead>\n\u003Ctbody>\n\u003Ctr>\u003Ctd>GPT-4-0613\u003C\u002Ftd>\u003Ctd>-\u003C\u002Ftd>\u003Ctd>-\u003C\u002Ftd>\u003Ctd>-\u003C\u002Ftd>\u003Ctd>-\u003C\u002Ftd>\u003Ctd>69.45\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Claude-Instant-1\u003C\u002Ftd>\u003Ctd>12.12\u003C\u002Ftd>\u003Ctd>32.25\u003C\u002Ftd>\u003Ctd>39.25\u003C\u002Ftd>\u003Ctd>44.37\u003C\u002Ftd>\u003Ctd>45.90\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>xLAM-v0.1-r\u003C\u002Ftd>\u003Ctd>4.10\u003C\u002Ftd>\u003Ctd>28.50\u003C\u002Ftd>\u003Ctd>36.01\u003C\u002Ftd>\u003Ctd>42.66\u003C\u002Ftd>\u003Ctd>43.96\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Claude-2 \u003C\u002Ftd>\u003Ctd>26.45 \u003C\u002Ftd>\u003Ctd>35.49\u003C\u002Ftd>\u003Ctd>36.01\u003C\u002Ftd>\u003Ctd>39.76\u003C\u002Ftd>\u003Ctd>39.93\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>Lemur-70b-Chat-v1 \u003C\u002Ftd>\u003Ctd>3.75 \u003C\u002Ftd>\u003Ctd>26.96\u003C\u002Ftd>\u003Ctd>35.67\u003C\u002Ftd>\u003Ctd>37.54\u003C\u002Ftd>\u003Ctd>37.03\u003C\u002Ftd>\u003C\u002Ftr>\n\u003Ctr>\u003Ctd>GPT-3.5-Turbo-0613 \u003C\u002Ftd>\u003Ctd>2.73\u003C\u002Ftd>\u003Ctd>16.89\u003C\u002Ftd>\u003Ctd>24.06\u003C\u002Ftd>\u003Ctd>31.74\u003C\u002Ftd>\u003Ctd>36.18\u003C\u002Ftd>\u003C\u002Ftr\n\n# 许可证\n\n本代码采用 Apache 2.0 许可证。对于基于 [DeepSeek 模型](https:\u002F\u002Fhuggingface.co\u002Fcollections\u002Fdeepseek-ai\u002Fdeepseek-coder-65f295d7d8a0a29fe39b4ec4) 的模型，您需要遵守其中所附 [DeepSeek 许可证](https:\u002F\u002Fgithub.com\u002Fdeepseek-ai\u002Fdeepseek-coder\u002Fblob\u002Fmain\u002FLICENSE-MODEL) 中关于使用限制的相关规定。本项目仅用于研究目的。\n\n\n---\n\n# 致谢\n\n我们衷心感谢为我们的论文以及智能体研究社区作出贡献的各位！如果您觉得我们的工作有所帮助，请考虑引用以下文献：\n\n```bibtex\n@article{zhang2024xlamfamilylargeaction,\n  title={xLAM：赋能 AI 智能体系统的大型动作模型家族},\n  author={张建国、兰天、朱明、刘祖鑫、黄泰、科卡内·雪莉、姚伟然、谭俊涛、普拉巴卡尔·阿克沙拉、陈浩林、刘志伟、冯义豪、阿瓦尔高恩卡尔·图丽卡、穆尔蒂·里特什、胡埃里克、陈泽源、徐然、尼布勒斯·胡安·卡洛斯、海因内克·谢尔比、王欢、萨瓦雷斯·西尔维奥、熊才明},\n  journal={arXiv 预印本 arXiv:2409.03215},\n  year={2024}\n}\n```\n\n```bibtex\n@article{zhang2025actionstudio,\n  title={ActionStudio：用于动作模型数据与训练的轻量级框架},\n  author={张建国、黄泰、朱明、刘祖鑫、王世宇、阿瓦尔高恩卡尔·图丽卡、普拉巴卡尔·阿克沙拉、陈浩林、姚伟然、刘志伟等},\n  journal={arXiv 预印本 arXiv:2503.22673},\n  year={2025}\n}\n```\n\n```bibtex\n@article{prabhakar2025apigen,\n  title={APIGen-MT：基于模拟智能体与人类交互的多轮数据生成代理式流水线},\n  author={普拉巴卡尔·阿克沙拉、刘祖鑫、朱明、张建国、阿瓦尔高恩卡尔·图丽卡、王世宇、刘志伟、陈浩林、黄泰等},\n  journal={arXiv 预印本 arXiv:2504.03601},\n  year={2025}\n}\n```\n\n```bibtex\n@article{liu2024apigen,\n  title={APIGen：用于生成可验证且多样化的函数调用数据集的自动化流水线},\n  author={刘祖鑫、黄泰、张建国、朱明、兰天、科卡内·雪莉、谭俊涛、姚伟然、刘志伟、冯义豪等},\n  journal={arXiv 预印本 arXiv:2406.18518},\n  year={2024}\n}\n```\n\n```bibtex\n@article{zhang2024agentohana,\n  title={AgentOhana：面向高效智能体学习的统一数据与训练流水线设计},\n  author={张建国、兰天、穆尔蒂·里特什、刘志伟、姚伟然、谭俊涛、黄泰、杨良伟、冯义豪、刘祖鑫等},\n  journal={arXiv 预印本 arXiv:2402.15506},\n  year={2024}\n}\n```","# xLAM 快速上手指南\n\nxLAM 是 Salesforce 开源的一系列大型动作模型（Large Action Models），专为智能体（Agent）任务设计，在多轮对话和函数调用（Function Calling）任务上表现卓越，部分模型在 Berkeley Function-Calling Leaderboard 上位居榜首。\n\n## 环境准备\n\n在开始之前，请确保您的开发环境满足以下要求：\n\n*   **操作系统**: Linux (推荐) 或 macOS\n*   **Python 版本**: 3.9 或更高版本\n*   **硬件要求**: \n    *   推理：建议配备 NVIDIA GPU (支持 CUDA)，显存大小取决于所选模型参数量（例如 1B\u002F3B 模型需较少显存，70B 模型需多卡或高显存环境）。\n    *   若使用 GGUF 格式模型，可配合 `llama.cpp` 在 CPU 或消费级显卡上运行。\n*   **前置依赖**: \n    *   PyTorch (建议安装与 CUDA 版本匹配的最新版)\n    *   Transformers 库\n    *   Accelerate 库\n\n## 安装步骤\n\n推荐使用 `pip` 安装必要的 Python 依赖包。国内用户建议使用清华或阿里镜像源以加速下载。\n\n```bash\n# 创建虚拟环境（可选但推荐）\npython -m venv xlam-env\nsource xlam-env\u002Fbin\u002Factivate  # Windows 用户使用: xlam-env\\Scripts\\activate\n\n# 安装核心依赖\npip install torch torchvision torchaudio --index-url https:\u002F\u002Fdownload.pytorch.org\u002Fwhl\u002Fcu118\npip install transformers accelerate sentencepiece protobuf\n\n# 或者一键安装所有依赖（如果项目提供了 requirements.txt）\n# pip install -r requirements.txt -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n> **注意**：请根据您的 CUDA 版本调整 `torch` 的安装命令。上述命令示例为 CUDA 11.8。\n\n## 基本使用\n\nxLAM 系列模型完全兼容 Hugging Face `transformers` 库。以下是一个使用 `Llama-xLAM-2-3b-fc-r` 模型进行多轮对话并触发函数调用的最小化示例。\n\n### 代码示例\n\n```python\nimport torch\nfrom transformers import AutoModelForCausalLM, AutoTokenizer\n\n# 1. 加载模型和分词器\n# 国内网络若连接 HuggingFace 困难，可配置 HF_ENDPOINT 环境变量或使用镜像站\nmodel_name = \"Salesforce\u002FLlama-xLAM-2-3b-fc-r\"\n\ntokenizer = AutoTokenizer.from_pretrained(model_name)\nmodel = AutoModelForCausalLM.from_pretrained(\n    model_name, \n    torch_dtype=torch.bfloat16, \n    device_map=\"auto\"\n)\n\n# 2. 构建对话历史\nmessages = [\n    {\"role\": \"user\", \"content\": \"Hi, how are you?\"},\n    {\"role\": \"assistant\", \"content\": \"Thanks. I am doing well. How can I help you?\"},\n    {\"role\": \"user\", \"content\": \"What's the weather like in London?\"},\n]\n\n# 3. 定义可用工具 (Function Schema)\ntools = [\n    {\n        \"name\": \"get_weather\",\n        \"description\": \"Get the current weather for a location\",\n        \"parameters\": {\n            \"type\": \"object\",\n            \"properties\": {\n                \"location\": {\"type\": \"string\", \"description\": \"The city and state, e.g. San Francisco, CA\"},\n                \"unit\": {\"type\": \"string\", \"enum\": [\"celsius\", \"fahrenheit\"], \"description\": \"The unit of temperature to return\"}\n            },\n            \"required\": [\"location\"]\n        }\n    }\n]\n\n# 4. 应用聊天模板并生成响应\nprint(\"====== Prompt after applying chat template ======\")\nprompt_text = tokenizer.apply_chat_template(messages, tools=tools, add_generation_prompt=True, tokenize=False)\nprint(prompt_text)\n\ninputs = tokenizer.apply_chat_template(\n    messages, \n    tools=tools, \n    add_generation_prompt=True, \n    return_dict=True, \n    return_tensors=\"pt\"\n)\n\ninput_ids_len = inputs[\"input_ids\"].shape[-1]\ninputs = {k: v.to(model.device) for k, v in inputs.items()}\n\nprint(\"====== Model Response ======\")\noutputs = model.generate(**inputs, max_new_tokens=256)\ngenerated_tokens = outputs[:, input_ids_len:]\n\nresponse = tokenizer.decode(generated_tokens[0], skip_special_tokens=True)\nprint(response)\n```\n\n### 使用说明\n*   **模型选择**：根据显存资源选择合适的模型。轻量级任务推荐 `xLAM-2-1b-fc-r` 或 `xLAM-2-3b-fc-r`；复杂任务可选用 `xLAM-2-70b-fc-r`。\n*   **GGUF 支持**：部分模型（如 1B, 3B, 8B 版本）提供 GGUF 格式，可使用 `llama.cpp` 或支持 GGUF 的前端（如 LM Studio, Ollama）直接运行，降低部署门槛。\n*   **框架兼容**：该模型原生支持 VLLM 和 FastChat 等高性能推理框架，生产环境部署请参考相应框架文档加载上述 HuggingFace 模型路径。","某电商平台的智能客服团队正试图升级系统，使其能自动处理用户复杂的“查询订单并申请退款”等多步操作请求。\n\n### 没有 xLAM 时\n- **意图识别割裂**：传统模型只能回答静态问题，无法理解“先查单再退款”这种需要按顺序执行多个动作的复杂指令。\n- **开发成本高昂**：工程师需为每个新业务场景（如改地址、换货）硬编码大量的规则脚本和 API 调用逻辑，维护困难。\n- **错误率高企**：面对用户模糊的自然语言描述，系统常因参数提取不准而调用错误的接口，导致操作失败或数据混乱。\n- **多轮交互笨拙**：系统缺乏记忆与规划能力，一旦用户中途补充信息，往往需要重新开始整个流程，体验极差。\n\n### 使用 xLAM 后\n- **原生动作规划**：xLAM 作为大型动作模型，能直接将自然语言转化为精确的多步函数调用序列，自动完成“查询 - 判断 - 执行”闭环。\n- **零代码扩展**：只需提供新的 API 文档，xLAM 即可通过微调快速学会新技能，无需重写底层业务逻辑代码。\n- **参数精准映射**：凭借在 BFCL 榜单领先的函数调用能力，xLAM 能从口语化表达中精准提取结构化参数，大幅降低接口调用错误。\n- **流畅多轮协同**：支持复杂的多轮对话状态追踪，即使用户中途修改需求，xLAM 也能动态调整执行计划，无缝继续任务。\n\nxLAM 将原本需要繁琐硬编码的自动化流程，转变为模型原生的智能决策能力，让 AI Agent 真正具备了像人类一样操作软件系统的执行力。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSalesforceAIResearch_xLAM_d5c9cad2.png","SalesforceAIResearch","Salesforce AI Research","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002FSalesforceAIResearch_6ff2d82a.png","Open Source projects released by Salesforce AI Research",null,"ospo@salesforce.com","https:\u002F\u002Fgithub.com\u002FSalesforceAIResearch",[80,84],{"name":81,"color":82,"percentage":83},"Python","#3572A5",86.1,{"name":85,"color":86,"percentage":87},"Shell","#89e051",13.9,612,53,"2026-04-08T17:50:43","Apache-2.0","未说明","运行大模型推理必需 NVIDIA GPU（基于代码示例中的 device_map=\"auto\"和 torch_dtype），具体显存需求取决于所选模型参数量（1B 至 141B 不等），需支持 bfloat16 数据类型",{"notes":95,"python":96,"dependencies":97},"1. 该工具主要用于研究和模型推理，支持多种参数量模型（从 1B 到 141B），硬件需求随模型大小显著变化。\n2. 代码示例显示需使用支持 bfloat16 的 GPU 环境。\n3. 模型完全兼容 VLLM、FastChat 和 Transformers 推理框架。\n4. 部分数据因内部规定仅部分开源。\n5. 提供 GGUF 格式文件供量化部署（针对部分模型）。","3.9+",[98,99],"torch","transformers",[13,35],[102,103,104,105,106,107],"agents","llm-agent","llms","xlam","agentstudio","actionstudio","2026-03-27T02:49:30.150509","2026-04-11T10:01:52.484233",[],[]]