Metadata-Version: 2.4
Name: lightchat
Version: 1.0.0
Summary: LightChat is a deterministic, secure, and production-grade runtime for controlled conversational processes.
Author: Ganesh Nalawade
Maintainer: repromptsquest
License: 
        ---
        
        ## **LICENSE (MIT)**
        
        ```text
        MIT License
        
        Copyright (c) 2026 Ganesh Nalawade
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/your-username/lightchat
Project-URL: Documentation, https://github.com/your-username/lightchat#readme
Project-URL: Source, https://github.com/your-username/lightchat
Project-URL: Issues, https://github.com/your-username/lightchat/issues
Keywords: chat,runtime,process-management,sandbox,deterministic,observability,ipc,security
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
Classifier: Topic :: System :: Monitoring
Classifier: Topic :: Security
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: psutil>=5.9.0
Provides-Extra: dev
Requires-Dist: black>=23.0; extra == "dev"
Requires-Dist: ruff>=0.0.280; extra == "dev"
Requires-Dist: mypy>=1.5; extra == "dev"
Requires-Dist: build>=1.0; extra == "dev"
Requires-Dist: twine>=4.0; extra == "dev"
Provides-Extra: docs
Requires-Dist: mkdocs>=1.5; extra == "docs"
Requires-Dist: mkdocs-material>=9.0; extra == "docs"
Dynamic: license-file

# LightChat

**LightChat** is a lightweight, high-performance runtime and orchestration framework for managing multiple local processes, including AI/LLM models. It provides safe process execution, resource monitoring, structured logging, and real-time metrics collection. Designed for developers and researchers working with multiple local models or scripts, LightChat makes managing and observing processes simple and reliable.

---

## **Features**

- Lightweight and efficient process management.
- Safe multi-process orchestration with graceful and hard termination.
- CPU, memory, and execution-time monitoring for each process.
- Structured logging with correlation IDs for easy tracing.
- Metrics collection and reporting for debugging and optimization.
- Compatible with Python 3.10+.
- Designed for testing local AI/ML/LLM models or any custom scripts safely.

---

## **Installation**

```bash
# Clone the repository
git clone https://github.com/yourusername/lightchat.git
cd lightchat

# Optional: create a virtual environment
python -m venv venv
source venv/bin/activate  # Linux/macOS
venv\Scripts\activate     # Windows

# Install requirements
pip install -r requirements.txt
Quick Start
python
Copy code
import time
from lightchat.api.runtime import Runtime
from lightchat.config.core import ConfigLoader

# Load configuration
config_loader = ConfigLoader()
config = config_loader.get()

# Initialize runtime
runtime = Runtime(config=config)

# Create a process
proc = runtime.create_process(
    name="hello_world",
    command=["python", "-c", "print('Hello, LightChat!')"]
)

# Start and wait
proc.start()
proc.wait()

# Get metrics
print(proc.metrics())
print(proc.status())
API Overview
Runtime
Create, start, and manage multiple processes.

Query all process statuses and metrics.

Stop or kill processes individually.

ProcessHandle
Represents a single process with monitoring.

Methods:

start(), stop(), kill()

wait(timeout=None) – Waits for completion.

status() – Returns current process state.

metrics() – Returns CPU, memory usage, and process state.

LightChatLogger
Structured logging with correlation IDs.

Thread and multi-process safe.

MetricsCollector
Collects CPU, memory, execution-time metrics for processes.

Useful for optimization and monitoring experiments.

Use Case
LightChat is ideal for:

Testing multiple LLM or AI models locally.

Running resource-heavy scripts with monitoring.

Debugging and profiling Python processes.

Building experimental ML pipelines safely.

Example: Running multiple small LLM models locally and observing resource consumption in real-time.

Acknowledgements
This project leverages the following Python libraries and tools:

psutil – For process and system resource monitoring.

uuid – For generating unique correlation IDs.

Python logging module – Structured logging for observability.

contextvars – Context-aware correlation IDs for multi-process logging.

Contributing
Contributions are welcome! Please fork the repository and submit a pull request.

Bug reports, performance improvements, and new features are encouraged.

Follow PEP-8 and Python 3.10+ compatibility.
