GitHub - agiresearch/AIOS: AIOS: AI Agent Operating System (original) (raw)

Gurubase

agiresearch%2FAIOS | Trendshift Sponsor

AIOS is the AI Agent Operating System, which embeds large language model (LLM) into the operating system and facilitates the development and deployment of LLM-based AI Agents. AIOS is designed to address problems (e.g., scheduling, context switch, memory management, storage management, tool management, Agent SDK management, etc.) during the development and deployment of LLM-based agents, towards a better AIOS-Agent ecosystem for agent developers and agent users. AIOS includes the AIOS Kernel (this AIOS repository) and the AIOS SDK (the Cerebrum repository). AIOS supports both Web UI and Terminal UI.

🏠 Architecture of AIOS

Overview

The AIOS system is comprised of two key components: the AIOS kernel and the AIOS SDK. The AIOS kernel acts as an abstraction layer over the operating system kernel, managing various resources that agents require, such as LLM, memory, storage and tool. The AIOS SDK is designed for agent users and developers, enabling them to build and run agent applications by interacting with the AIOS kernel. AIOS kernel is the current repository and AIOS SDK can be found at here

Modules and Connections

Below shows how agents utilize AIOS SDK to interact with AIOS kernel and how AIOS kernel receives agent queries and leverage the chain of syscalls that are scheduled and dispatched to run in different modules.

Computer-use Specialized Architecture

For computer-use agent, the architecture extends the AIOS Kernel with significant enhancements focused on computer contextualization. While preserving essential components like LLM Core(s), Context Manager, and Memory Manager, the Tool Manager module has been fundamentally redesigned to incorporate a VM (Virtual Machine) Controller and MCP Server. This redesign creates a sandboxed environment that allows agents to safely interact with computer systems while maintaining a consistent semantic mapping between agent intentions and computer operations.

📰 News

Different deployment modes of AIOS

Here are some key notations that are required to know before introducing the different modes of AIOS.

The following parts introduce different modes of deploying AIOS. Currently, AIOS already supports Mode 1 and Mode 2, other modes with new features are still ongoing.

Mode 1 (Local Kernel Mode)

Mode 2 (Remote Kernel Mode)

Mode 2.5 (Remote Kernel Dev Mode)

Mode 3 (Personal Remote Kernel Mode)

Mode 4 (Personal Remote Virtual Kernel Mode)

✈️ Getting Started

Please see our ongoing documentation for more information.

Installation

Requirements

Python

Installation from source

Step 1: Install AIOS Kernel

Git clone AIOS kernel

git clone https://github.com/agiresearch/AIOS.git

Create venv environment

python3.x -m venv venv # Only support for Python 3.10 and 3.11 source venv/bin/activate

or create conda environment

conda create -n venv python=3.x # Only support for Python 3.10 and 3.11 conda activate venv

Tip

We strongly recommend using uv for faster and more reliable package installation. To install uv:bash pip install uv

For GPU environments:

uv pip install -r requirements-cuda.txt

For CPU-only environments:

uv pip install -r requirements.txt

Alternatively, if you prefer using pip:

For GPU environments:

pip install -r requirements-cuda.txt

For CPU-only environments:

pip install -r requirements.txt

Step 2: Install AIOS SDK (Cerebrum)

  1. Clone the Cerebrum repository:
    git clone https://github.com/agiresearch/Cerebrum.git
  2. Install using uv (recommended):
    cd Cerebrum && uv pip install -e .
    Or using pip:
    cd Cerebrum && pip install -e .
Step 3: Install Virtualized Environment (Optional)

To use the mcp for computer-use agent, we strongly recommend you install a virtualized environment equipped with GUI. Instructions can be found in here.

Note: The machine where the AIOS kernel (AIOS) is installed must also have the AIOS SDK (Cerebrum) installed. Installing AIOS kernel will install the AIOS SDK automatically by default. If you are using the Local Kernel mode, i.e., you are running AIOS and agents on the same machine, then simply install both AIOS and Cerebrum on that machine. If you are using Remote Kernel mode, i.e., running AIOS on Machine 1 and running agents on Machine 2 and the agents remotely interact with the kernel, then you need to install both AIOS kernel and AIOS SDK on Machine 1, and install the AIOS SDK alone on Machine 2. Please follow the guidelines at Cerebrum regarding how to install the SDK.

