Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First, my apologies for not wrapping this up before the holidays, but this work adds an initial CLI which can be used to
create
,update
, anddelete
instances of an a2rchi deployment. Note that before you begin you must also havedocker
anddocker compose
installed on the machine you're using in order for the CLI to work (it acts as a wrapper arounddocker compose
commands).To install the CLI, activate a virtual/conda environment and from the root of the repository (i.e. where the
pyproject.toml
file is) run:This will install A2rchi's dependencies as well as a local CLI tool. You should be able to see that it is installed using the
which
command (your output will be slightly different):The CLI has the following commands:
The
--name
represents the name of your a2rchi deployment and the files for your deployment will be stored under~/.a2rchi/a2rchi-{name}
on your local machine (you don't need to do anything with them, this is just an FYI). The--grafana
flag can be included with the valueTrue
in order to include a Grafana dashboard with your deployment. The--a2rchi-config
is a config provided by the user which can override any of the templatable fields ina2rchi/templates/base-config.yaml
(in the future, we could make them all templatable). For example, I have been using the following config to experiment with using GPT-3.5 for both condensing and answering questions:Now, to create an instance of an A2rchi deployment called
my-a2rchi
(with a grafana dashboard), simply create a file calledexample_conf.yaml
with the contents above and run:It will take up to (a few) minute(s) for the command to finish (and possibly longer the first time you run it b/c
docker
will have to fetch the container images from Docker Hub), but you should ultimately see output similar to:You can verify that all your images are up and running properly by executing the following:
Now, suppose you wanted to re-configure your deployment to use GPT-4 instead, you could accomplish this by modifying
example_conf.yaml
to have the following:And then update the deployment in place as follows:
If you check the logs for
chat-my-a2rchi
(by usingdocker logs chat-my-a2rchi -f
) you should see that it will restart with GPT-4 as its model instead.Note that you could also update your deployments prompts in place by, e.g., creating a new
main.prompt
and providing the filepath to this new prompt in yourexample_conf.yaml
(it would also work if you just updated the prompt(s) in-place and kept their filepath(s) as-is in the config file).Finally, to tear down the deployment, simply run:
Please feel free to ask follow up Q's or let me know if there's anything I can do to make the PR easier to digest!