Metadata-Version: 2.4
Name: gennova-box
Version: 0.1.2a1
Summary: GenNova native engine deployment on Linux/Ascend
Author: GenNova-HUST
License-Expression: LicenseRef-Proprietary
Project-URL: Homepage, https://gennova.sage.org.ai/
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: licenses/Qwen3-LICENSE.txt
Dynamic: license-file

# GenNova Box — native Ascend engine preview

GenNova Box starts the **GenNova / LiveModule native inference engine** using
its canonical `gennova serve transformer` Solution. Model execution uses
GenNova's Ascend graph runtime, native scheduler and numerical/OPP payload.

## Installation

The launcher wheel targets CPython 3.9 / Linux aarch64. The engine runs in its
own matched Python 3.12 environment with GenNova/LiveModule 0.2.0 from the
pinned revision recorded in the package manifest, Torch/Torch-NPU 2.10 and
compatible CANN 9.1/Ascend native libraries already installed. This wheel does
not distribute or install the GenNova runtime, Torch, CANN or drivers.
Install the matched GenNova runtime using its normal native wheel/build process.

```sh
python -m pip install gennova-box==0.1.2a1
gennova-box start --engine-python /path/to/gennova-runtime/bin/python
gennova-box status
gennova-box stop
```

Successful startup saves the runtime selection, so later `gennova-box start`
uses the same configuration. `GENNOVA_ENGINE_PYTHON` also selects the runtime.
`gennova-box doctor --engine-python /path/to/python` checks the installed
engine version, critical source identities and complete Ascend native payload
without admitting inference work. A mismatched or absent runtime fails.

This initial native recipe uses **two idle, authorized Ascend devices**
(default `--devices 0,1`), tensor parallel size 2, and Qwen3 4B BF16.
It downloads a pinned native safetensors checkpoint and tokenizer with SHA-256
verification. Hugging Face is tried first, then hf-mirror.com and ModelScope; all mirrors must match the same pinned SHA-256. Model weights
are not inside the wheel. `--checkpoint /path/to/Qwen3-4B` selects an existing
native checkpoint visible to the engine environment.

## Local service

- API base: `http://127.0.0.1:18181/v1`; model: `gennova-local`.
- Key: `~/.local/share/gennova-box-ascend/api-key.txt`, owner-only permissions.
- Model, logs, settings and state: `~/.local/share/gennova-box-ascend/`;
  override with `GENNOVA_BOX_DATA`.
- Context 1024; one decode request; output ceiling 256; native model is BF16.
- Chat requests require `stream=true`, `temperature=0` and `n=1`; the native
  service supports streaming, greedy, single-completion text only. Nonstreaming
  requests are rejected with HTTP 400.
- Requests can set `chat_template_kwargs={"enable_thinking": false}`.
- CANN environment defaults to `/usr/local/Ascend/ascend-toolkit/set_env.sh`;
  override with `GENNOVA_CANN_ENV`.

GenNova itself owns authenticated HTTP, SSE, model loading, graph capture,
scheduling, execution and shutdown. Box owns the host process lease, physical
device locks, checkpoint preparation and readiness checks. The caller needs
permissions for the device nodes and `/var/lock/gennova-npu`. No startup-at-boot
service is installed. Closing the terminal leaves the service running; use
`gennova-box stop` to request authenticated native shutdown and release it.
Box allows 30 seconds for native drain, then uses bounded signal termination
if the process remains alive. Logs, models and keys are retained.

## Scope and distribution

This native preview replaces the incorrectly selected backend in 0.1.1a1.
Its Linux start path has no llama.cpp build, llama-server process, GGUF inference
or CPU fallback. Windows desktop migration is not part of this wheel.

The Box deployment implementation is Cython-compiled into a native extension;
its wheel contains no proprietary Python/C source or bytecode, and its build
rejects source distributions. Compilation raises reverse-engineering cost,
without guaranteeing source confidentiality. The separately installed GenNova
runtime has its own distribution and third-party license obligations.

This is bounded deployment functionality, not full accuracy, performance,
endurance or production certification. Optional State, D and Autotune
integrations are outside this preview's acceptance scope. Shared runtime State
used for model execution must not be confused with an optional external
GenNova State service. GenNova/LiveModule and Qwen3 retain their Apache-2.0 and
applicable third-party notices; the Box launcher distribution is proprietary.
