Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ uv run --with mellea docs/examples/tutorial/example.py
| MCP | <a target="_blank" rel="noopener noreferrer" href="https://colab.research.google.com/github/generative-computing/mellea/blob/main/docs/examples/notebooks/mcp_example.ipynb"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> | Mellea + MCP |


### Installing from source
### `uv`-based installation from source

Fork and clone the repositoy:

Expand All @@ -137,7 +137,7 @@ If you are planning to contribute to the repo, it would be good to have all the
uv pip install .[all] --group dev --group notebook --group docs
```

or
or

```bash
uv sync --all-extras --all-groups
Expand All @@ -149,6 +149,20 @@ Ensure that you install the precommit hooks:
pre-commit install
```

### `conda`/`mamba`-based installation from source

Fork and clone the repositoy:

```bash
git clone ssh://git@github.com/<my-username>/mellea.git && cd mellea/
```

It comes with an installation script, which does all the commands listed above:

```bash
conda/install.sh
```

## Getting started with validation

Mellea supports validation of generation results through a **instruct-validate-repair** pattern.
Expand Down
9 changes: 9 additions & 0 deletions conda/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

name: mellea
channels:
- conda-forge
dependencies:
- python=3.12 # note: at the time of writing, xformer (< vllm) has a broken wheel for 3.13. https://github.com/facebookresearch/xformers/issues/740#issuecomment-2753869337
- uv
variables:
VLLM_USE_V1: 0 # need this to make outlines work
71 changes: 71 additions & 0 deletions conda/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#!/bin/bash -e

CONDA=""
if which mamba > /dev/null
then
CONDA=$(which mamba)
fi
if which conda > /dev/null
then
CONDA=$(which conda)
fi

if [ -z $CONDA ]
then
echo "Error: conda or mamba is not installed or is not in the PATH."
echo "Go to "
echo "* https://github.com/conda-forge/miniforge (open source)"
echo "* https://www.anaconda.com/download/success (registration required)"
echo "to obtain a conda/mamba installer."
else
echo "Using $CONDA for environment setup"
fi


usage(){
echo "Usage: install.sh [-h] [-y]"
echo
echo "-h : show this help"
echo "-y : Adds '-y' option to '$CONDA env [create|remove|...]' command arguments."
exit 1
}

CONDA_OPTIONS=""
while getopts "yh" OPTNAME ; do
case "${OPTNAME}" in
h)
usage
;;
y)
CONDA_OPTIONS="-y"
shift 1
;;
:)
# If expected argument omitted:
echo "Error: -${OPTARG} requires an argument."
exit 1
;;
*)
# If unknown (any other) option:
echo "Error: -${OPTARG} unknown."
exit 1
;;
esac
done

if $CONDA env list | grep -q mellea
then
echo "An existing mellea environment was found."
$CONDA env remove $CONDA_OPTIONS -n mellea
fi


# note:
# this is a portable way (works in linux and osx) to get the directory of this script.
# readlink -ef may not work on osx.
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
$CONDA env create $CONDA_OPTIONS -f $SCRIPT_DIR/environment.yml

$CONDA run -n mellea uv pip install -e .[all] --group dev --group notebook --group docs

$CONDA run -n mellea pre-commit install