Skip to content

Commit

Permalink
chore: add pyopenagi install from pypi and locally
Browse files Browse the repository at this point in the history
  • Loading branch information
dongyuanjushi committed Jun 12, 2024
1 parent 19db5fb commit 31b66b9
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 23 deletions.
16 changes: 3 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ AIOS, a Large Language Model (LLM) Agent operating system, embeds large language
<img src="images/AIOS-Architecture.png">
</p>

The objective of AIOS is to provide the LLM kernel which will be an abstraction on top of the OS kernel. The kernel intends to facilitate the installation of agents, which are utilities the kernel can interact with in order to perform tasks the user queries. For example, the MathAgent facilitates mathematical computations, such as currency conversion, integral calculus, or even basic algebraic manipulation. The method of installation is intended to be in a manner similar to [apt](https://en.wikipedia.org/wiki/APT_(software)) or [brew](https://brew.sh).
The objective of AIOS is to provide the LLM kernel which will be an abstraction on top of the OS kernel. The kernel intends to facilitate the installation of agents, which are utilities the kernel can interact with in order to perform tasks the user queries. For example, the MathAgent facilitates mathematical computations, such as currency conversion, integral calculus, or even basic algebraic manipulation. The method of installation is intended to be in a manner similar to [apt](https://en.wikipedia.org/wiki/APT_(software)) or [brew](https://brew.sh).

At the present moment, AIOS is a userspace wrapper around the current kernel. However, this is subject to change as outlined in the [Q4 Goals and Objectives](https://github.com/agiresearch/AIOS/issues/127).

Expand All @@ -37,7 +37,7 @@ At the present moment, AIOS is a userspace wrapper around the current kernel. Ho
- [git](https://git-scm.com/downloads)
- [pip](https://pypi.org/project/pip/)

At the minimum, we recommend a Nvidia GPU with 4 GB of memory or an ARM based Macbook. It should be able to run on machines with inferior hardware, but task completion time will increase greatly. If you notice a large delay in execution, you can try to use an API based model, such as gpt (paid) or gemini (free).
At the minimum, we recommend a Nvidia GPU with 4 GB of memory or an ARM based Macbook. It should be able to run on machines with inferior hardware, but task completion time will increase greatly. If you notice a large delay in execution, you can try to use an API based model, such as gpt (paid) or gemini (free).

### 3.2 Installation
To run AIOS, you will need to install our agent creation package, [OpenAGI](https://github.com/agiresearch/OpenAGI).
Expand All @@ -63,16 +63,6 @@ chmod +x venv/bin/activate
. venv/bin/activate
pip install -r requirements.txt
```
**Allow your code to be able to see 'openagi'**
```bash
cd ../OpenAGI
pip install -e .
```

OpenAGI is **now on PyPi**, and can be installed easily with the following:
```bash
pip install pyopenagi
```

### 3.3 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
Expand Down Expand Up @@ -154,7 +144,7 @@ print agent
A `run` command will **not output** to the standard output. Instead, it will create a log file.
#### (3) Evaluation Mode
In the evaluation mode, we draw prompts for each agent from `agent_configs/` and evaluate the performance of the agents by allowing the user to specify which agents should be run.
In the evaluation mode, we draw prompts for each agent from `agent_configs/` and evaluate the performance of the agents by allowing the user to specify which agents should be run.
Additionally, you can evaluate the acceleration performance with or without AIOS by comparing the waiting time and turnaround time.
Expand Down
7 changes: 3 additions & 4 deletions eval.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is used to evaluate the configuration passed through arguments to the simulation of the kernel
# This file is used to evaluate the configuration passed through arguments to the simulation of the kernel

import os
import sys
Expand All @@ -8,9 +8,9 @@

from src.scheduler.rr_scheduler import RRScheduler

from openagi.src.agents.agent_factory import AgentFactory
from pyopenagi.src.agents.agent_factory import AgentFactory

from openagi.src.agents.agent_process import AgentProcessFactory
from pyopenagi.src.agents.agent_process import AgentProcessFactory

import warnings

Expand All @@ -22,7 +22,6 @@

from src.utils.utils import delete_directories
from src.utils.calculator import get_numbers_concurrent, get_numbers_sequential, comparison
from src.utils

import argparse

Expand Down
6 changes: 3 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This is a main script that tests the functionality of specific agents.
# This is a main script that tests the functionality of specific agents.
# It requires no user input.

import os
Expand All @@ -13,9 +13,9 @@
parse_global_args,
)

from openagi.src.agents.agent_factory import AgentFactory
from pyopenagi.src.agents.agent_factory import AgentFactory

from openagi.src.agents.agent_process import AgentProcessFactory
from pyopenagi.src.agents.agent_process import AgentProcessFactory

import warnings

Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ llama_index==0.10.39
llama_index.embeddings.huggingface==0.2.0
llama-index-vector-stores-chroma==0.1.8
chromadb==0.5.0
pyopenagi==0.0.3
6 changes: 3 additions & 3 deletions simulator.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This simulates AIOS as an LLM kernel, although it is only acting as a userspace
# wrapper in this script.
# wrapper in this script.

import os
import sys
Expand All @@ -22,9 +22,9 @@
parse_global_args,
)

from openagi.src.agents.agent_factory import AgentFactory
from pyopenagi.src.agents.agent_factory import AgentFactory

from openagi.src.agents.agent_process import AgentProcessFactory
from pyopenagi.src.agents.agent_process import AgentProcessFactory

import warnings

Expand Down

0 comments on commit 31b66b9

Please sign in to comment.