Agent API

Run the Agent

To test your agent, use the run-agent command:

run-agent \
--llm_name <llm_name> \
--llm_backend <llm_backend> \
--agent_name_or_path <agent_name_or_path> \
--local_agent <yes/no> \
--task <task_input> \
--aios_kernel_url <aios_kernel_url>

Parameters

  • <llm_name>: The name of the language model you want to use

  • <llm_backend>: The backend service for the language model

  • <agent_name_or_path>:

    • For hub agents: The path to your agent's folder

    • For local agents: Absolute path to agent folder

  • <local_agent>: Use local agent? Default is no (yes/no)

  • <task_input>: The task you want your agent to complete

  • <aios_kernel_url>: The URL that is connected to the AIOS kernel

Examples

Run a hub agent:

run-agent \
--llm_name gpt-4 \
--llm_backend openai \
--agent_name_or_path demo_author/demo_agent \
--local_agent no \
--task "Your task here" \
--aios_kernel_url http://localhost:8000

Run a local agent:

run-agent \
--llm_name gpt-4 \
--llm_backend openai \
--agent_name_or_path /absolute/path/to/local/agent \
--local_agent yes \
--task "Your task here" \
--aios_kernel_url http://localhost:8000

Using the source code:

You can also run the agent using the source code in the cerebrum/example/run_agent:

python cerebrum/example/run_agent.py \
--llm_name <llm_name> \
--llm_backend <llm_backend> \
--agent_name_or_path <agent_name_or_path> \
--local_agent <yes/no> \
--task <task_input> \
--aios_kernel_url <aios_kernel_url>

Last updated