Language model applications are becoming increasingly popular and complex, often including features like tool usage and retrieval augmentation. However, existing frameworks for such applications are often opinionated, deciding for developers how their prompts ought to be formatted and imposing limitations on customizability and reproducibility. To solve this we present Kani: a lightweight, flexible, and model-agnostic open-source framework for building language model applications. Kani helps developers implement a variety of complex features by supporting the core building blocks of chat interaction: model interfacing, chat management, and robust function calling. All Kani core functions are easily overridable and well documented to empower developers to customize functionality for their own needs. Kani thus serves as a useful tool for researchers, hobbyists, and industry professionals alike to accelerate their development while retaining interoperability and fine-grained control.
翻译:语言模型应用正变得越来越流行且复杂,通常包括工具使用和检索增强等功能。然而,现有的此类应用框架往往具有固化的设计模式,替开发者决定提示应如何格式化,并对可定制性和可复现性施加限制。为解决这一问题,我们提出了Kani:一个轻量、灵活且模型无关的开源框架,用于构建语言模型应用。Kani通过支持聊天交互的核心构建模块——模型接口、聊天管理和鲁棒的函数调用——帮助开发者实现多种复杂功能。Kani的所有核心函数均可轻松覆写且文档完善,使开发者能够根据自身需求定制功能。因此,Kani成为研究人员、爱好者及行业从业者的实用工具,在保持互操作性和细粒度控制的同时加速开发进程。