Skip to main content

A customizable Ossarth AI-powered open-source operating system toolkit

Project description

Ossarth

AI-Powered Open-Source OS Customization Framework

An AI-driven framework for customizing Ossarth OS by dynamically creating and integrating custom tools & helper functions.


Ossarth Banner

What is Ossarth?

Ossarth is an AI-powered customization framework designed exclusively for Ossarth OS. It allows users to extend their OS functionality dynamically by creating custom AI tools and general-purpose functions.

With Ossarth, users can:
Modify and enhance their OS in real-time.
Define and integrate LangChain-compatible AI tools.
Create automation scripts and system utilities.
Customize system monitoring and OS-level functionalities.
Run a Flask-based AI-powered backend for managing custom tools.


Features

  • AI-driven OS customization with dynamic tool creation.
  • Create and integrate LangChain-compatible AI tools.
  • Automate system tasks with helper functions.
  • Predefined templates for structured function generation.
  • Dynamic module generation for scalable OS enhancements.
  • Designed specifically for Ossarth OS.

Installation

To install Ossarth, use PyPI:

pip install ossarth

Or install the latest version from GitHub:

pip install git+https://github.com/Siddharth-magesh/Ossarth.git

Quick Start

1. Import the Module

from ossarth.tool_manager import ToolManager

2. Initialize the Tool Manager

manager = ToolManager()

3. Create a Custom AI Tool

manager.create_custom_tool(
    func_name="get_disk_usage",
    description="Retrieves disk usage statistics.",
    params="",
    args_doc="None",
    return_type="dict",
    return_desc="A dictionary with total, used, and free disk space in GB.",
    body="""
import shutil
path = "/"
total, used, free = shutil.disk_usage(path)
gb = 1024 * 1024 * 1024
return {
    "total": f"{total / gb:.2f} GB",
    "used": f"{used / gb:.2f} GB",
    "free": f"{free / gb:.2f} GB"
}
""",
    result_dir="custom_os_functions"
)

This will generate a Python file custom_os_functions/get_disk_usage.py, allowing Ossarth OS to retrieve disk usage dynamically.


Creating a Helper Function

manager.create_custom_function(
    func_name="calculate_cpu_load",
    description="Calculates the average CPU load over a given interval.",
    params="interval: int",
    args_doc="interval (int): The time interval for calculating CPU load.",
    return_type="float",
    return_desc="The average CPU load percentage.",
    body="""
import psutil
return psutil.cpu_percent(interval=interval)
""",
    result_dir="custom_helpers"
)

This will generate custom_helpers/calculate_cpu_load.py, a general Python function to monitor CPU load.


Folder Structure

After defining tools and functions, your directory structure will look like this:

Ossarth/
│── custom_os_functions/
│   ├── get_disk_usage.py  # AI Tool for OS customization
│── custom_helpers/
│   ├── calculate_cpu_load.py  # General function
│── ossarth/
│   ├── tool_manager.py    # Core logic for tool management
│   ├── templates/
│   │   ├── general_template.py
│── README.md
│── setup.py
│── requirements.txt

Advanced Usage

Adding Multiple Functions in a Single File

To append new functions to an existing file instead of creating a new one:

manager.create_custom_tool(
    func_name="get_memory_usage",
    description="Retrieves system memory usage statistics.",
    params="",
    args_doc="None",
    return_type="dict",
    return_desc="A dictionary with total, used, and available memory in GB.",
    body="""
import psutil
mem = psutil.virtual_memory()
gb = 1024 * 1024 * 1024
return {
    "total": f"{mem.total / gb:.2f} GB",
    "used": f"{mem.used / gb:.2f} GB",
    "available": f"{mem.available / gb:.2f} GB"
}
""",
    result_dir="custom_os_functions",
    filename="system_monitoring.py"
)

This will add get_memory_usage to system_monitoring.py instead of creating a new file.


Testing the Ossarth Module

Use the following test cases to verify that Ossarth is correctly generating tools and functions:

from ossarth.tool_manager import CustomFunctionManager

manager = CustomFunctionManager(result_dir="tests")

# Test AI tool creation
manager.create_custom_tool(
    func_name="test_tool",
    description="A test tool function.",
    params="param1: int, param2: str",
    args_doc="param1 (int): An integer.\nparam2 (str): A string.",
    return_type="str",
    return_desc="A formatted string.",
    body="return f'Test tool with {param1} and {param2}'",
    filename="new"
)

# Test helper function creation
manager.create_custom_function(
    func_name="test_function",
    description="A test helper function.",
    params="x: int, y: int",
    args_doc="x (int): First number.\ny (int): Second number.",
    return_type="int",
    return_desc="Sum of x and y.",
    body="return x + y",
    filename="new"
)

These tests will ensure that Ossarth is correctly generating AI tools and helper functions for the OS.


License

Ossarth is licensed under the MIT License. You are free to modify and distribute it.


Contributing

We welcome contributions!

To contribute:

  1. Fork the repository.
  2. Make your changes in a new branch.
  3. Submit a pull request.

Contact & Support

For any questions or support:
📧 Email: siddharthmagesh007@gmail.com
🐙 GitHub: Siddharth-magesh


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ossarth-0.1.1.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Ossarth-0.1.1-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file ossarth-0.1.1.tar.gz.

File metadata

  • Download URL: ossarth-0.1.1.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for ossarth-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2aa6facc67bd93ceaaba32f8e7ffd1b8959ece5bbe0d22e470ff81fc787aef08
MD5 c28518e5825679b4dd4978714040619d
BLAKE2b-256 92c85e366b5e34024e45c31e0765dfcc60f04297ae6ff116e7be047b05719c02

See more details on using hashes here.

File details

Details for the file Ossarth-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: Ossarth-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for Ossarth-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d88a6526b7af795e87c7ce56b034b73b21794bd48fdc221e17a6c4025b5a759b
MD5 b53717f94d6202062127f2e357d48bf1
BLAKE2b-256 c957c0baee6c2a07704c2da1e2cc7654e2b781b3fad9d93ffdbe4abd94a1417f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page