Metadata-Version: 2.4
Name: genlm-control
Version: 0.1.0
Author: The GenLM Team
Author-email: Ben LeBrun <benlebrun1@gmail.com>
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: genlm_grammar>=0.1.0
Requires-Dist: genlm-backend>=0.0.1
Requires-Dist: hfppl>=0.1.0
Requires-Dist: arsenal>=3.1.2
Requires-Dist: IPython
Requires-Dist: numpy
Requires-Dist: torch
Requires-Dist: python-lsp-server
Requires-Dist: json-stream
Requires-Dist: jsonschema[format-nongpl]
Provides-Extra: test
Requires-Dist: coverage; extra == "test"
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-benchmark; extra == "test"
Requires-Dist: pytest-asyncio; extra == "test"
Requires-Dist: pytest-timeout; extra == "test"
Requires-Dist: hypothesis; extra == "test"
Requires-Dist: hypothesis-jsonschema; extra == "test"
Provides-Extra: docs
Requires-Dist: mkdocs; extra == "docs"
Requires-Dist: mkdocstrings[python]; extra == "docs"
Requires-Dist: mkdocs-material; extra == "docs"
Requires-Dist: mkdocs-gen-files; extra == "docs"
Requires-Dist: mkdocs-literate-nav; extra == "docs"
Requires-Dist: mkdocs-section-index; extra == "docs"
Dynamic: license-file

[![Docs](https://github.com/chisym/genlm-control/actions/workflows/docs.yml/badge.svg)](https://chisym.github.io/genlm-control/)
[![Tests](https://github.com/chisym/genlm-control/actions/workflows/pytest.yml/badge.svg)](https://chisym.github.io/genlm-control/)

# GenLM Control

GenLM Control is a library for controlled generation with programmable constraints. It leverages sequential Monte Carlo (SMC) methods to efficiently generate text that satisfies constraints or preferences encoded by arbitrary potential functions.

 See the [docs](https://chisym.github.io/genlm-control/) for details and [examples](https://github.com/chisym/genlm-control/tree/main/examples/getting_started.py) for usage.

> **⚠️ Warning:** This library is currently in active development. Please report any bugs in [the issue tracker](https://github.com/chisym/genlm-control/issues).


## Quick Start

### Installation

Clone the repository:
```bash
git clone git@github.com:ChiSym/genlm-control.git
cd genlm-control
```
and install with pip:

```bash
pip install .
```

This installs the package without development dependencies. For development, install in editable mode with:

```bash
pip install -e ".[test,docs]"
```

which also installs the dependencies needed for testing (test) and documentation (docs).

## Requirements

- Python >= 3.11
- The core dependencies listed in the `pyproject.toml` file of the repository.

## Testing

When test dependencies are installed, the test suite can be run via:

```bash
pytest tests
```

## Documentation

Documentation is generated using [mkdocs](https://www.mkdocs.org/) and hosted on GitHub Pages. To build the documentation, run:

```bash
mkdocs build
```

To serve the documentation locally, run:

```bash
mkdocs serve
```