Quickstart

Before launching AIOS, it is required to set up configurations. AIOS provides two ways of setting up configurations, one is to set up by directly modifying the configuration file, another is to set up interactively.

You need API keys for services like OpenAI, Anthropic, Groq and HuggingFace. The simplest way to configure them is to edit the aios/config/config.yaml.

Tip

It is important to mention that, we strongly recommend using the aios/config/config.yaml file to set up your API keys. This method is straightforward and helps avoid potential sychronization issues with environment variables.

A simple example to set up your API keys in aios/config/config.yaml is shown below:

api_keys: openai: "your-openai-key"
gemini: "your-gemini-key"
groq: "your-groq-key"
anthropic: "your-anthropic-key" huggingface: auth_token: "your-huggingface-token-for-authorized-models"
cache_dir: "your-cache-dir-for-saving-models" novita: "your-novita-api-key"

To obtain these API keys:

  1. Deepseek API: Visit https://api-docs.deepseek.com/
  2. OpenAI API: Visit https://platform.openai.com/api-keys
  3. Google Gemini API: Visit https://makersuite.google.com/app/apikey
  4. Groq API: Visit https://console.groq.com/keys
  5. HuggingFace Token: Visit https://huggingface.co/settings/tokens
  6. Anthropic API: Visit https://console.anthropic.com/keys
  7. Novita AI API: Visit https://novita.ai/api-keys

Configure LLM Models

You can configure which LLM models to use in the same aios/config/config.yaml file. Here's an example configuration:

llms: models: # Ollama Models - name: "qwen2.5:7b" backend: "ollama" hostname: "http://localhost:11434" # Make sure to run ollama server

# vLLM Models
- name: "meta-llama/Llama-3.1-8B-Instruct"
  backend: "vllm"
  hostname: "http://localhost:8091/v1"  # Make sure to run vllm server

Using Ollama Models:

  1. First, download ollama from https://ollama.com/
  2. Start the ollama server in a separate terminal:
  3. Pull your desired models from https://ollama.com/library:

ollama pull qwen2.5:7b # example model

Tip

Ollama supports both CPU-only and GPU environments. For more details about ollama usage, visit ollama documentation

Using vLLM Models:

  1. Install vLLM following their installation guide
  2. Start the vLLM server in a separate terminal:

vllm serve meta-llama/Llama-3.1-8B-Instruct --port 8091

**Using HuggingFace Models:**You can configure HuggingFace models with specific GPU memory allocation:

Set up interactively

Alternatively, you can set up aios configurations interactively by using the following command.

When no environment variables are set, the following API keys will be shown:

Launch AIOS

After you setup your keys or environment parameters, then you can follow the instructions below to start.

Run:

bash runtime/launch_kernel.sh

Or if you need to explicity set the Python version by running python3.10, python3.11, python3, etc. run the command below:

python3.x -m uvicorn runtime.launch:app --host 0.0.0.0 --port 8000 # replace the port with your own port

You also need to set up the host and port in the configuration of Cerebrum (AIOS SDK) to make sure it is consistent with the configurations of AIOS.

You can also force the kernel to run in the background with:

python3.x -m uvicorn runtime.launch:app --host 0.0.0.0 > uvicorn.log 2>&1 &

And you can run it even after the shell closes by typing nohup before the entire command.

Command to launch the kernel in the background so it continues running even after the active shell is closed, while also logging information to the specified log file (recommended):

nohup python3 -m uvicorn runtime.launch:app --host 0.0.0.0 --port 8000 > uvicorn.log 2>&1 &

Interact with AIOS terminal

To interact with the AIOS terminal (LLM-based semantic file system), you can run the following command to start the AIOS terminal.

python scripts/run_terminal.py

Then you can start interacting with the AIOS terminal by typing natural language commands.

If you successfully start the AIOS terminal, it will be shown as below:

Detailed instructions of how to use the AIOS terminal can be found at here

Warning

The rollback feature of the AIOS terminal requires the connection to the redis server. Make sure you have the redis server running if you would like to use the rollback feature.

Run computer-use Agent

Make sure you have installed a virtualized environment with GUI, then you can refer to Cerebrum for how to run the computer-use agent.

Supported Agent Frameworks

Supported LLM Cores

