Metadata-Version: 2.4
Name: znyx-inference
Version: 1.0.0
Summary: Znyx inference sidecar: an optional HTTP service that serves ML models for model-backed guardrail detection. Boots dependency-free on a stub runner; add the [onnx] extra to serve real weights on CPU.
Author: Zitrino
License: Apache-2.0
Project-URL: Homepage, https://github.com/zitrino-oss/znyx-runtime
Project-URL: Source, https://github.com/zitrino-oss/znyx-runtime
Project-URL: Issues, https://github.com/zitrino-oss/znyx-runtime/issues
Keywords: llm,guardrails,inference,ml-serving,ai-security
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: FastAPI
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Security
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: znyx-core>=1.0.0
Requires-Dist: fastapi>=0.109.0
Requires-Dist: uvicorn[standard]>=0.27.0
Requires-Dist: pydantic>=2.5.0
Requires-Dist: httpx>=0.26.0
Provides-Extra: onnx
Requires-Dist: onnxruntime<2.0,>=1.17; extra == "onnx"
Requires-Dist: tokenizers<1.0,>=0.19; extra == "onnx"
Requires-Dist: numpy>=1.24; extra == "onnx"
Provides-Extra: export
Requires-Dist: torch<3.0,>=2.2; extra == "export"
Requires-Dist: transformers<6.0,>=4.40; extra == "export"
Requires-Dist: optimum[exporters,onnxruntime]<3.0,>=1.17; extra == "export"
Requires-Dist: huggingface-hub<2.0,>=0.23; extra == "export"
Provides-Extra: torch
Requires-Dist: torch<3.0,>=2.2; extra == "torch"
Requires-Dist: transformers<6.0,>=4.40; extra == "torch"

# znyx-inference

The optional Znyx inference sidecar: an HTTP service that serves ML models for
model-backed guardrail detection. The [`znyx-runtime`](https://github.com/zitrino-oss/znyx-runtime)
calls it over HTTP to escalate from rules to ML. Without it, the runtime still
works fully on its deterministic rules path.

```bash
# boots dependency-free on a stub runner (no ML stack needed):
pip install znyx-inference

# to serve real model weights on CPU — lean, torch-free (onnxruntime + tokenizers):
pip install "znyx-inference[onnx]"

# offline only: export + quantize a checkpoint to a pinned ONNX artifact (heavy: torch + optimum):
pip install "znyx-inference[export]"
```

## Weights are never bundled

This package ships **code only, no model weights.** You fetch the models you want
explicitly, sha256-pin them, and mount them. Nothing is downloaded implicitly on
the serving path. See [MODELS.md](MODELS.md) for the curated model list, licenses,
and the fetch-and-pin workflow, including which models carry special licenses.

## How it fits

```
your app -> znyx-runtime (rules) --HTTP--> znyx-inference (ML) -> local, pinned weights
```

The sidecar loads only local, sha256-verified weights, fails closed, and never
phones home. If a model is not present it stays on the stub runner and the runtime
falls back to rules per the policy's fallback mode.

See the [repository README](https://github.com/zitrino-oss/znyx-runtime) for the
full architecture.

## License

Apache-2.0. Model weights you fetch are governed by their own licenses (see MODELS.md).
