semvec/pypi-packages huggingface dataset:
kozmoml-mlflow 0.1.0.dev1
MLflow runtime for KozmoML
License: Apache-2.0
Requires Python: <3.12,>=3.9

# MLflow runtime for KozmoML

This package provides a KozmoML runtime compatible with [MLflow
models](https://www.mlflow.org/docs/latest/models.html).

## Usage

You can install the runtime, alongside `kozmoml`, as:

```bash
pip install kozmoml kozmoml-mlflow
```

## Content Types

The MLflow inference runtime introduces a new `dict` content type, which
decodes an incoming V2 request as a [dictionary of
tensors](https://www.mlflow.org/docs/latest/models.html#deploy-mlflow-models).
This is useful for certain MLflow-serialised models, which will expect that the
model inputs are serialised in this format.

```{note}
The `dict` content type can be _stacked_ with other content types, like
[`np`](../../docs/user-guide/content-type).
This allows the user to use a different set of content types to decode each of
the dict entries.
```
kozmoml-huggingface 0.1.0.dev1
HuggingFace runtime for KozmoML
License: Apache-2.0
Requires Python: <3.12,>=3.9

# HuggingFace runtime for KozmoML

This package provides a KozmoML runtime compatible with HuggingFace Transformers.

## Usage

You can install the runtime, alongside `kozmoml`, as:

```bash
pip install kozmoml kozmoml-huggingface
```

For further information on how to use KozmoML with HuggingFace, you can check
out this [worked out example](../../docs/examples/huggingface/README.md).

## Content Types

The HuggingFace runtime will always decode the input request using its own
built-in codec.
Therefore, [content type annotations](../../docs/user-guide/content-type) at
the request level will **be ignored**.
Note that this **doesn't include [input-level content
type](../../docs/user-guide/content-type#Codecs) annotations**, which will be
respected as usual.

## Settings

The HuggingFace runtime exposes a couple extra parameters which can be used to
customise how the runtime behaves.
These settings can be added under the `parameters.extra` section of your
`model-settings.json` file, e.g.

```{code-block} json
---
emphasize-lines: 5-8
---
{
  "name": "qa",
  "implementation": "kozmoml_huggingface.HuggingFaceRuntime",
  "parameters": {
    "extra": {
      "task": "question-answering",
      "optimum_model": true
    }
  }
}
```

````{note}
These settings can also be injected through environment variables prefixed with `KOZMOML_MODEL_HUGGINGFACE_`, e.g.

```bash
KOZMOML_MODEL_HUGGINGFACE_TASK="question-answering"
KOZMOML_MODEL_HUGGINGFACE_OPTIMUM_MODEL=true
```
````

### Loading models
#### Local models
It is possible to load a local model into a HuggingFace pipeline by specifying the model artefact folder path in `parameters.uri` in `model-settings.json`.

#### HuggingFace models
Models in the HuggingFace hub can be loaded by specifying their name in `parameters.extra.pretrained_model` in `model-settings.json`.

````{note}
If `parameters.extra.pretrained_model` is specified, it takes precedence over `parameters.uri`.
````

### Reference

You can find the full reference of the accepted extra settings for the
HuggingFace runtime below:

```{eval-rst}

.. autopydantic_settings:: kozmoml_huggingface.settings.HuggingFaceSettings
```
kozmoml-catboost 0.1.0.dev1
Catboost runtime for KozmoML
License: Apache-2.0
Requires Python: <3.12,>=3.9

# CatBoost runtime for KozmoML

This package provides a KozmoML runtime compatible with CatBoost's `CatboostClassifier`.

## Usage

You can install the runtime, alongside `kozmoml`, as:

```bash
pip install kozmoml kozmoml-catboost
```

For further information on how to use KozmoML with CatBoost, you can check out
this [worked out example](../../docs/examples/catboost/README.md).

## Content Types

If no [content type](../../docs/user-guide/content-type) is present on the
request or metadata, the CatBoost runtime will try to decode the payload as
a [NumPy Array](../../docs/user-guide/content-type).
To avoid this, either send a different content type explicitly, or define the
correct one as part of your [model's
metadata](../../docs/reference/model-settings).