π Advanced LLM-VM
π΅οΈ Agents
Our AI agents expand what you can do with LLMs!
The REBEL Agent
REcursion Based Extensible LLM
Our REBEL agent takes a novel approach to answering complex questions. Using recursive reasoning, REBEL expands what LLMs can do with problem decomposition and tool use. In this way, we are able to answer questions requiring data LLMs were not directly trained on.
Running REBEL
Getting started with REBEL is easy
quickstart_REBEL.py
# import our client
from llm_vm.client import Client
import os
# Instantiate the client specifying which LLM you want to use
client = Client(big_model='chat_gpt', small_model='gpt') #REBEL will use chat_gpt no matter what big model is specified here, this specification exists for non-REBEL completion calls.
#Calling client.complete with a tool list specified leads to the REBEL agent being used.
response = client.complete(
prompt = 'Is it warmer in Paris or Timbuktu and what are the temperatures in either city?',
context='',
openai_key=os.getenv("OPENAI_API_KEY"), #for REBEL we need an OpenAI key
tools=[{'description': 'Find the weather at a location and returns it in celcius.', #this tool list contains only one dictionary, therefore only one tool
'dynamic_params': {
"latitude": 'latitude of as a float',
"longitude": 'the longitude as a float'
},
'method': 'GET',
'url': "https://api.open-meteo.com/v1/forecast",
'static_params': {'current_weather': 'true'}}]) #No tools by default, so you have to add your own
print(response)
Tool Definition
Tools are defined by dictionaries that are added to the list tools
. These dictionaries need to contain the following fields:
Field | Type | Description |
---|---|---|
'description' | string | A description of what the tool does |
'dynamic_params' | dictionary | A dictionary containing key value pairs (paramter name : description) of the API endpointβs mutable parameters that need to be set by REBEL in order to answer a query |
'method' | string | GET or POST , whichever is the type of the API endpoint |
'url' | string | URL of the API endpoint that the given tool specifies |
'static_params' | dictionary | Any parameters that are constant between all API calls. An API key/token is an example of this |
You can add any tool you want and as many as you need. REBEL will attempt to compositionally answer a question that may require calling multiple tools.
Visit our Github Repo
Interested in learning more? Come see the code!