General Introduction
Bambo is a new type of proxy framework that is lighter and more flexible than mainstream frameworks and is able to handle a wide range of load tasks.Bambo achieves efficient proxy functionality by defining all the tools in the tools directory and using asynchronous custom functions. Users can define the model and client parameters they need to call in the llm_client.py file, and then create their own test scripts in the examples folder.Bambo's goal is to provide an efficient and flexible proxy solution for a variety of application scenarios.
Traditional Agent framework each role is an independent Agent, need a "supervisor" to coordinate the work, role switching to go through a complex handover process, LLM calls more often, resulting in poor response speed and smoothness.
Bambo solves this problem by role-playing. Based on Bambo, notebooklm similar effect is realized, there is no TTS in the effect, if needed, you can add the corresponding code in the test script.
Function List
- Lightweight and flexible proxy framework
- Handles a wide range of loads
- Support for asynchronous custom functions
- Define and invoke the required model and client parameters
- Creating and running test scripts
- Multi-character scenario support
- Code execution and analysis functions
Using Help
Installation process
- Cloning Warehouse:
git clone https://github.com/LB-Young/Bambo.git cd Bambo
- Install the dependencies:
pip install -r requirements.txt
- Install PyTorch manually (if necessary):
pip3 install torch torchvision torchaudio
Setup and Configuration
- Define all the tools in the tools directory and make sure that custom functions are asynchronous.
- Define the model and client parameters for the desired call in the llm_client.py file.
- Create your own test scripts in the examples folder, defining the required roles and tools.
- Initialize the Bambo object and pass in the required parameters:
from src.bambo import Bambo from src.llm_client import client, model from src.tools.code_execute import code_execute roles = { "finance_expert": "finance_expert", "computer_expert": "computer_expert", } tools = {} bambo = Bambo(client=client, bambo_role=None, roles=roles, tools=tools, agents=None, model=model) query = "I am a high school student and now I want to choose a major, but I don't know what to choose. Could you please describe what are the advantages and disadvantages of each of the three majors Finance, Law and Computer Science." async for item in bambo.execute(query=query). print(item, end="", flush=True)
Using Bambo
- Run the Bambo interface:
python examples/notebooklm.py
- or run the agent in the background:
nohup python examples/multi_roles.py &> multi_roles.log &
- The interactive menu will guide you through the following options:
- Create/update training dataset
- training model
- Running Agents
- Run a complete workflow
- abort
configure
Edit config.py to customize:
- Model Selection
- Training hyperparameters
- Proxy Settings
- Responsive Templates
- Task Filtering
Bambo offers a variety of ways to filter the tasks handled:
- Labeling (automatic)
- Blacklisting (manual)