KwaiAgents

Autonomous Agents 💻 Python ⚖️ Other 🔴 No recent commits
1.2k stars

KwaiAgents is an open-source suite of agent-related resources from Kuaishou, including a lite agent system (KAgentSys-Lite), agent-tuned language models (KAgentLMs), a large instruction dataset (KAgentInstruct), and a benchmark (KAgentBench). It helps developers build and evaluate LLM-based agents with planning, tool-use, and reflection capabilities.

KwaiAgents demo
🎞️ Demo from the project README

✨ Key features

  • KAgentSys-Lite: a lite agent system with planning and tool-use
  • KAgentLMs: models fine-tuned for agent tasks (Qwen, Baichuan)
  • KAgentInstruct: over 200k agent-related instructions for fine-tuning
  • KAgentBench: 3,000+ human-edited evaluation items across five dimensions
  • Supports local deployment via vLLM/FastChat or llama.cpp
  • Includes benchmark evaluation scripts for agent capabilities

🎯 Use cases

  • Deploy a conversational agent that answers questions using tools
  • Fine-tune LLMs to improve their planning and tool-use abilities
  • Evaluate agent capabilities like planning, reflection, and tool-use
  • Build custom agents with specific tools and instructions

📦 Installation

🧰 Requirements: Python 3.10+, GPU recommended for vLLM, optional API keys for OpenAI and WeatherAPI, chromedriver for browsing tool.

# For KAgentSys-Lite
git clone git@github.com:KwaiKEG/KwaiAgents.git
cd KwaiAgents
python setup.py develop

For model serving, install dependencies:

pip install vllm
pip install "fschat[model_worker,webui]"

For Baichuan models, use specific versions:

pip install "fschat[model_worker,webui]"
pip install vllm==0.2.0
pip install transformers==4.33.2

🚀 Usage

Using KAgentSys-Lite with OpenAI
export OPENAI_API_KEY=sk-xxxxx
export WEATHER_API_KEY=xxxxxx
kagentsys --query="Who is Andy Lau's wife?" --llm_name="gpt-3.5-turbo" --lang="en"
Using local model (after deploying via FastChat)
kagentsys --query="Who is Andy Lau's wife?" --llm_name="kagentlms_qwen_7b_mat" \
--use_local_llm --local_llm_host="localhost" --local_llm_port=8888 --lang="en"

⚠️ Good to know

KAgentSys-Lite is a lite version with limited tools, no memory, and slightly reduced performance compared to the full system.

❓ FAQ

What models are available in KAgentLMs?

KAgentLMs includes Qwen-7B-MAT, Qwen-14B-MAT, Qwen1.5-14B-MAT, and Baichuan2-13B-MAT, all fine-tuned for agent capabilities.

How do I deploy a local model for use with KAgentSys-Lite?

You can serve the model using vLLM and FastChat (GPU) or llama.cpp (CPU). For vLLM, start the controller, vllm_worker, and openai_api_server as described in the README.

What is KAgentBench and how do I use it?

KAgentBench is a benchmark with over 3,000 human-edited evaluation items for testing agent capabilities. You can run evaluation with the provided scripts in the benchmark folder.

Can I use custom tools with KAgentSys-Lite?

Yes, custom tools usage is demonstrated in examples/custom_tool_example.py.

📊 Repository

Stars★ 1,200
Forks🍴 110
Open issues🐛 13
Last commit🕒 Jun 19, 2024
Created📅 Nov 2023
Language💻 Python
License⚖️ Other

🤖 Overview, features, install steps and FAQ were generated from the project's README on Sep 4, 2026. Always check the original source before running commands.