semvec/pypi-packages huggingface dataset:
cogstack-model-serve 0.0.2
A model serving system for CogStack NLP solutions
Requires Python: >=3.8

# Cogstack ModelServe

A model serving system for CogStack NLP solutions.

## APIs ([docs](https://uclh-criu.github.io/cogstack-model-serve/)):
- [MedCAT SNOMED Model](https://uclh-criu.github.io/cogstack-model-serve/docs/medcat_snomed_model_apis.html)
- [MedCAT ICD10 Model](https://uclh-criu.github.io/cogstack-model-serve/docs/medcat_icd10_model_apis.html)
- [De-Identification Model](https://uclh-criu.github.io/cogstack-model-serve/docs/de-identification_model_apis.html)

## Run ModelServe in the system environment:
After customising `./app/envs/.envs`, run:
```commandline
pip install -r app/requirements.txt
python app/cli/cli.py serve --model-type medcat_snomed --model-path PATH/TO/MODEL_PACKAGE.zip --host 127.0.0.1 --port 8180
```
Then the API docs will be accessible at http://127.0.0.1:8180/docs

## Run ModelServe in the container environment:
After customising `./docker/<SERVICE>/.envs`, run:
```commandline
export MODEL_PACKAGE_FULL_PATH=<PATH/TO/MODEL_PACKAGE.zip>
docker-compose up -d de-identification
```
Then the API docs will be accessible at http://127.0.0.1:8182/docs

## Work with the local/remote model registry:

### Run ModelServe with a registered model:
E.g., with AWS S3 being the model storage backend,
```commandline
pip install -r app/requirements.txt
export AWS_ACCESS_KEY_ID=<AWS_ACCESS_KEY_ID>
export AWS_SECRET_ACCESS_KEY=<AWS_SECRET_ACCESS_KEY>
export MLFLOW_TRACKING_URI=<MLFLOW_TRACKING_URI>
python app/cli/cli.py serve --model-type medcat_icd10 --mlflow-model-uri models:/REGISTERED_MODEL_NAME/Production --host 0.0.0.0 --port 8000
```

### Push and register a pretrained model:
E.g., with AWS S3 being the model storage backend,
```commandline
pip install -r app/requirements.txt
export AWS_ACCESS_KEY_ID=<AWS_ACCESS_KEY_ID>
export AWS_SECRET_ACCESS_KEY=<AWS_SECRET_ACCESS_KEY>
export MLFLOW_TRACKING_URI=<MLFLOW_TRACKING_URI>
python app/cli/cli.py register --model-type medcat_snomed --model-path PATH/TO/MODEL_PACKAGE.zip --model-name REGISTERED_MODEL_NAME
```
hatch-pip-deepfreeze 0.2
Lock hatch environments using pip-deepfreeze
Requires Python: >=3.7

# hatch-pip-deepfreeze

[![PyPI - Version](https://img.shields.io/pypi/v/hatch-pip-deepfreeze.svg)](https://pypi.org/project/hatch-pip-deepfreeze)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/hatch-pip-deepfreeze.svg)](https://pypi.org/project/hatch-pip-deepfreeze)

-----

A [hatch](https://pypi.org/project/hatch/) virtual
[environment](https://hatch.pypa.io/latest/config/environment/overview/) plugin to lock
dependencies with [pip-deepfreeze](https://pypi.org/project/pip-deepfreeze/).

## Installation

`hatch-pip-deepfreeze` must be installed in the same environment as `hatch` itself. 

If `hatch` has been installed with `pipx`:

```console
pipx runpip hatch install hatch-pip-deepfreeze
```

If `hatch` has been installed with `pip` in the user environment:

```console
pip install --user hatch-pip-deepfreeze
```

## Usage

In the `tool.hatch.envs.{name}` section, add `type = "pip-deepfreeze"`.
Such environments behave similarly to the standard hatch `virtual` environments,
except the installation and synchronization is performed using `pip-deepfreeze sync`.

This will automatically generate locked dependencies in `requirements.txt`, and
uninstall unneeded dependencies after removing them from `pyproject.toml`.
It also pins optional dependencies groups in `requirements-{extra}.txt`.

You can use the `features` to install `project.optional-dependencies` in environments.

Note that this pluging does not support per environment `dependencies`, because
`pip-deepfreeze` works exclusively with `project.optional-dependencies` for that.
Fortunately this is well supported by `hatch`.

As an example, you can adapt a `pyproject.toml` generated by `hatch new` like so:

Declare optional dependencies for test:

```toml
[project.optional-dependencies]
test = [
    "pytest",
    "pytest-cov",
]
```

Update the default environment section to remove `dependencies` and add `features`:

```toml
[tool.hatch.envs.default]
type = "pip-deepfreeze"
features = ["test"]
```

Use the usual `hatch` environment activation features such as `hatch shell` and notice
`pip-deepfreeze` in action.

## License

`hatch-pip-deepfreeze` is distributed under the terms of the
[MIT](https://spdx.org/licenses/MIT.html) license.