# helia_edge.cli

``helia-edge`` command line. Keras and TensorFlow are imported only by commands that need them.

## helia_edge.cli.app

`attribute` · `python`

```python
app = typer.Typer(no_args_is_help=True, add_completion=False, help='heliaEDGE model export tools.')
```

Source: `helia_edge/cli.py:14`

## helia_edge.cli.export_app

`attribute` · `python`

```python
export_app = typer.Typer(no_args_is_help=True, help='Create and reproduce exports with their records.')
```

Source: `helia_edge/cli.py:15`

## helia_edge.cli.DEFAULT_IO

`constant` · `python`

```python
DEFAULT_IO = {'fp32': 'float32', 'fp16': 'float16', 'a8w8': 'int8', 'a16w8': 'int16'}
```

Source: `helia_edge/cli.py:18`

## helia_edge.cli.Mode

`class` · `python`

```python
Mode()
```

How ``helia-edge export create`` traces the model.

Source: `helia_edge/cli.py:21`

### helia_edge.cli.Mode.KERAS

`constant` · `python`

```python
KERAS = 'keras'
```

Source: `helia_edge/cli.py:24`

### helia_edge.cli.Mode.CONCRETE

`constant` · `python`

```python
CONCRETE = 'concrete'
```

Source: `helia_edge/cli.py:25`

## helia_edge.cli.export_create

`function` · `python`

```python
export_create(
    spec: Annotated[Path, typer.Argument(help='ModelSpec file (YAML or JSON).', exists=True, dir_okay=False)],
    weights: Annotated[Path, typer.Option(help='A .weights.h5 file, or with --mapping the source file it imports.', exists=True)],
    precision: Annotated[Precision, typer.Option(help='Numeric format of the export.')],
    out: Annotated[Path, typer.Option(help='Output directory.')],
    io_dtype: Annotated[str | None, typer.Option(help='I/O dtype; by default int8, int16 or the float type.')] = None,
    mapping: Annotated[str | None, typer.Option(help="Weight mapping of the spec's family to import with.")] = None,
    calibration: Annotated[Path | None, typer.Option(help='Calibration .npy for a8w8 and a16w8.', exists=True)] = None,
    resets: Annotated[list[int] | None, typer.Option(help='Calibration step that resets the state; repeat.')] = None,
    golden_inputs: Annotated[Path | None, typer.Option(help='Signal .npy for a golden@2 sequence.', exists=True)] = None,
    golden_resets: Annotated[list[int] | None, typer.Option(help='Golden step that resets the state; repeat.')] = None,
    batch_size: Annotated[int, typer.Option(help='Batch of the exported model.', min=1, max=2 ** 31 - 1)] = 1,
    mode: Annotated[Mode, typer.Option(help='How the model is traced.')] = Mode.KERAS,
    strict: Annotated[bool, typer.Option(help='For a8w8 and a16w8, refuse operators without an integer kernel.')] = True,
    state_tie_tolerance: Annotated[float, typer.Option(help="Largest relative scale change when tying a state pair's scales.")] = 0.01,
    require_provenance: Annotated[bool, typer.Option(help='Refuse unless helia-edge is a release or a git install at a commit.')] = False,
) -> None
```

Build SPEC, load its weights, export it and write model.tflite, model.weights.h5 and record.json.

Exit 1 when the install does not identify its code under --require-provenance, or the export is refused.

Source: `helia_edge/cli.py:39`

## helia_edge.cli.export_reproduce

`function` · `python`

```python
export_reproduce(
    record: Annotated[Path, typer.Argument(help='record.json written by `export create` or export().')],
    weights: Annotated[Path, typer.Option(help='The weights file the record names (by digest or sha256).')],
    calibration: Annotated[Path | None, typer.Option(help='The calibration .npy the record names.')] = None,
    golden_inputs: Annotated[Path | None, typer.Option(help="The golden's input .npy, to compare the golden.")] = None,
    allow_env_mismatch: Annotated[bool, typer.Option(help='Compare even if the environment differs; differences are listed.')] = False,
) -> None
```

Export a record's model again and compare.

Exit 0 same, 1 different, 2 environment differs or cannot export, 3 missing or mismatched input,
4 the export failed (with its traceback).

Source: `helia_edge/cli.py:119`

## helia_edge.cli.export_schema

`function` · `python`

```python
export_schema() -> None
```

Print the JSON Schema of the export record (helia-edge/export-record@1).

Source: `helia_edge/cli.py:154`

## helia_edge.cli.inspect_model

`function` · `python`

```python
inspect_model(model: Annotated[Path, typer.Argument(help='A .tflite model.', exists=True, dir_okay=False)]) -> None
```

Print a .tflite model's inputs, outputs and operators as JSON.

Source: `helia_edge/cli.py:162`

## helia_edge.cli.info

`function` · `python`

```python
info() -> None
```

Print versions, the KERAS_BACKEND variable and installed optional capabilities.

Source: `helia_edge/cli.py:185`

## helia_edge.cli.main

`function` · `python`

```python
main() -> None
```

Entry point of the ``helia-edge`` command.

Source: `helia_edge/cli.py:212`
