# Kani: A Lightweight and Highly Hackable Framework for Building Language Model Applications

arXiv: https://arxiv.org/abs/2309.05542 · HTML: https://mlsanity.com/paper/2309.05542/

## Key facts

- Cited by 11 papers in the map (data through 14 Oct 2026).
- Builds on 5 of its 11 references that are in the map.
- First posted on arXiv 11 Sep 2023.

## Builds on (most cited first, 5 of 5)

- [Language Models are Few-Shot Learners](https://mlsanity.com/paper/2005.14165/) (2020)
- [PyTorch: An Imperative Style, High-Performance Deep Learning Library](https://mlsanity.com/paper/1912.01703/) (2019)
- [Llama 2: Open Foundation and Fine-Tuned Chat Models](https://mlsanity.com/paper/2307.09288/) (2023)
- [Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks](https://mlsanity.com/paper/2005.11401/) (2020)
- [Prompting Is Programming: A Query Language for Large Language Models](https://mlsanity.com/paper/2212.06094/) (2022)

## Built on by (most cited first, 11 of 11)

- [FanOutQA: A Multi-Hop, Multi-Document Question Answering Benchmark for Large Language Models](https://mlsanity.com/paper/2402.14116/) (2024)
- [On the Limit of Language Models as Planning Formalizers](https://mlsanity.com/paper/2412.09879/) (2024)
- [ReDel: A Toolkit for LLM-Powered Recursive Multi-Agent Systems](https://mlsanity.com/paper/2408.02248/) (2024)
- [Real-Time Deadlines Reveal Fragile Temporal Adaptation in LLM Strategic Dialogues](https://mlsanity.com/paper/2601.13206/) (2026)
- [You Have Thirteen Hours in Which to Solve the Labyrinth: Enhancing AI Game Masters with Function Calling](https://mlsanity.com/paper/2409.06949/) (2024)
- [TurnaboutLLM: A Deductive Reasoning Benchmark from Detective Games](https://mlsanity.com/paper/2505.15712/) (2025)
- [Grounded Intuition of GPT-Vision's Abilities with Scientific Images](https://mlsanity.com/paper/2311.02069/) (2023)
- [Toward Beginner-Friendly LLMs for Language Learning: Controlling Difficulty in Conversation](https://mlsanity.com/paper/2506.04072/) (2025)
- [Language Model as Planner and Formalizer under Constraints](https://mlsanity.com/paper/2510.05486/) (2025)
- [Language Models as Higher-Order Planning Formalizers](https://mlsanity.com/paper/2603.23844/) (2026)
- [First Steps Towards Overhearing LLM Agents: A Case Study With Dungeons & Dragons Gameplay](https://mlsanity.com/paper/2505.22809/) (2025)

## Abstract (arXiv)

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.
