Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update readme and add bash scripts #97

Merged
merged 1 commit into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
logs/
.idea/
.DS_Store
.ipynb_checkpoints
__pycache__
src/storage/*.json
Expand Down
63 changes: 43 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@
AIOS, a Large Language Model (LLM) Agent operating system, embeds large language model into Operating Systems (OS) as the brain of the OS, enabling an operating system "with soul" -- an important step towards AGI. AIOS is designed to optimize resource allocation, facilitate context switch across agents, enable concurrent execution of agents, provide tool service for agents, maintain access control for agents, and provide a rich set of toolkits for LLM Agent developers.


## 🏠 Architecture of AIOS
## 🏠 1. Architecture of AIOS
<p align="center">
<img src="images/AIOS-Architecture.png">
</p>


## 📰 News
## 📰 2. News
- **[2024-04-14]** 🚀 AIOS currently supports generation interrupt (for open-sourced llms) and customized console loggers. Feel free to try!
- **[2024-04-05]** 🛠️ AIOS codebase has been updated to add shell simulator, rapid API calls, and pre-commit test cases. Please see [CONTRIBUTE](https://github.com/agiresearch/AIOS/blob/main/CONTRIBUTE.md) for how to test your contributions and create pull requests.
- **[2024-04-02]** 🌟 AIOS [Discord Community](https://discord.gg/B2HFxEgTJX) is up. Welcome to join the community for discussions, brainstorming, development, or just random chats!
- **[2024-03-25]** ✈️ Our paper [AIOS: LLM Agent Operating System](https://arxiv.org/abs/2403.16971) is released and AIOS repository is officially launched!
- **[2023-12-06]** 📋 After several months of working, our perspective paper [LLM as OS, Agents as Apps: Envisioning AIOS, Agents and the AIOS-Agent Ecosystem](https://arxiv.org/abs/2312.03815) is officially released.


## ✈️ Getting Started
## ✈️ 3. Getting Started

### Installation
### 3.1 Installation
To run AIOS, you will need to install our agent creation package, OpenAGI.
**Git clone AIOS and OpenAGI**
```bash
Expand All @@ -45,7 +45,7 @@ cd ../OpenAGI
pip install -e .
```

### Usage
### 3.2 Usage
If you use open-sourced models from huggingface, you need to setup your [Hugging Face token](https://huggingface.co/settings/tokens) and cache directory
```bash
export HUGGING_FACE_HUB_TOKEN=<YOUR READ TOKEN>
Expand All @@ -57,9 +57,9 @@ export OPENAI_API_KEY=<YOUR OPENAI API KEY>
export GEMINI_API_KEY=<YOUR GEMINI API KEY>
```

Here we provide two modes to run the AIOS: interactive mode and deployment mode
#### Interactive Mode
In the interactive mode, you can interact with AIOS to see the output of each step in running multiple agents
Here we provide two modes to run the AIOS: interactive mode
#### (1) Demonstration Mode
In the demonstration mode, we provide a toy example: we hardcode three agents and allow you to change the parameters. Then you can see the output of each step in running multiple agents
For open-sourced LLMs, you need to setup the name of the LLM you would like to use the max gpu memory, the evaluation device and the maximum length of generated new tokens.
```python
# For open-sourced LLMs
Expand All @@ -74,8 +74,11 @@ python main.py --llm_name <llm_name>
## Use gpt-4 for example
python main.py --llm_name gpt-4
```

#### Deployment Mode
You can use bash script to start the agent execution like this
```bash
bash scripts/run/gpt4.sh
````
#### (2) Interactive Mode
In the deployment mode, the outputs of running agents are stored in files. And in this mode, you are provided with multiple commands to run agents and see resource usage of agents (e.g., run \<xxxAgent\>: \<YOUR TASK\>, print agent).
Different from the interactive mode, you need to set all the default loggers as file loggers.
```python
Expand All @@ -90,7 +93,27 @@ python simulator.py --llm_name <llm_name> --scheduler_log_mode file --agent_log_
## Use gpt-4 for example
python simulator.py --llm_name gpt-4 --scheduler_log_mode file --agent_log_mode file --llm_kernel_log_mode file
```
#### Supported LLM backbones
You can use bash script to start the interactive simulation session like this
```bash
bash scripts/interactive/gpt4.sh
````
sample command
```bash
run NarrativeAgent: Craft a tale about a valiant warrior on a quest to uncover priceless treasures hidden within a mystical island.
print agent
```

#### (3) Evaluation Mode
In the evaluation mode, we allow you to configure different types of predefined agents (MathAgent, NarrativeAgent, RecAgent) with a configurable number of agents for each type. Additionally, you can evaluate the acceleration performance with or without AIOS by comparing the waiting time and turnaround time.
```python
python eval.py --llm_name gpt-4 --agents MathAgent:10,NarrativeAgent:5,RecAgent:3
```
You can use bash script to start the agent execution like this
```bash
bash scripts/eval/gpt4.sh
````

### 3.3 Supported LLM backbones
| LLM Name | Open-sourced | Corporation |
|-------------|--------------------------------------------------|----------|
| gemma-2b-it | Yes | Google |
Expand All @@ -104,7 +127,7 @@ python simulator.py --llm_name gpt-4 --scheduler_log_mode file --agent_log_mode
| gpt-3.5-turbo | No | OpenAI |
| gpt-4 | No | OpenAI |

## 🖋️ References
## 🖋️ 4. References
```
@article{mei2024aios,
title={AIOS: LLM Agent Operating System},
Expand All @@ -120,22 +143,22 @@ python simulator.py --llm_name gpt-4 --scheduler_log_mode file --agent_log_mode
}
```

## 🚀 Contributions
## 🚀 5. Contributions
AIOS is dedicated to facilitating LLM agents' development and deployment in a systematic way, collaborators and contributions are always welcome to foster a cohesive, effective and efficient AIOS-Agent ecosystem!

For detailed information on how to contribute, see [CONTRIBUTE](https://github.com/agiresearch/AIOS/blob/main/CONTRIBUTE.md). If you would like to contribute to the codebase, [issues](https://github.com/agiresearch/AIOS/issues) or [pull requests](https://github.com/agiresearch/AIOS/pulls) are always welcome!

## 🌟 Discord Channel
If you would like to join the community, ask questions, chat with fellows, learn about or propose new features, and participate in future developments, join our [Discord Community](https://discord.gg/B2HFxEgTJX)!
## 🌍 6. AIOS Contributors
[![AIOS contributors](https://contrib.rocks/image?repo=agiresearch/AIOS&max=300)](https://github.com/agiresearch/AIOS/graphs/contributors)

## 📪 Contact

For issues related to AIOS development, we encourage submitting [issues](https://github.com/agiresearch/AIOS/issues), [pull requests](https://github.com/agiresearch/AIOS/pulls), or initiating discussions in the AIOS [Discord Channel](https://discord.gg/B2HFxEgTJX). For other issues please feel free to contact Kai Mei (marknju2018@gmail.com) and Yongfeng Zhang (yongfeng@email.com).
## 🌟 7. Discord Channel
If you would like to join the community, ask questions, chat with fellows, learn about or propose new features, and participate in future developments, join our [Discord Community](https://discord.gg/B2HFxEgTJX)!

## 🌍 AIOS Contributors
[![AIOS contributors](https://contrib.rocks/image?repo=agiresearch/AIOS&max=300)](https://github.com/agiresearch/AIOS/graphs/contributors)
## 📪 8. Contact

For issues related to AIOS development, we encourage submitting [issues](https://github.com/agiresearch/AIOS/issues), [pull requests](https://github.com/agiresearch/AIOS/pulls), or initiating discussions in the AIOS [Discord Channel](https://discord.gg/B2HFxEgTJX). For other issues please feel free to contact Kai Mei (marknju2018@gmail.com) and Yongfeng Zhang (yongfeng@email.com).

## Star History
## 9. Star History

[![Star History Chart](https://api.star-history.com/svg?repos=agiresearch/AIOS&type=Date)](https://star-history.com/#agiresearch/AIOS&Date)
File renamed without changes.
Empty file removed scripts/__init__.py
Empty file.
1 change: 1 addition & 0 deletions scripts/eval/gpt4.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python eval.py --llm_name gpt-4 --agents MathAgent:10,NarrativeAgent:5,RecAgent:3
1 change: 1 addition & 0 deletions scripts/interactive/gpt4.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python simulator.py --llm_name gpt-4 --scheduler_log_mode file --agent_log_mode file --llm_kernel_log_mode file
1 change: 1 addition & 0 deletions scripts/run/gpt4.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python main.py --llm_name gpt-4