Thank you for your interest in AIOS! Here's a guide to help you contribute to this project.
At first, you need to fork this copy and create your own version of repo.
pip install -r requirements.txt
We strongly recommend installing pre-commit to ensure proper formatting during development
Create a new branch for developing your creative features
git checkout -b your-feature
You can develop new features and then you need to make sure everything works as expected. Run our provided tests and make sure the existing ones go well. Your new tests are encouraged.
Add your test code into the tests/
directory if any, then run test via pytest
pytest -v tests/
============================================================================================================================= test session starts ==============================================================================================================================
platform darwin -- Python 3.11.9, pytest-8.1.1, pluggy-1.5.0 -- ""
cachedir: .pytest_cache
rootdir: ""
plugins: anyio-4.3.0
collected 7 items
tests/test_llms.py::test_closed_llm PASSED [ 14%]
tests/test_llms.py::test_open_llm PASSED [ 28%]
tests/test_lru_k_replacer.py::test_update_access_history PASSED [ 42%]
tests/test_lru_k_replacer.py::test_evict PASSED [ 57%]
tests/test_lru_k_replacer.py::test_set_evictable PASSED [ 71%]
tests/test_lru_k_replacer.py::test_invalid_block_id PASSED [ 85%]
tests/test_memory.py::test_mem_alloc PASSED
Please ensure your code is formatted correctly using pre-commit
We strongly recommend your git commit follows the format below
git commit -m <type>: <subject>
feat |
Add new features |
fix |
Fix bugs |
docs |
Modify documents like README, CONTRIBUTE |
style |
Modify code format like space and comma without changing code logic |
refactor |
Refactor code structure without adding new features or fixing new bugs |
perf |
Improve performance or user experience |
test |
Test features, including unit test and integration test |
chore |
Change the build procedure or add dependencies |
revert |
Revert to the previous version |
- Visit your forked AIOS repository on GitHub and click the "Compare & pull request" button to initiate the process of submitting your changes to the original repository for review and potential merging.
- Choose the base branch and the compare branch (your feature branch).💡 Note that when you add new features, it is recommended to choose the (
dev
) branch and if your change does not affect original functions, you may consider choosing the (main
) branch. - Write a title and describe your changes in the description. And it is recommended to select the label of the change to make it more clear.
This is the style guide determining how code should be formatted. As more code is added, this documentation will be updated.
Each line should not exceed 80 characters.
Each function or class is to have a space between the line and any preceding code if it is not directly associated with the function or class. For example:
# this is a useful comment for the bar function
def foo():
pass
Each directory is required to describe the purpose of the directory and each file in the directory in README.md. Each file is required to have a header describing the purpose at the top. For example:
# This file has helpful math functions that we will use in the foo module in
# AIOS
def add(a, b):
return a + b
def subtract(a, b):
return a - b
Any comments for imports should be preceded by a #
as well. Spaces should be applied as necessary.
Each function is required to have a comment right under the header which describes what it does, unless the function encompasses few lines. For example:
def foo():
"""This function does something"""
pass
The same applies to classes:
class Bar:
"""This class does something"""
def baz(self):
"""This function does something"""
pass
pass
Lines that are to be commented out can be marked with #
. For example:
# def foo():
# """This function does something"""
# pass
It is not recommended to comment out lines, but if you must make sure that the purpose is understood by the reader.
Any comments for a specific line are additionally to be marked with #
:
a = 1
b = 3
c = a + b # This adds a and b and stores the result in c
A comment describing multiple lines in a particular function can be represented by #
as well.
Our maintainers will have a review of that and might give some suggestions or ask for more details. After they approve, your commitment can be incorporated into AIOS!
If you need some ideas on what to get started with, take a look at our goals for the rest of this year in issues.