KwaiAgents

A generalized information-seeking agent system with Large Language Models (LLMs).

KwaiAgents

What is KwaiAgents

KwaiAgents is an open-source project developed by KwaiKEG, a division of Kuaishou Technology, that focuses on creating advanced agent systems leveraging large language models (LLMs). The project encompasses several components, including KAgentSys-Lite, KAgentLMs, KAgentInstruct, and KAgentBench, each designed to enhance the capabilities of AI agents in tasks such as planning, tool usage, and instruction following. The primary audience includes AI researchers and developers looking to implement or experiment with agent-based systems. KwaiAgents addresses the need for robust, flexible agent frameworks that can operate effectively in various applications, utilizing technologies such as Python, Hugging Face datasets, and machine learning libraries.

How to Use

To get started with KwaiAgents, follow these installation instructions:

  1. Prebuild Environment:

    • Install Miniconda and create a new environment:
      conda create -n kagent python=3.10
      conda activate kagent
      pip install -r requirements.txt
      
  2. Using AgentLMs:

    • For GPU deployment using vLLM:
      pip install vllm
      pip install "fschat[model_worker,webui]"
      python -m fastchat.serve.controller
      python -m fastchat.serve.vllm_worker --model-path $model_path --trust-remote-code
      python -m fastchat.serve.openai_api_server --host localhost --port 8888
      
    • For CPU deployment using llama.cpp:
      pip install "llama-cpp-python[server]"
      python3 -m llama_cpp.server --model kagentlms_qwen_7b_mat_gguf/ggml-model-q4_0.gguf --chat_format chatml --port 8888
      
  3. Using KAgentSys-Lite:

    • Clone the repository and install:
      git clone git@github.com:KwaiKEG/KwaiAgents.git
      cd KwaiAgents
      python setup.py develop
      
    • Set environment variables for API keys:
      export OPENAI_API_KEY=sk-xxxxx
      export WEATHER_API_KEY=xxxxxx
      
    • Execute a query:
      kagentsys --query="Who is Andy Lau's wife?" --llm_name="gpt-3.5-turbo" --lang="en"
      

For detailed documentation, refer to the KwaiAgents documentation.

Key Features

  • Multiple Agent Systems: Includes KAgentSys-Lite, a lightweight version of the full KAgentSys, providing essential functionalities with reduced complexity.
  • Large Language Models: Offers KAgentLMs, a suite of LLMs capable of advanced tasks like planning and tool usage, optimized through meta-agent tuning.
  • Extensive Datasets: Features KAgentInstruct, which contains over 200,000 fine-tuning instructions, and KAgentBench, with 3,000+ evaluation data points for assessing agent performance.
  • Benchmarking Capabilities: Provides tools for evaluating agent performance across various dimensions, including planning and reflection, with detailed scoring metrics.
  • Flexible Deployment Options: Supports both GPU and CPU deployments, allowing for scalability and adaptability to different hardware environments.
  • Community and Enterprise Support: Open-source nature encourages community contributions, while enterprise features cater to advanced users needing robust solutions.
  • Integration with Hugging Face: Seamlessly integrates with Hugging Face's ecosystem, enabling easy access to models and datasets.
  • Custom Tool Usage: Allows for the integration of custom tools, enhancing the functionality of agents in specific applications.

KwaiAgents is designed for both individual developers and enterprises, providing a comprehensive framework for building and deploying intelligent agent systems.

Statistics

Stars
1,167
Forks
112
Watchers
1,167
!
Issues
13

Topics

#agi#autogpt#autonomous-agents#chatgpt#gpt#large-language-models#localllm

Language

Python