👋 join us on 𝕏 (Twitter), Discord and WeChat
InternLM2-Agent.mp4
Please see the overview for the general introduction of Lagent. Meanwhile, we provide extremely simple code for quick start. You may refer to examples for more details.
Install with pip (Recommended).
pip install lagent
You need to install Streamlit first.
# pip install streamlit
streamlit run examples/internlm2_agent_web_demo.py
Lagent is a lightweight open-source framework that allows users to efficiently build large language model(LLM)-based agents. It also provides some typical tools to augment LLM. The overview of our framework is shown below:
- Stream Output: Provides the
stream_chat
interface for streaming output, allowing cool streaming demos right at your local setup. - Interfacing is unified, with a comprehensive design upgrade for enhanced extensibility, including:
- Model: Whether it's the OpenAI API, Transformers, or LMDeploy inference acceleration framework, you can seamlessly switch between models.
- Action: Simple inheritance and decoration allow you to create your own personal toolkit, adaptable to both InternLM and GPT.
- Agent: Consistent with the Model's input interface, the transformation from model to intelligent agent only takes one step, facilitating the exploration and implementation of various agents.
- Documentation has been thoroughly upgraded with full API documentation coverage.
If you find this project useful in your research, please consider cite:
@misc{lagent2023,
title={{Lagent: InternLM} a lightweight open-source framework that allows users to efficiently build large language model(LLM)-based agents},
author={Lagent Developer Team},
howpublished = {\url{https://github.com/InternLM/lagent}},
year={2023}
}
This project is released under the Apache 2.0 license.