Metadata-Version: 2.4
Name: clu-runtime
Version: 0.7.0
Summary: CLU: adaptive AI runtime for local inference, serving, and continual-learning workflows
Author-email: SATIN Technologies <xforclistx@gmail.com>
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/RedGhost123/clu-runtime-public
Project-URL: Documentation, https://github.com/RedGhost123/clu-runtime-public#readme
Project-URL: Repository, https://github.com/RedGhost123/clu-runtime-public
Project-URL: Issues, https://github.com/RedGhost123/clu-runtime-public/issues
Keywords: ai,inference,runtime,optimization,quantization,pytorch,onnx,huggingface,acceleration,llm
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
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: Programming Language :: Python :: 3.13
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.24
Provides-Extra: ort
Requires-Dist: onnxruntime>=1.16; extra == "ort"
Provides-Extra: onnx
Requires-Dist: onnx>=1.14; extra == "onnx"
Requires-Dist: onnxruntime>=1.16; extra == "onnx"
Provides-Extra: serve
Requires-Dist: fastapi>=0.100; extra == "serve"
Requires-Dist: uvicorn>=0.23; extra == "serve"
Requires-Dist: pydantic>=2.0; extra == "serve"
Provides-Extra: gpu
Requires-Dist: pyopencl>=2023.1; extra == "gpu"
Provides-Extra: llama
Requires-Dist: llama-cpp-python>=0.2; extra == "llama"
Provides-Extra: full
Requires-Dist: onnx>=1.14; extra == "full"
Requires-Dist: onnxruntime>=1.16; extra == "full"
Requires-Dist: fastapi>=0.100; extra == "full"
Requires-Dist: uvicorn>=0.23; extra == "full"
Requires-Dist: pydantic>=2.0; extra == "full"
Requires-Dist: pyopencl>=2023.1; extra == "full"
Requires-Dist: safetensors>=0.3; extra == "full"
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: torch>=2.0; extra == "dev"
Requires-Dist: transformers>=4.30; extra == "dev"
Dynamic: license-file

# CLU Runtime

CLU (Continuous Learning Unit) is a public beta AI runtime for adaptive model
execution, local serving, quantization, hardware-aware routing, and continual
learning experiments.

```bash
pip install clu-runtime
```

```python
import clu

model = clu.optimize(model)
```

## Current Status

This repository is a beta runtime. The codebase includes working compiler,
runtime, serving, learning, and hardware-abstraction components, but public
performance claims should be treated as benchmark-specific until reproduced on
your machine.

See [PRODUCTION_READINESS.md](PRODUCTION_READINESS.md) for the current release
checklist.

## What CLU Provides

- One-line optimization entry point: `clu.optimize(model)`
- PyTorch, ONNX, and HuggingFace-oriented integration paths
- OpenAI-compatible local serving API
- KV-cache, streaming, batching, and LoRA serving scaffolds
- INT8/INT4 quantization utilities
- CPU SIMD kernels and optional native C kernels
- Intel iGPU / universal GPU abstraction layers
- Continual-learning components: EWC, replay memory, task-boundary detection,
  and forgetting metrics
- Safe fallback behavior: unsupported paths should fall back instead of taking
  over user code

## Quick Start

```python
import torch
import torch.nn as nn
import clu

model = nn.Sequential(nn.Linear(64, 128), nn.ReLU(), nn.Linear(128, 64))
model.eval()

optimized = clu.optimize(model)
output = optimized(torch.randn(1, 64))
```

## Server

```bash
clu serve --model model.onnx --port 8000
```

Optional production hardening:

```bash
set CLU_API_KEY=change-me
set CLU_RATE_LIMIT_PER_MIN=120
set CLU_CORS_ORIGINS=http://localhost:3000
clu serve --model model.onnx --port 8000
```

OpenAI-compatible client:

```python
from openai import OpenAI

client = OpenAI(base_url="http://localhost:8000/v1", api_key="change-me")
response = client.chat.completions.create(
    model="local",
    messages=[{"role": "user", "content": "Hello"}],
)
```

## Development

```bash
git clone https://github.com/RedGhost123/clu-runtime-public
cd clu-runtime-public
python -m pip install -e .[dev]
python scripts/release_audit.py
python -m pytest -q
```

## Packaging Smoke Test

```bash
python -m pip wheel . -w dist --no-deps
```

## Public Benchmark Policy

CLU includes benchmark scripts under `benchmarks/`, but speedup depends on model,
input shape, dependencies, CPU/GPU, driver, and quantization mode. Use exact raw
result files and machine details when publishing numbers.

## License

Apache License 2.0. See [LICENSE](LICENSE).
