diff --git a/Makefile b/Makefile index 2a07ee4b..59adf029 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ all: python3 main.py || $(MAKE) deps deps: - pip3 install rich inquirer python-dotenv openai litellm tokentrim + python -m pip install -r requirements.txt install user-install: ln -fs $(PWD)/main.py $(R2_USER_PLUGINS)/r2ai.py diff --git a/README.md b/README.md index 9ce28f31..0fecefe5 100644 --- a/README.md +++ b/README.md @@ -29,30 +29,33 @@ Run a language model in local, without internet, to entertain you or help answer ## Installation -The easiest way to run and install r2ai is by installing the latest r2 from git and run these lines: +This is optional ans system dependant. but on recent Debian/Ubuntu systems the `pip` tool is no longer working, because it conflicts with the system packages. The best way to do this is with `venv`: ```bash -r2pm -i rlang-python # optional -pip3 install rich inquirer llama-cpp tokentrim hugging_face appdirs -r2pm -ci r2ai +python -m venv r2ai +. r2ai/bin/activate ``` -On recent Debian/Ubuntu systems the `pip` tool is no longer working, because it conflicts with the system packages. The best way to do this is with `venv`: - ```bash -python -m venv r2ai -. r2ai/bin/activate -pip install rich inquirer llama-cpp-python tokentrim hugging_face appdirs +pip install -r requirements.txt r2pm -r r2ai ``` +Additionally you can get the `r2ai` command inside r2 to run as an rlang plugin by installing the bindings: + +```bash +r2pm -i rlang-python +make user-install +``` + On native Windows follow these instructions (no need to install radare2 or use r2pm), note that you need Python 3.8 or higher: ```cmd git clone https://github.com/radareorg/r2ai cd r2ai set PATH=C:\Users\YOURUSERNAME\Local\Programs\Python\Python39\;%PATH% -python -m pip install rich inquirer llama-cpp-python tokentrim hugging_face appdirs pyreadline3 +python -m pip -r requirements.txt +python -m pip install pyreadline3 python main.py ``` diff --git a/r2ai/__init__.py b/r2ai/__init__.py index 1abfb97c..f5621a8a 100644 --- a/r2ai/__init__.py +++ b/r2ai/__init__.py @@ -1,13 +1,5 @@ -from .interpreter import Interpreter from .models import models import sys -# This is done so when users `import interpreter`, -# they get an instance of interpreter: -# **This is a controversial thing to do,** lets say is wrong and only allows us to have 1 instance -# because perhaps modules ought to behave like modules. - -#sys.modules["r2ai"] = Interpreter() -#sys.modules["r2ai"].VERSION = "0.2.1" sys.modules["r2ai"].models = models -VERSION = "0.2.2" +VERSION = "0.3.0" diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000..fa2a3c30 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,6 @@ +rich +inquirer +llama-cpp-python +tokentrim +hugging_face +appdirs