Metadata-Version: 2.4
Name: pre-reasoning
Version: 4.0.0
Summary: 1.02M parameter pre-reasoning engine for grounding LLMs before they answer.
Author: Luis Lozano, Dr. Shannon (Mia Labs AI co-researcher), Mia Labs
License: MIT
Project-URL: Repository, https://github.com/luislozanogmia/pre-reasoning
Keywords: reasoning,llm,graph,deterministic
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
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: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: torch>=2.0.0
Requires-Dist: safetensors>=0.4.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Dynamic: license-file

# Pre-Reasoning V4

Mia Labs' Pre-Reasoning Engine V4 is a super-optimized release: it reduces the parameter requirement by 93% compared with the previous V3 engine (13.7M to 1M).

check the file loss_function_optimization.md if interested on the how.

## Usage

```python
from pre_reasoning import analyze
result = analyze("Frontend depends on API. API depends on Auth.")
print(result["trace"])
```

The bundled release checkpoint is the weights-only file `pre_reasoning/checkpoints/pre-reasoning-1m.safetensors`. Training checkpoints and optimizer state are not distributed.

## Contract

V4 retains the five-family structural output: dependencies, conflicts, requirements, conditionals, transitive closure, root blockers, and cycle detection. The deterministic harness helps with entities and preserves same V4 contract; the 1M model supplies the learned component behind that contract.

The promoted checkpoint passed the V4-compatible harness board at **3,000/3,000**, including **1,000/1,000 F1–F5 cases**.

## Layout

- `pre_reasoning/` — single public V4 package
- `pre_reasoning/checkpoints/pre-reasoning-1m.safetensors` — bundled 1M weights-only checkpoint
- `pre_reasoning/engine.py` — V4 API and harness adapter
- `pre_reasoning/inference.py` — minimal NanoChat model runtime
- `pre_reasoning/engine_core.py` — stable graph-core compatibility module
- `pre_reasoning/harness.py` — structural graph harness

No previous-engine checkpoint, training sidecar, or MoE is included (or needed) in this release tree.

## License

MIT. See `LICENSE`.
