Metadata-Version: 2.4
Name: piddi-os
Version: 0.1.0
Summary: Deterministic, explainable context optimization for LLM applications.
Keywords: llm,genai,prompt,context,ai,token,context-engine,context-optimization
Author: Keshav Chaudhary
Author-email: Keshav Chaudhary <keshav.chaudhary180397@outlook.com>
License-Expression: MIT
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Classifier: Topic :: Software Development :: Libraries
Requires-Dist: networkx>=3.6.1
Requires-Dist: pydantic>=2.13.4
Requires-Dist: rich>=15.0.0
Requires-Dist: tiktoken>=0.13.0
Requires-Python: >=3.11
Project-URL: Homepage, https://github.com/keshav-labs/contextos
Project-URL: Repository, https://github.com/keshav-labs/contextos
Project-URL: Documentation, https://github.com/keshav-labs/contextos#readme
Project-URL: Issues, https://github.com/keshav-labs/contextos/issues
Description-Content-Type: text/markdown

# ContextOS



ContextOS — The right context. Every time.

ContextOS is an opinionated, open-source Python library for Context Engineering: building, selecting, and preparing high-quality context to include in prompts for Large Language Models (LLMs). It is model-agnostic and designed to work with hosted and local models.

Current release: v0.1.0

## Highlights

- Opinionated pipeline for deterministic context selection
- Budget-aware token estimation and context trimming
- Pluggable ranking and optimization stages
- Strong type coverage (py.typed) and CI-tested code

## Installation

Install the latest release from PyPI:

```bash
pip install piddi-os
```
Import the library:

```python
from contextos import ContextEngine
```


## Quick Start

```python
from contextos import ContextEngine

engine = ContextEngine()
engine.add_text("Angular introduced Signals.")
engine.add_text("React introduced Hooks.")

prompt = engine.build(query="Explain Angular Signals", max_tokens=500)
print(prompt)
```

## Features

- ContextEngine: simple, composable public API
- ContextStore: in-memory context management
- Pipeline stages: ranking, budgeting, optimization
- Token estimation and budget enforcement
- Explainable optimization and tracing

## Examples & Docs

See the `examples/` directory and the `docs/` folder for usage patterns, architecture notes, and recipes.

## License

This project is licensed under the MIT License. See the `LICENSE` file for details.

## Maintainers

Maintained by the Keshav Labs.