Provider 🏢 Model Name 🤖 Open Source 🔓 Model String ⌨️ Backend ⚙️ Required API Key
Anthropic All Models model-name anthropic ANTHROPIC_API_KEY
OpenAI All Models model-name openai OPENAI_API_KEY
Deepseek All Models model-name deepseek DEEPSEEK_API_KEY
Google All Models model-name gemini GEMINI_API_KEY
Groq All Models model-name groq GROQ_API_KEY
HuggingFace All Models model-name huggingface HF_HOME
ollama All Models model-name ollama -
vLLM All Models model-name vllm -
Novita All Models model-name novita NOVITA_API_KEY

🔧 Experimental Rust Rewrite (aios-rs)

An early experimental Rust scaffold lives in aios-rs/ providing trait definitions and minimal placeholder implementations (context, memory, storage, tool, scheduler, llm). This is NOT feature-parity yet; it's a foundation for incremental porting and performance-focused components.

Try It

cd aios-rs cargo build cargo test

Example (Echo LLM + Noop Scheduler)

use aios_rs::prelude::*;

fn main() -> anyhow::Result<()> { let llm = std::sync::Arc::new(EchoLLM); let memory = std::sync::Arc::new(std::sync::Mutex::new(InMemoryMemoryManager::new())); let storage = std::sync::Arc::new(FsStorageManager::new("/tmp/aios_store")); let tool = std::sync::Arc::new(NoopToolManager); let mut scheduler = NoopScheduler::new(llm, memory, storage, tool); scheduler.start()?; scheduler.stop()?; Ok(()) }

Reference

@article{mei2025aios,
  title={AIOS: LLM Agent Operating System},
  author={Mei, Kai and Zhu, Xi and Xu, Wujiang and Hua, Wenyue and Jin, Mingyu and Li, Zelong and Xu, Shuyuan and Ye, Ruosong and Ge, Yingqiang and Zhang, Yongfeng}
  journal={In Proceedings of the 2nd Conference on Language Modeling (COLM 2025)},
  year={2025}
}
@article{mei2025litecua,
  title={LiteCUA: Computer as MCP Server for Computer-Use Agent on AIOS},
  author={Mei, Kai and Zhu, Xi and Gao, Hang and Lin, Shuhang and Zhang, Yongfeng},
  journal={arXiv preprint arXiv:2505.18829},
  year={2025}
}
@article{xu2025mem,
  title={A-Mem: Agentic Memory for LLM Agents},
  author={Xu, Wujiang and Liang, Zujie and Mei, Kai and Gao, Hang and Tan, Juntao and Zhang, Yongfeng},
  journal={arXiv:2502.12110},
  year={2025}
}
@inproceedings{rama2025cerebrum,
  title={Cerebrum (AIOS SDK): A Platform for Agent Development, Deployment, Distribution, and Discovery}, 
  author={Balaji Rama and Kai Mei and Yongfeng Zhang},
  booktitle={2025 Annual Conference of the Nations of the Americas Chapter of the Association for Computational Linguistics},
  year={2025}
}
@inproceedings{shi2025from,
  title={From Commands to Prompts: {LLM}-based Semantic File System for AIOS},
  author={Zeru Shi and Kai Mei and Mingyu Jin and Yongye Su and Chaoji Zuo and Wenyue Hua and Wujiang Xu and Yujie Ren and Zirui Liu and Mengnan Du and Dong Deng and Yongfeng Zhang},
  booktitle={The Thirteenth International Conference on Learning Representations},
  year={2025},
  url={https://openreview.net/forum?id=2G021ZqUEZ}
}
@article{ge2023llm,
  title={LLM as OS, Agents as Apps: Envisioning AIOS, Agents and the AIOS-Agent Ecosystem},
  author={Ge, Yingqiang and Ren, Yujie and Hua, Wenyue and Xu, Shuyuan and Tan, Juntao and Zhang, Yongfeng},
  journal={arXiv:2312.03815},
  year={2023}
}

🚀 Contributions

For how to contribute, see CONTRIBUTE. If you would like to contribute to the codebase, issues or pull requests are always welcome!

🌍 AIOS Contributors

AIOS contributors

Acknowledgement

We learned the design and reused code from the following projects: LiteLLM, OSWorld.

🤝 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!